split staff area in half (orga + admin)

This commit is contained in:
Élie Bouttier 2017-10-09 20:31:45 +02:00
parent 7f588a1fd5
commit 812e2ef0f4
9 changed files with 95 additions and 68 deletions

View File

@ -0,0 +1,20 @@
{% extends 'base.html' %}
{% load staticfiles i18n %}
{% block admintab %} class="active"{% endblock %}
{% block navbar %}
{{ block.super }}
<div class="container">
<ul class="nav nav-pills nav-justified subnav">
<li{% block conferencetab %}{% endblock %}><a href="{% url 'conference' %}"><span class="glyphicon glyphicon-asterisk"></span>&nbsp;{% trans "Conference" %}</a></li>
{% if request.user.is_staff %}
<li><a href="{% url 'admin:index' %}"><span class="glyphicon glyphicon-dashboard"></span>&nbsp;Django-Admin</a></li>
{% endif %}
</ul>
</div>
{% endblock %}
{% block content %}
{% trans "Please select a category." %}
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends 'cfp/staff/base.html' %}
{% extends 'cfp/admin/base.html' %}
{% load i18n crispy_forms_tags %}
{% block conferencetab %} class="active"{% endblock %}

View File

@ -5,23 +5,18 @@
{% block navbar %}
{{ block.super }}
<ul class="nav nav-tabs nav-justified subnav">
{% comment %}
<li{% block topicstab %}{% endblock %}><a href="{% url 'list-topics' %}"><span class="glyphicon glyphicon-tag"></span>&nbsp;{% trans "Topics" %}</a></li>
<li{% block volunteerstab %}{% endblock %}><a href="{% url 'list-volunteers' %}"><span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;{% trans "Volunteers" %}</a></li>
<li{% block correspondentstab %}{% endblock %}><a href="{% url 'list-correspondents' %}"><span class="glyphicon glyphicon-envelope"></span>&nbsp;{% trans "Correspondents" %}</a></li>
<li{% block conferencetab %}{% endblock %}><a href="{% url 'edit-conference' %}"><span class="glyphicon glyphicon-cog"></span>&nbsp;{% trans "Conference" %}</a></li>
{% endcomment %}
<li{% block talkstab %}{% endblock %}><a href="{% url 'talk-list' %}"><span class="glyphicon glyphicon-blackboard"></span>&nbsp;{% trans "Talks" %}</a></li>
<li{% block speakerstab %}{% endblock %}><a href="{% url 'participant-list' %}"><span class="glyphicon glyphicon-bullhorn"></span>&nbsp;{% trans "Speakers" %}</a></li>
<li{% block trackstab %}{% endblock %}><a href="{% url 'track-list' %}"><span class="glyphicon glyphicon-screenshot"></span>&nbsp;{% trans "Tracks" %}</a></li>
<li{% block roomstab %}{% endblock %}><a href="{% url 'room-list' %}"><span class="glyphicon glyphicon-tent"></span>&nbsp;{% trans "Rooms" %}</a></li>
<li{% block scheduletab %}{% endblock %}><a href="{% url 'staff-schedule' %}"><span class="glyphicon glyphicon-calendar"></span>&nbsp;{% trans "Schedule" %}</a></li>
<li{% block conferencetab %}{% endblock %}><a href="{% url 'conference' %}"><span class="glyphicon glyphicon-asterisk"></span>&nbsp;{% trans "Conference" %}</a></li>
{% if request.user.is_staff %}
<li><a href="{% url 'admin:index' %}"><span class="glyphicon glyphicon-dashboard"></span>&nbsp;Django-Admin</a></li>
{% endif %}
</ul>
<div class="container">
<ul class="nav nav-pills nav-justified subnav">
{% comment %}
<li{% block volunteerstab %}{% endblock %}><a href="{% url 'list-volunteers' %}"><span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;{% trans "Volunteers" %}</a></li>
{% endcomment %}
<li{% block talkstab %}{% endblock %}><a href="{% url 'talk-list' %}"><span class="glyphicon glyphicon-blackboard"></span>&nbsp;{% trans "Talks" %}</a></li>
<li{% block speakerstab %}{% endblock %}><a href="{% url 'participant-list' %}"><span class="glyphicon glyphicon-bullhorn"></span>&nbsp;{% trans "Speakers" %}</a></li>
<li{% block trackstab %}{% endblock %}><a href="{% url 'track-list' %}"><span class="glyphicon glyphicon-screenshot"></span>&nbsp;{% trans "Tracks" %}</a></li>
<li{% block roomstab %}{% endblock %}><a href="{% url 'room-list' %}"><span class="glyphicon glyphicon-tent"></span>&nbsp;{% trans "Rooms" %}</a></li>
<li{% block scheduletab %}{% endblock %}><a href="{% url 'staff-schedule' %}"><span class="glyphicon glyphicon-calendar"></span>&nbsp;{% trans "Schedule" %}</a></li>
</ul>
</div>
{% endblock %}
{% block content %}

View File

@ -15,7 +15,6 @@ urlpatterns = [
url(r'^volunteer/(?P<volunteer_id>[\w\-]+)/join/(?P<activity>[\w\-]+)/$', views.volunteer_activity, {'join': True}, name='volunteer-join'),
url(r'^volunteer/(?P<volunteer_id>[\w\-]+)/quit/(?P<activity>[\w\-]+)/$', views.volunteer_activity, {'join': False}, name='volunteer-quit'),
url(r'^staff/$', views.staff, name='staff'),
url(r'^staff/conference/$', views.conference, name='conference'),
url(r'^staff/talks/$', views.talk_list, name='talk-list'),
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/$', views.talk_details, name='talk-details'),
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/vote/(?P<score>[-+0-2]+)/$', views.talk_vote, name='talk-vote'),
@ -37,6 +36,8 @@ urlpatterns = [
url(r'^staff/add-user/$', views.create_user, name='create-user'),
url(r'^staff/schedule/((?P<program_format>[\w]+)/)?$', views.staff_schedule, name='staff-schedule'),
url(r'^staff/select2/$', views.Select2View.as_view(), name='django_select2-json'),
url(r'^admin/$', views.admin, name='admin'),
url(r'^admin/conference/$', views.conference, name='conference'),
url(r'^schedule/((?P<program_format>[\w]+)/)?$', views.public_schedule, name='public-schedule'),
#url(r'^markdown/$', views.markdown_preview, name='markdown'),
]

View File

@ -223,6 +223,11 @@ def staff(request):
return render(request, 'cfp/staff/base.html')
@staff_required
def admin(request):
return render(request, 'cfp/admin/base.html')
@staff_required
def talk_list(request):
talks = Talk.objects.filter(site=request.conference.site)
@ -494,7 +499,7 @@ You can now:
messages.success(request, _('Modifications successfully saved.'))
return redirect(reverse('conference'))
return render(request, 'cfp/staff/conference.html', {
return render(request, 'cfp/admin/conference.html', {
'form': form,
})

Binary file not shown.

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-09 17:54+0000\n"
"PO-Revision-Date: 2017-10-09 19:54+0200\n"
"POT-Creation-Date: 2017-10-09 18:30+0000\n"
"PO-Revision-Date: 2017-10-09 20:31+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
@ -274,7 +274,7 @@ msgstr "Couleur sur le programme"
msgid "Label on program"
msgstr "Label dans le xml du programme"
#: cfp/models.py:297 cfp/templates/cfp/staff/base.html:17
#: cfp/models.py:297 cfp/templates/cfp/staff/base.html:15
#: cfp/templates/cfp/staff/participant_list.html:8
#: cfp/templates/cfp/staff/talk_details.html:68
#: cfp/templates/cfp/staff/talk_list.html:45
@ -378,6 +378,26 @@ msgstr "[%(prefix)s] Conversation avec %(dest)s"
msgid "[%(prefix)s] Talk: %(talk)s"
msgstr "[%(prefix)s] Talk: %(talk)s"
#: cfp/templates/cfp/admin/base.html:10
#: cfp/templates/cfp/admin/conference.html:8
msgid "Conference"
msgstr "Conférence"
#: cfp/templates/cfp/admin/base.html:19 cfp/templates/cfp/staff/base.html:24
msgid "Please select a category."
msgstr "Veuillez sélectionner une catégorie."
#: cfp/templates/cfp/admin/conference.html:13
#: cfp/templates/cfp/staff/create_user.html:8
msgid "Add a new user"
msgstr "Ajouter un nouvel utilisateur"
#: cfp/templates/cfp/admin/conference.html:14 cfp/templates/cfp/propose.html:22
#: cfp/templates/cfp/speaker.html:21
#: cfp/templates/cfp/staff/create_user.html:13
msgid "Save"
msgstr "Envoyer"
#: cfp/templates/cfp/closed.html:9 cfp/templates/cfp/propose.html:11
#: cfp/templates/cfp/speaker.html:11
msgid "Participate"
@ -415,47 +435,27 @@ msgstr "Éditer votre profil :"
msgid "An email has been sent to you with those URLs"
msgstr "Un mail vous a été envoyé avec toutes les URLs"
#: cfp/templates/cfp/propose.html:22 cfp/templates/cfp/speaker.html:21
#: cfp/templates/cfp/staff/conference.html:14
#: cfp/templates/cfp/staff/create_user.html:13
msgid "Save"
msgstr "Envoyer"
#: cfp/templates/cfp/schedule.html:9 cfp/templates/cfp/staff/base.html:20
#: cfp/templates/cfp/schedule.html:9 cfp/templates/cfp/staff/base.html:18
#: cfp/templates/cfp/staff/schedule.html:9 ponyconf/templates/base.html:25
msgid "Schedule"
msgstr "Programme"
#: cfp/templates/cfp/staff/base.html:16
#: cfp/templates/cfp/staff/base.html:14
#: cfp/templates/cfp/staff/participant_details.html:33
#: cfp/templates/cfp/staff/talk_list.html:8
msgid "Talks"
msgstr "Exposés"
#: cfp/templates/cfp/staff/base.html:18
#: cfp/templates/cfp/staff/base.html:16
#: cfp/templates/cfp/staff/track_list.html:9
msgid "Tracks"
msgstr "Sessions"
#: cfp/templates/cfp/staff/base.html:19
#: cfp/templates/cfp/staff/base.html:17
#: cfp/templates/cfp/staff/room_list.html:9
msgid "Rooms"
msgstr "Salles"
#: cfp/templates/cfp/staff/base.html:21
#: cfp/templates/cfp/staff/conference.html:8
msgid "Conference"
msgstr "Conférence"
#: cfp/templates/cfp/staff/base.html:29
msgid "Please select a category."
msgstr "Veuillez sélectionner une catégorie."
#: cfp/templates/cfp/staff/conference.html:13
#: cfp/templates/cfp/staff/create_user.html:8
msgid "Add a new user"
msgstr "Ajouter un nouvel utilisateur"
#: cfp/templates/cfp/staff/create_user.html:14
#: cfp/templates/cfp/staff/talk_decide.html:22 ponyconf/templates/_form.html:16
msgid "Cancel"
@ -879,35 +879,35 @@ msgstr "Vous avez déjà confirmé votre participation à cet exposé."
msgid "You already cancelled your participation to this talk."
msgstr "Vous avez déjà annulé votre participation à cet exposé."
#: cfp/views.py:285 cfp/views.py:382
#: cfp/views.py:290 cfp/views.py:387
msgid "The talk has been accepted."
msgstr "Lexposé a été accepté."
#: cfp/views.py:287 cfp/views.py:384
#: cfp/views.py:292 cfp/views.py:389
msgid "The talk has been declined."
msgstr "Lexposé a été décliné."
#: cfp/views.py:352 cfp/views.py:444
#: cfp/views.py:357 cfp/views.py:449
msgid "Message sent!"
msgstr "Message envoyé !"
#: cfp/views.py:365
#: cfp/views.py:370
msgid "Vote successfully created"
msgstr "A voté !"
#: cfp/views.py:365
#: cfp/views.py:370
msgid "Vote successfully updated"
msgstr "Vote mis à jour"
#: cfp/views.py:386
#: cfp/views.py:391
msgid "Decision taken in account"
msgstr "Décision enregistrée"
#: cfp/views.py:472
#: cfp/views.py:477
msgid "[{}] You have been added to the staff team"
msgstr "[{}] Vous avez été ajouté aux membres du staff"
#: cfp/views.py:473
#: cfp/views.py:478
msgid ""
"Hi {},\n"
"\n"
@ -931,15 +931,15 @@ msgstr ""
"{}\n"
"\n"
#: cfp/views.py:494
#: cfp/views.py:499
msgid "Modifications successfully saved."
msgstr "Modification enregistrée avec succès."
#: cfp/views.py:571
#: cfp/views.py:576
msgid "User created successfully."
msgstr "Utilisateur créé avec succès."
#: cfp/views.py:592
#: cfp/views.py:597
#, python-format
msgid "Format '%s' not available"
msgstr "Format '%s' non disponible"
@ -981,15 +981,23 @@ msgstr "Appel à participation"
msgid "Volunteers"
msgstr "Bénévoles"
#: ponyconf/templates/base.html:42 ponyconf/templates/base.html:53
msgid "Staff"
msgstr "Staff"
#: ponyconf/templates/base.html:42
msgid "Organisazion"
msgstr "Organisation"
#: ponyconf/templates/base.html:51
#: ponyconf/templates/base.html:43
msgid "Administration"
msgstr "Administration"
#: ponyconf/templates/base.html:52
msgid "Logout"
msgstr "Déconnection"
#: ponyconf/templates/base.html:70
#: ponyconf/templates/base.html:54
msgid "Staff"
msgstr "Staff"
#: ponyconf/templates/base.html:71
msgid "Powered by"
msgstr "Propulsé par"
@ -1300,9 +1308,6 @@ msgstr "Adresse e-mail"
#~ msgid "No assigned yet."
#~ msgstr "Pas encore assigné."
#~ msgid "Registrations"
#~ msgstr "Inscriptions"
#~ msgid "required but unlimited"
#~ msgstr "requis mais non limité"

View File

@ -38,7 +38,8 @@
<ul class="nav navbar-nav navbar-right">
{% if request.user.is_authenticated %}
{% if request|staff %}
<li{% block stafftab %}{% endblock %}><a href="{% url 'staff' %}"><span class="glyphicon glyphicon-cog"></span>&nbsp;{% trans "Staff" %}</a></li>
<li{% block stafftab %}{% endblock %}><a href="{% url 'staff' %}"><span class="glyphicon glyphicon-blackboard"></span>&nbsp;{% trans "Organisazion" %}</a></li>
<li{% block admintab %}{% endblock %}><a href="{% url 'admin' %}"><span class="glyphicon glyphicon-cog"></span>&nbsp;{% trans "Administration" %}</a></li>
{% endif %}
{% comment %}
<li{% block talkstab %}{% endblock %}><a href="{% url 'talk-list' %}"><span class="glyphicon glyphicon-blackboard"></span>&nbsp;{% trans "Talks" %}</a></li>

View File

@ -32,7 +32,7 @@ class EmailLoginView(LoginView):
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^admin/django/', admin.site.urls),
url(r'accounts/login/', EmailLoginView.as_view()),
url(r'accounts/', include('django.contrib.auth.urls')),
url(r'^', include('cfp.urls')),