fmartingr
/
shelfzilla
Archived
1
0
Fork 0

Merge branch 'devel' into feature/ansible_provision

This commit is contained in:
Juan Manuel Parrilla 2015-04-13 21:01:23 +02:00
commit a4f1696b2a
11 changed files with 50 additions and 26 deletions

View File

@ -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:

View File

@ -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)

View File

@ -8,7 +8,7 @@ import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0003_auto_20141104_2302'),
('auth', '0001_initial'),
]
operations = [

View File

@ -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,
),
]

View File

@ -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):

View File

@ -33,8 +33,8 @@ ALLOWED_HOSTS = []
INSTALLED_APPS = (
# Auth
'shelfzilla.apps.account',
'django.contrib.auth',
'shelfzilla.apps.account',
# Admin
'suit',

View File

@ -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('');

View File

@ -8,10 +8,15 @@
<div>
<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 }}">
{% include "manga/series/includes/volume-badges.html" %}
</div>
{% endif %}
<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' %}
<a href="{{ volume.series.get_absolute_url }}" data-pjax>
<h4 class="media-heading">{{ volume }}</h4>

View File

@ -25,11 +25,11 @@
<div class="list-group">
<a data-pjax-nav href="{% url 'profile' item.username %}" data-pjax class="list-group-item {% if section == 'summary' %}active{% endif %}">
{% 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 %}">
{% trans "Collection" %}</a>
{% 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 %}">
{% trans "Wishlist" %}</a>
{% endif %}

View File

@ -7,7 +7,7 @@
<div class="row">
{% for owned_volume in item.have_volumes.all %}
<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>
{% if forloop.counter|divisibleby:3 %}
</div>

View File

@ -7,7 +7,7 @@
<div class="row">
{% for wishlisted_volume in item.wishlisted_volumes.all %}
<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>
{% if forloop.counter|divisibleby:3 %}
</div>