Commit 06d963fd authored by Wietse Kuipers's avatar Wietse Kuipers
Browse files

Added a check all as present and paid button

parent badacdb9
...@@ -7,8 +7,8 @@ msgid "" ...@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-10 11:47+0100\n" "POT-Creation-Date: 2016-11-16 21:41+0100\n"
"PO-Revision-Date: 2016-11-10 11:47+0100\n" "PO-Revision-Date: 2016-11-16 21:42+0100\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n" "Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
...@@ -46,7 +46,7 @@ msgstr "volgorde" ...@@ -46,7 +46,7 @@ msgstr "volgorde"
msgid "No registration required" msgid "No registration required"
msgstr "Geen registratie vereist" msgstr "Geen registratie vereist"
#: events/models.py:28 events/templates/events/admin/details.html:65 #: events/models.py:28 events/templates/events/admin/details.html:66
msgid "title" msgid "title"
msgstr "titel" msgstr "titel"
...@@ -62,7 +62,7 @@ msgstr "starttijd" ...@@ -62,7 +62,7 @@ msgstr "starttijd"
msgid "end time" msgid "end time"
msgstr "eindtijd" msgstr "eindtijd"
#: events/models.py:45 events/templates/events/admin/details.html:69 #: events/models.py:45 events/templates/events/admin/details.html:70
msgid "organiser" msgid "organiser"
msgstr "organisator" msgstr "organisator"
...@@ -78,7 +78,7 @@ msgstr "einde registratie" ...@@ -78,7 +78,7 @@ msgstr "einde registratie"
msgid "cancel deadline" msgid "cancel deadline"
msgstr "afmelddeadline" msgstr "afmelddeadline"
#: events/models.py:68 events/templates/events/admin/details.html:73 #: events/models.py:68 events/templates/events/admin/details.html:74
#: events/templates/events/event.html:32 #: events/templates/events/event.html:32
msgid "location" msgid "location"
msgstr "locatie" msgstr "locatie"
...@@ -93,12 +93,12 @@ msgstr "" ...@@ -93,12 +93,12 @@ msgstr ""
"Locatie van ’t Huygens: Heyendaalseweg 135, Nijmegen. Dit veld wordt niet " "Locatie van ’t Huygens: Heyendaalseweg 135, Nijmegen. Dit veld wordt niet "
"getoond als tekst!!" "getoond als tekst!!"
#: events/models.py:80 events/templates/events/admin/details.html:75 #: events/models.py:80 events/templates/events/admin/details.html:76
#: events/templates/events/event.html:37 #: events/templates/events/event.html:37
msgid "price" msgid "price"
msgstr "prijs" msgstr "prijs"
#: events/models.py:88 events/templates/events/admin/details.html:77 #: events/models.py:88 events/templates/events/admin/details.html:78
msgid "cost" msgid "cost"
msgstr "kosten" msgstr "kosten"
...@@ -255,29 +255,33 @@ msgstr "afgemeld" ...@@ -255,29 +255,33 @@ msgstr "afgemeld"
msgid "Export registrations" msgid "Export registrations"
msgstr "Exporteer registraties" msgstr "Exporteer registraties"
#: events/templates/events/admin/details.html:58 #: events/templates/events/admin/details.html:51
msgid "Set all registered to paid and present"
msgstr "Zet iedereen op betaald en present"
#: events/templates/events/admin/details.html:59
msgid "Event properties" msgid "Event properties"
msgstr "Eigenschappen van evenement" msgstr "Eigenschappen van evenement"
#: events/templates/events/admin/details.html:61 #: events/templates/events/admin/details.html:62
#: events/templates/events/admin/registrations_table.html:46 #: events/templates/events/admin/registrations_table.html:46
msgid "change" msgid "change"
msgstr "verander" msgstr "verander"
#: events/templates/events/admin/details.html:67 #: events/templates/events/admin/details.html:68
#: events/templates/events/admin/registrations_table.html:7 #: events/templates/events/admin/registrations_table.html:7
msgid "date" msgid "date"
msgstr "datum" msgstr "datum"
#: events/templates/events/admin/details.html:71 #: events/templates/events/admin/details.html:72
msgid "registration period" msgid "registration period"
msgstr "registratieperiode" msgstr "registratieperiode"
#: events/templates/events/admin/details.html:79 #: events/templates/events/admin/details.html:80
msgid "registration required" msgid "registration required"
msgstr "registratie vereist" msgstr "registratie vereist"
#: events/templates/events/admin/details.html:82 #: events/templates/events/admin/details.html:83
msgid "registration message" msgid "registration message"
msgstr "registratiebericht" msgstr "registratiebericht"
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
{% endwith %} {% endwith %}
<br> <br>
<a href="{% url 'events:export' event_id=event.pk %}" class="button">{% trans "Export registrations" %}</a> <a href="{% url 'events:export' event_id=event.pk %}" class="button">{% trans "Export registrations" %}</a>
<a href="{% url 'events:all_present' event_id=event.pk %}" class="button">{% trans "Set all registered to paid and present" %}</a>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
......
...@@ -17,6 +17,8 @@ urlpatterns = [ ...@@ -17,6 +17,8 @@ urlpatterns = [
url(r'admin/(?P<event_id>\d+)/registration/$', url(r'admin/(?P<event_id>\d+)/registration/$',
views.admin_change_registration, name='admin-registration'), views.admin_change_registration, name='admin-registration'),
url(r'admin/(?P<event_id>\d+)/export/$', views.export, name='export'), url(r'admin/(?P<event_id>\d+)/export/$', views.export, name='export'),
url(r'admin/(?P<event_id>\d+)/all_present/$', views.all_present,
name='all_present'),
url(r'^(?P<event_id>\d+)/$', views.event, name='event'), url(r'^(?P<event_id>\d+)/$', views.event, name='event'),
url(r'^(?P<event_id>\d+)/registration/(?P<action>[-\w]+)/$', url(r'^(?P<event_id>\d+)/registration/(?P<action>[-\w]+)/$',
views.registration, name='registration'), views.registration, name='registration'),
......
...@@ -6,7 +6,7 @@ from django.contrib import messages ...@@ -6,7 +6,7 @@ from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.decorators import login_required, permission_required
from django.core.mail import EmailMessage from django.core.mail import EmailMessage
from django.http import HttpResponse, JsonResponse from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404, redirect, render from django.shortcuts import get_object_or_404, redirect, render
from django.template import Context from django.template import Context
from django.template.loader import get_template from django.template.loader import get_template
...@@ -295,3 +295,15 @@ def registration(request, event_id, action=None): ...@@ -295,3 +295,15 @@ def registration(request, event_id, action=None):
waiting_list_notification.send() waiting_list_notification.send()
return redirect(event) return redirect(event)
@staff_member_required
@permission_required('events.change_event')
def all_present(request, event_id):
event = get_object_or_404(Event, pk=event_id)
registrations = event.registration_set.all()
for registration in registrations:
registration.present = True
registration.paid = True
registration.save()
return HttpResponseRedirect('/events/admin/{}'.format(event_id))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment