diff --git a/rpm/spec/shelfzilla.spec b/rpm/spec/shelfzilla.spec index 8f35386..c6aac2d 100644 --- a/rpm/spec/shelfzilla.spec +++ b/rpm/spec/shelfzilla.spec @@ -55,26 +55,26 @@ cp -r %{_gitdir}/rpm/scripts/shelfzilla $RPM_BUILD_ROOT%{_app_dir}/init/ # -------------------------------------------------------------------------------------------- # %post ## Install init script -mv %{_app_dir}/init/shelfzilla %{_init_path}/ -chmod 775 %{_init_path}/shelfzilla -chkconfig --add shelfzilla -rmdir %{_app_dir}/init/ +#mv %{_app_dir}/init/shelfzilla %{_init_path}/ +#chmod 775 %{_init_path}/shelfzilla +#chkconfig --add shelfzilla +#rmdir %{_app_dir}/init/ ## Npm install -cd %{_app_dir} && npm install --production +#cd %{_app_dir} && npm install --production ## pip install -pip install -r %{_app_dir}/config/production/requirements.txt +#pip install -r %{_app_dir}/config/production/requirements.txt ## Migrate -python2.7 %{_app_dir}/manage.py migrate --no-initial-data +#python2.7 %{_app_dir}/manage.py migrate --no-initial-data ## Bower -cd %{_app_dir} -bower install --allow-root +#cd %{_app_dir} +#bower install --allow-root ## Collect static -python2.7 manage.py collectstatic --clear --noinput +#python2.7 manage.py collectstatic --clear --noinput # -------------------------------------------------------------------------------------------- # # pre-uninstall section: diff --git a/shelfzilla/apps/account/admin.py b/shelfzilla/apps/account/admin.py index a38afd8..6c72074 100644 --- a/shelfzilla/apps/account/admin.py +++ b/shelfzilla/apps/account/admin.py @@ -84,19 +84,21 @@ class UserAdmin(DjangoUserAdmin): (None, {'fields': ('username', 'email', 'password')}), (_('Personal info'), {'fields': ( 'first_name', 'last_name', 'birthdate', 'gender', )}), - (_('Permissions'), {'fields': ('is_staff',)}), + (_('Permissions'), {'fields': ('is_staff', 'user_permissions')}), + (_('Information'), {'fields': ('date_joined', 'last_login', )}) ) # add_fieldsets is not a standard ModelAdmin attribute. UserAdmin # overrides get_fieldsets to use this attribute when creating a user. add_fieldsets = ( (None, { 'classes': ('wide',), - 'fields': ('email', 'birthdate', 'password1', 'password2') + 'fields': ('username', 'email', 'password1', 'password2') }), ) search_fields = ('email',) ordering = ('email',) - filter_horizontal = () + filter_horizontal = ('user_permissions', ) + readonly_fields = ('date_joined', 'last_login', ) # Now register the new UserAdmin... admin.site.register(models.User, UserAdmin) diff --git a/shelfzilla/apps/account/migrations/0001_initial.py b/shelfzilla/apps/account/migrations/0001_initial.py index 6eed83d..ec1a8d5 100644 --- a/shelfzilla/apps/account/migrations/0001_initial.py +++ b/shelfzilla/apps/account/migrations/0001_initial.py @@ -8,7 +8,7 @@ import django.utils.timezone class Migration(migrations.Migration): dependencies = [ - ('auth', '0003_auto_20141104_2302'), + ('auth', '0001_initial'), ] operations = [ diff --git a/shelfzilla/apps/account/migrations/0002_auto_20141111_1208.py b/shelfzilla/apps/account/migrations/0002_auto_20141111_1208.py new file mode 100644 index 0000000..ad305e6 --- /dev/null +++ b/shelfzilla/apps/account/migrations/0002_auto_20141111_1208.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='username', + field=models.CharField(unique=True, max_length=128, verbose_name='Username', db_index=True), + preserve_default=True, + ), + ] diff --git a/shelfzilla/apps/account/models.py b/shelfzilla/apps/account/models.py index a75d518..bc00560 100644 --- a/shelfzilla/apps/account/models.py +++ b/shelfzilla/apps/account/models.py @@ -23,7 +23,7 @@ class User(AbstractBaseUser, @property def avatar(self): avatar = '{}{}?s=300'.format( - 'http://www.gravatar.com/avatar/', + 'https://www.gravatar.com/avatar/', md5(self.email.lower()).hexdigest() ) return avatar @@ -40,10 +40,7 @@ class User(AbstractBaseUser, verbose_name=_('Username'), max_length=128, unique=True, - blank=True, - null=True, db_index=True, - default=None, ) # personal info @@ -93,7 +90,7 @@ class User(AbstractBaseUser, ) USERNAME_FIELD = 'username' - REQUIRED_FIELDS = ('email', ) + REQUIRED_FIELDS = ('email',) objects = UserManager() @@ -101,7 +98,7 @@ class User(AbstractBaseUser, verbose_name = _('User') def __unicode__(self): - return self.username + return unicode(self.username) or unicode(self.email) @property def is_confirmed(self): diff --git a/shelfzilla/settings/base.py b/shelfzilla/settings/base.py index f87ede0..b82c226 100644 --- a/shelfzilla/settings/base.py +++ b/shelfzilla/settings/base.py @@ -33,8 +33,8 @@ ALLOWED_HOSTS = [] INSTALLED_APPS = ( # Auth - 'shelfzilla.apps.account', 'django.contrib.auth', + 'shelfzilla.apps.account', # Admin 'suit', diff --git a/shelfzilla/themes/bootflat/templates/_admin/volumes/includes/cover.html b/shelfzilla/themes/bootflat/templates/_admin/volumes/includes/cover.html index 3645c18..922b633 100644 --- a/shelfzilla/themes/bootflat/templates/_admin/volumes/includes/cover.html +++ b/shelfzilla/themes/bootflat/templates/_admin/volumes/includes/cover.html @@ -36,7 +36,7 @@ submitButton.on('click', function() { $.getJSON( - 'http://google-images-api.eu01.aws.af.cm/', + 'https://google-images-api.eu01.aws.af.cm/', { q: searchQuery(), limit: searchLimit() }, function(data) { results.html(''); diff --git a/shelfzilla/themes/bootflat/templates/manga/series/includes/volume.html b/shelfzilla/themes/bootflat/templates/manga/series/includes/volume.html index 38bf36a..05c59fc 100644 --- a/shelfzilla/themes/bootflat/templates/manga/series/includes/volume.html +++ b/shelfzilla/themes/bootflat/templates/manga/series/includes/volume.html @@ -8,10 +8,15 @@
+ {% if request.user.is_authenticated %}
{% include "manga/series/includes/volume-badges.html" %}
+ {% endif %}
+ {% if show_name %} +
{{ volume.series.name }}
+ {% endif %} {% if type == 'slim' %}

{{ volume }}

diff --git a/shelfzilla/themes/bootflat/templates/users/profile.html b/shelfzilla/themes/bootflat/templates/users/profile.html index aa86010..b65acc5 100644 --- a/shelfzilla/themes/bootflat/templates/users/profile.html +++ b/shelfzilla/themes/bootflat/templates/users/profile.html @@ -25,11 +25,11 @@
{% trans "Summary" %} - {% if user.have_volumes.count > 0 %} + {% if item.have_volumes.count > 0 %} {% trans "Collection" %} {% endif %} - {% if user.wishlisted_volumes.count > 0 %} + {% if item.wishlisted_volumes.count > 0 %} {% trans "Wishlist" %} {% endif %} diff --git a/shelfzilla/themes/bootflat/templates/users/profile/collection.html b/shelfzilla/themes/bootflat/templates/users/profile/collection.html index ad4c985..80515ae 100644 --- a/shelfzilla/themes/bootflat/templates/users/profile/collection.html +++ b/shelfzilla/themes/bootflat/templates/users/profile/collection.html @@ -7,7 +7,7 @@
{% for owned_volume in item.have_volumes.all %}
- {% include "manga/series/includes/volume.html" with volume=owned_volume.volume user=item show_publisher=True %} + {% include "manga/series/includes/volume.html" with volume=owned_volume.volume user=item show_publisher=True show_name=True %}
{% if forloop.counter|divisibleby:3 %}
diff --git a/shelfzilla/themes/bootflat/templates/users/profile/wishlist.html b/shelfzilla/themes/bootflat/templates/users/profile/wishlist.html index bea8456..a5df0c0 100644 --- a/shelfzilla/themes/bootflat/templates/users/profile/wishlist.html +++ b/shelfzilla/themes/bootflat/templates/users/profile/wishlist.html @@ -7,7 +7,7 @@
{% for wishlisted_volume in item.wishlisted_volumes.all %}
- {% include "manga/series/includes/volume.html" with volume=wishlisted_volume.volume user=item show_publisher=True %} + {% include "manga/series/includes/volume.html" with volume=wishlisted_volume.volume user=item show_publisher=True show_name=True %}
{% if forloop.counter|divisibleby:3 %}