Merge branch 'devel' into feature/ansible_provision
This commit is contained in:
commit
a4f1696b2a
|
@ -55,26 +55,26 @@ cp -r %{_gitdir}/rpm/scripts/shelfzilla $RPM_BUILD_ROOT%{_app_dir}/init/
|
||||||
# -------------------------------------------------------------------------------------------- #
|
# -------------------------------------------------------------------------------------------- #
|
||||||
%post
|
%post
|
||||||
## Install init script
|
## Install init script
|
||||||
mv %{_app_dir}/init/shelfzilla %{_init_path}/
|
#mv %{_app_dir}/init/shelfzilla %{_init_path}/
|
||||||
chmod 775 %{_init_path}/shelfzilla
|
#chmod 775 %{_init_path}/shelfzilla
|
||||||
chkconfig --add shelfzilla
|
#chkconfig --add shelfzilla
|
||||||
rmdir %{_app_dir}/init/
|
#rmdir %{_app_dir}/init/
|
||||||
|
|
||||||
## Npm install
|
## Npm install
|
||||||
cd %{_app_dir} && npm install --production
|
#cd %{_app_dir} && npm install --production
|
||||||
|
|
||||||
## pip install
|
## pip install
|
||||||
pip install -r %{_app_dir}/config/production/requirements.txt
|
#pip install -r %{_app_dir}/config/production/requirements.txt
|
||||||
|
|
||||||
## Migrate
|
## Migrate
|
||||||
python2.7 %{_app_dir}/manage.py migrate --no-initial-data
|
#python2.7 %{_app_dir}/manage.py migrate --no-initial-data
|
||||||
|
|
||||||
## Bower
|
## Bower
|
||||||
cd %{_app_dir}
|
#cd %{_app_dir}
|
||||||
bower install --allow-root
|
#bower install --allow-root
|
||||||
|
|
||||||
## Collect static
|
## Collect static
|
||||||
python2.7 manage.py collectstatic --clear --noinput
|
#python2.7 manage.py collectstatic --clear --noinput
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------------------- #
|
# -------------------------------------------------------------------------------------------- #
|
||||||
# pre-uninstall section:
|
# pre-uninstall section:
|
||||||
|
|
|
@ -84,19 +84,21 @@ class UserAdmin(DjangoUserAdmin):
|
||||||
(None, {'fields': ('username', 'email', 'password')}),
|
(None, {'fields': ('username', 'email', 'password')}),
|
||||||
(_('Personal info'), {'fields': (
|
(_('Personal info'), {'fields': (
|
||||||
'first_name', 'last_name', 'birthdate', 'gender', )}),
|
'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
|
# add_fieldsets is not a standard ModelAdmin attribute. UserAdmin
|
||||||
# overrides get_fieldsets to use this attribute when creating a user.
|
# overrides get_fieldsets to use this attribute when creating a user.
|
||||||
add_fieldsets = (
|
add_fieldsets = (
|
||||||
(None, {
|
(None, {
|
||||||
'classes': ('wide',),
|
'classes': ('wide',),
|
||||||
'fields': ('email', 'birthdate', 'password1', 'password2')
|
'fields': ('username', 'email', 'password1', 'password2')
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
search_fields = ('email',)
|
search_fields = ('email',)
|
||||||
ordering = ('email',)
|
ordering = ('email',)
|
||||||
filter_horizontal = ()
|
filter_horizontal = ('user_permissions', )
|
||||||
|
readonly_fields = ('date_joined', 'last_login', )
|
||||||
|
|
||||||
# Now register the new UserAdmin...
|
# Now register the new UserAdmin...
|
||||||
admin.site.register(models.User, UserAdmin)
|
admin.site.register(models.User, UserAdmin)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import django.utils.timezone
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('auth', '0003_auto_20141104_2302'),
|
('auth', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
@ -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,
|
||||||
|
),
|
||||||
|
]
|
|
@ -23,7 +23,7 @@ class User(AbstractBaseUser,
|
||||||
@property
|
@property
|
||||||
def avatar(self):
|
def avatar(self):
|
||||||
avatar = '{}{}?s=300'.format(
|
avatar = '{}{}?s=300'.format(
|
||||||
'http://www.gravatar.com/avatar/',
|
'https://www.gravatar.com/avatar/',
|
||||||
md5(self.email.lower()).hexdigest()
|
md5(self.email.lower()).hexdigest()
|
||||||
)
|
)
|
||||||
return avatar
|
return avatar
|
||||||
|
@ -40,10 +40,7 @@ class User(AbstractBaseUser,
|
||||||
verbose_name=_('Username'),
|
verbose_name=_('Username'),
|
||||||
max_length=128,
|
max_length=128,
|
||||||
unique=True,
|
unique=True,
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
db_index=True,
|
db_index=True,
|
||||||
default=None,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# personal info
|
# personal info
|
||||||
|
@ -93,7 +90,7 @@ class User(AbstractBaseUser,
|
||||||
)
|
)
|
||||||
|
|
||||||
USERNAME_FIELD = 'username'
|
USERNAME_FIELD = 'username'
|
||||||
REQUIRED_FIELDS = ('email', )
|
REQUIRED_FIELDS = ('email',)
|
||||||
|
|
||||||
objects = UserManager()
|
objects = UserManager()
|
||||||
|
|
||||||
|
@ -101,7 +98,7 @@ class User(AbstractBaseUser,
|
||||||
verbose_name = _('User')
|
verbose_name = _('User')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.username
|
return unicode(self.username) or unicode(self.email)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_confirmed(self):
|
def is_confirmed(self):
|
||||||
|
|
|
@ -33,8 +33,8 @@ ALLOWED_HOSTS = []
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
# Auth
|
# Auth
|
||||||
'shelfzilla.apps.account',
|
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
|
'shelfzilla.apps.account',
|
||||||
|
|
||||||
# Admin
|
# Admin
|
||||||
'suit',
|
'suit',
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
submitButton.on('click', function() {
|
submitButton.on('click', function() {
|
||||||
$.getJSON(
|
$.getJSON(
|
||||||
'http://google-images-api.eu01.aws.af.cm/',
|
'https://google-images-api.eu01.aws.af.cm/',
|
||||||
{ q: searchQuery(), limit: searchLimit() },
|
{ q: searchQuery(), limit: searchLimit() },
|
||||||
function(data) {
|
function(data) {
|
||||||
results.html('');
|
results.html('');
|
||||||
|
|
|
@ -8,10 +8,15 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="well text-center volume-item volume-{{ type }}" style="background: white url({{ volume_thumb.url }}) center left no-repeat;">
|
<div class="well text-center volume-item volume-{{ type }}" style="background: white url({{ volume_thumb.url }}) center left no-repeat;">
|
||||||
|
{% if request.user.is_authenticated %}
|
||||||
<div data-pjax-container="v{{ volume.pk }}">
|
<div data-pjax-container="v{{ volume.pk }}">
|
||||||
{% include "manga/series/includes/volume-badges.html" %}
|
{% include "manga/series/includes/volume-badges.html" %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="text-center volume-content">
|
<div class="text-center volume-content">
|
||||||
|
{% if show_name %}
|
||||||
|
<div><strong><a href="{{ volume.series.get_absolute_url }}">{{ volume.series.name }}</a></strong></div>
|
||||||
|
{% endif %}
|
||||||
{% if type == 'slim' %}
|
{% if type == 'slim' %}
|
||||||
<a href="{{ volume.series.get_absolute_url }}" data-pjax>
|
<a href="{{ volume.series.get_absolute_url }}" data-pjax>
|
||||||
<h4 class="media-heading">{{ volume }}</h4>
|
<h4 class="media-heading">{{ volume }}</h4>
|
||||||
|
|
|
@ -25,11 +25,11 @@
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
<a data-pjax-nav href="{% url 'profile' item.username %}" data-pjax class="list-group-item {% if section == 'summary' %}active{% endif %}">
|
<a data-pjax-nav href="{% url 'profile' item.username %}" data-pjax class="list-group-item {% if section == 'summary' %}active{% endif %}">
|
||||||
{% trans "Summary" %}</a>
|
{% trans "Summary" %}</a>
|
||||||
{% if user.have_volumes.count > 0 %}
|
{% if item.have_volumes.count > 0 %}
|
||||||
<a data-pjax-nav href="{% url 'profile' item.username 'collection' %}" data-pjax="profile" class="list-group-item {% if section == 'collection' %}active{% endif %}">
|
<a data-pjax-nav href="{% url 'profile' item.username 'collection' %}" data-pjax="profile" class="list-group-item {% if section == 'collection' %}active{% endif %}">
|
||||||
{% trans "Collection" %}</a>
|
{% trans "Collection" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if user.wishlisted_volumes.count > 0 %}
|
{% if item.wishlisted_volumes.count > 0 %}
|
||||||
<a data-pjax-nav href="{% url 'profile' item.username 'wishlist' %}" data-pjax="profile" class="list-group-item {% if section == 'wishlist' %}active{% endif %}">
|
<a data-pjax-nav href="{% url 'profile' item.username 'wishlist' %}" data-pjax="profile" class="list-group-item {% if section == 'wishlist' %}active{% endif %}">
|
||||||
{% trans "Wishlist" %}</a>
|
{% trans "Wishlist" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for owned_volume in item.have_volumes.all %}
|
{% for owned_volume in item.have_volumes.all %}
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
{% 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 %}
|
||||||
</div>
|
</div>
|
||||||
{% if forloop.counter|divisibleby:3 %}
|
{% if forloop.counter|divisibleby:3 %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for wishlisted_volume in item.wishlisted_volumes.all %}
|
{% for wishlisted_volume in item.wishlisted_volumes.all %}
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
{% 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 %}
|
||||||
</div>
|
</div>
|
||||||
{% if forloop.counter|divisibleby:3 %}
|
{% if forloop.counter|divisibleby:3 %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in New Issue