Added direct links to admin site if user is staff for series, volumes and publishers
Added context manager with the user configuration (not implemented) and user is staff bool
This commit is contained in:
parent
a36ec8e795
commit
66ca8ccde5
|
@ -241,6 +241,7 @@ def makemessages():
|
|||
run('django-admin.py makemessages -l es', quiet=True)
|
||||
"""
|
||||
|
||||
@task_environment
|
||||
@task
|
||||
def clean_backups(BCK_BASE_PATH='/backups/sql', DAYS='30'):
|
||||
"""
|
||||
|
@ -250,6 +251,7 @@ def clean_backups(BCK_BASE_PATH='/backups/sql', DAYS='30'):
|
|||
with settings(hide('warnings', 'running', 'stdout', 'stderr')):
|
||||
local('find %s -mtime +%s -exec rm -rf {} \;' % (BCK_BASE_PATH, DAYS))
|
||||
|
||||
@task_environment
|
||||
@task
|
||||
def backup():
|
||||
"""
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
def user_is_staff(request):
|
||||
return {
|
||||
'USER_IS_STAFF': request.user.is_staff
|
||||
}
|
||||
|
||||
|
||||
def user_configuration(request):
|
||||
return {
|
||||
'USER_CONFIG': {
|
||||
'show_admin_links': False
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -8,8 +8,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-08-24 17:04+0200\n"
|
||||
"PO-Revision-Date: 2014-08-24 17:04+0200\n"
|
||||
"POT-Creation-Date: 2014-08-24 17:18+0200\n"
|
||||
"PO-Revision-Date: 2014-08-24 17:18+0200\n"
|
||||
"Last-Translator: Felipe Martin <fmartingr@me.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -115,7 +115,7 @@ msgstr "Editorial"
|
|||
|
||||
#: apps/manga/models.py:54 themes/bootflat/templates/_layout.html:36
|
||||
#: themes/bootflat/templates/manga/publishers/list.html:4
|
||||
#: themes/bootflat/templates/manga/series/detail.html:64
|
||||
#: themes/bootflat/templates/manga/series/detail.html:70
|
||||
msgid "Publishers"
|
||||
msgstr "Editoriales"
|
||||
|
||||
|
@ -124,7 +124,7 @@ msgid "Summary"
|
|||
msgstr "Resumen"
|
||||
|
||||
#: apps/manga/models.py:62
|
||||
#: themes/bootflat/templates/manga/series/detail.html:25
|
||||
#: themes/bootflat/templates/manga/series/detail.html:31
|
||||
msgid "Finished"
|
||||
msgstr "Finalizado"
|
||||
|
||||
|
@ -326,7 +326,7 @@ msgstr "Sin resultados"
|
|||
|
||||
#: themes/bootflat/templates/manga/publishers/detail.html:14
|
||||
#: themes/bootflat/templates/manga/publishers/detail.html:43
|
||||
#: themes/bootflat/templates/manga/series/detail.html:19
|
||||
#: themes/bootflat/templates/manga/series/detail.html:25
|
||||
#: themes/bootflat/templates/manga/series/includes/volume.html:25
|
||||
msgid "Requires review"
|
||||
msgstr "Requiere revisión"
|
||||
|
@ -335,23 +335,28 @@ msgstr "Requiere revisión"
|
|||
msgid "Homepage"
|
||||
msgstr "Página principal"
|
||||
|
||||
#: themes/bootflat/templates/manga/series/detail.html:23
|
||||
#: themes/bootflat/templates/manga/series/detail.html:10
|
||||
#: themes/bootflat/templates/manga/series/includes/volume.html:42
|
||||
msgid "Edit in admin"
|
||||
msgstr "Editar en el admin"
|
||||
|
||||
#: themes/bootflat/templates/manga/series/detail.html:29
|
||||
msgid "Status"
|
||||
msgstr "Estado"
|
||||
|
||||
#: themes/bootflat/templates/manga/series/detail.html:27
|
||||
#: themes/bootflat/templates/manga/series/detail.html:33
|
||||
msgid "Open"
|
||||
msgstr "Abierta"
|
||||
|
||||
#: themes/bootflat/templates/manga/series/detail.html:35
|
||||
#: themes/bootflat/templates/manga/series/detail.html:41
|
||||
msgid "Art"
|
||||
msgstr "Arte"
|
||||
|
||||
#: themes/bootflat/templates/manga/series/detail.html:50
|
||||
#: themes/bootflat/templates/manga/series/detail.html:56
|
||||
msgid "Story"
|
||||
msgstr "Historia"
|
||||
|
||||
#: themes/bootflat/templates/manga/series/detail.html:69
|
||||
#: themes/bootflat/templates/manga/series/detail.html:75
|
||||
msgid "Original publisher"
|
||||
msgstr "Editorial original"
|
||||
|
||||
|
|
|
@ -79,6 +79,8 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
|||
'shelfzilla.apps.pjax.context_processors.pjax',
|
||||
'shelfzilla.apps.manga.context_processors.user_have_volumes',
|
||||
'shelfzilla.apps.manga.context_processors.user_wishlisted_volumes',
|
||||
'shelfzilla.apps.users.context_processors.user_is_staff',
|
||||
'shelfzilla.apps.users.context_processors.user_configuration',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
|
|
|
@ -53,6 +53,11 @@
|
|||
width: @size;
|
||||
}
|
||||
}
|
||||
|
||||
.admin {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-nav {
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
|
||||
{% block main_content %}
|
||||
<div class="container">
|
||||
{% if USER_IS_STAFF and USER_CONFIG.show_admin_links %}
|
||||
<div class="text-right">
|
||||
<a class="btn btn-info" href="{% url 'admin:manga_publisher_change' item.pk %}">{% trans "Edit in admin" %}</a>
|
||||
</div>
|
||||
<br />
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-primary">
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
|
||||
{% block main_content %}
|
||||
<div class="container">
|
||||
{% if USER_IS_STAFF and USER_CONFIG.show_admin_links %}
|
||||
<div class="text-right">
|
||||
<a class="btn btn-info" href="{% url 'admin:manga_series_change' item.pk %}">{% trans "Edit in admin" %}</a>
|
||||
</div>
|
||||
<br />
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-warning">
|
||||
|
|
|
@ -35,4 +35,11 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<img src="{% thumbnail volume.cover 150x150 %}" class="volume-cover max-width-80" />
|
||||
{% if USER_IS_STAFF and USER_CONFIG.show_admin_links %}
|
||||
<div class="admin">
|
||||
<a class="btn btn-info btn-xs"
|
||||
href="{% url 'admin:manga_volume_change' volume.pk %}">
|
||||
{% trans "Edit in admin" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-normal btn-block">{% trans "Edit my profile" %} <- NOT WORKING</button>
|
||||
<button class="btn btn-info btn-block">{% trans "Edit my profile" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-9" data-pjax-container="profile">
|
||||
|
|
|
@ -7,18 +7,19 @@
|
|||
|
||||
{% block profile_content %}
|
||||
<div class="row text-center">
|
||||
<div class="col-sm-3">
|
||||
<div class="col-sm-6">
|
||||
<div class="well">
|
||||
<h2 class="no-margin-top">{{ user.have_volumes.count }}</h2>
|
||||
{% trans "Volumes owned" %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="col-sm-6">
|
||||
<div class="well">
|
||||
<h2 class="no-margin-top">{{ user.wishlisted_volumes.count }}</h2>
|
||||
{% trans "Volumes wishlisted" %}
|
||||
</div>
|
||||
</div>
|
||||
{% comment %}
|
||||
<div class="col-sm-3">
|
||||
<div class="well">
|
||||
<h2 class="no-margin-top">--</h2>
|
||||
|
@ -31,6 +32,7 @@
|
|||
Other
|
||||
</div>
|
||||
</div>
|
||||
{% endcomment %}
|
||||
</div>
|
||||
<div class="well">
|
||||
<p>Interesting. No, wait, the other thing: tedious. What are you hacking off? Is it my torso?! 'It is!' My precious torso! Yes, if you make it look like an electrical fire. When you do things right, people won't be sure you've done anything at all. Take me to your leader! Ven ve voke up, ve had zese wodies.</p>
|
||||
|
|
Reference in New Issue