Commit 94cbc4be authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch '431-comma-separated-mail-export-event-registrations' into 'master'

Export email addresses of event attendees

Closes #431

See merge request !550
parents f832b6b4 772ee272
......@@ -7,9 +7,9 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-16 22:58+0200\n"
"PO-Revision-Date: 2017-08-16 23:00+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"POT-Creation-Date: 2017-09-11 09:23+0200\n"
"PO-Revision-Date: 2017-09-11 09:24+0200\n"
"Last-Translator: Joost Rijneveld <joost@joostrijneveld.nl>\n"
"Language-Team: \n"
"Language: nl\n"
"MIME-Version: 1.0\n"
......@@ -78,7 +78,7 @@ msgstr "Overig"
msgid "No registration required"
msgstr "Geen aanmelding vereist"
#: models.py:37 templates/events/admin/details.html:67
#: models.py:37 templates/events/admin/details.html:68
msgid "title"
msgstr "titel"
......@@ -94,7 +94,7 @@ msgstr "starttijd"
msgid "end time"
msgstr "eindtijd"
#: models.py:53 templates/events/admin/details.html:71
#: models.py:53 templates/events/admin/details.html:72
msgid "organiser"
msgstr "organisator"
......@@ -122,7 +122,7 @@ msgstr "einde aanmelden"
msgid "cancel deadline"
msgstr "afmelddeadline"
#: models.py:89 templates/events/admin/details.html:75
#: models.py:89 templates/events/admin/details.html:76
#: templates/events/event.html:37
msgid "location"
msgstr "locatie"
......@@ -139,7 +139,7 @@ msgstr ""
"Locatie van ’t Huygens: Heyendaalseweg 135, Nijmegen. Locatie van Mercator "
"1: Toernooiveld 212, Nijmegen. Dit veld wordt niet getoond als tekst!!"
#: models.py:102 templates/events/admin/details.html:77
#: models.py:102 templates/events/admin/details.html:78
#: templates/events/event.html:42
msgid "price"
msgstr "prijs"
......@@ -275,19 +275,25 @@ msgid "last changed"
msgstr "laatst aangepast"
#: templates/events/admin/details.html:4 templates/events/admin/details.html:5
#: templates/events/admin/email_export.html:4
#: templates/events/admin/email_export.html:5
msgid "Thalia site admin"
msgstr "Thalia site admin"
#: templates/events/admin/details.html:20
#: templates/events/admin/email_export.html:20
msgid "Thalia administration"
msgstr "Thalia administratie"
#: templates/events/admin/details.html:25
#: templates/events/admin/email_export.html:25
msgid "home"
msgstr "home"
#: templates/events/admin/details.html:26
#: templates/events/admin/details.html:27
#: templates/events/admin/email_export.html:26
#: templates/events/admin/email_export.html:27
msgid "events"
msgstr "evenementen"
......@@ -321,50 +327,70 @@ msgid "Export registrations"
msgstr "Exporteer aanmeldingen"
#: templates/events/admin/details.html:52
msgid "Export email addresses of attendees"
msgstr "Exporteer e-mailadressen van aanwezigen"
#: templates/events/admin/details.html:53
msgid "Set all registered to paid and present"
msgstr "Zet iedereen op betaald en present"
#: templates/events/admin/details.html:60
#: templates/events/admin/details.html:61
msgid "Event properties"
msgstr "Eigenschappen van evenement"
#: templates/events/admin/details.html:63
#: templates/events/admin/details.html:64
#: templates/events/admin/registrations_table.html:50
msgid "change"
msgstr "verander"
#: templates/events/admin/details.html:69
#: templates/events/admin/details.html:70
#: templates/events/admin/registrations_table.html:7
msgid "date"
msgstr "datum"
#: templates/events/admin/details.html:73
#: templates/events/admin/details.html:74
msgid "registration period"
msgstr "aanmeldperiode"
#: templates/events/admin/details.html:79
#: templates/events/admin/details.html:80
msgid "cost"
msgstr "kosten"
#: templates/events/admin/details.html:81
#: templates/events/admin/details.html:82
msgid "registration required"
msgstr "aanmelden vereist"
#: templates/events/admin/details.html:84
#: templates/events/admin/details.html:85
msgid "registration message"
msgstr "aanmeldbericht"
#: templates/events/admin/details.html:87 templates/events/event.html:56
#: templates/events/admin/details.html:88 templates/events/event.html:56
msgid "number of registrations"
msgstr "aantal aanmeldingen"
#: templates/events/admin/details.html:89 templates/events/event.html:58
#: templates/events/admin/details.html:90 templates/events/event.html:58
#, python-format
msgid "%(counter)s registration"
msgid_plural "%(counter)s registrations"
msgstr[0] "%(counter)s aanmelding"
msgstr[1] "%(counter)s aanmeldingen"
#: templates/events/admin/email_export.html:29
msgid "Export email addresses of registrants"
msgstr "Exporteer e-mailadressen van geregistreerden"
#: templates/events/admin/email_export.html:33
msgid "Copy-pasteable email addresses of registrants:"
msgstr "Kopieerbare e-mailadressen van geregistreerden:"
#: templates/events/admin/email_export.html:41
msgid ""
"Some registrants were added manually, and are thus not included in the list "
"above:"
msgstr ""
"Sommige geregistreerden zijn met de hand toegevoegd, en komen dus niet in de "
"bovenstaande lijst voor:"
#: templates/events/admin/registrations_table.html:12
msgid "not paid"
msgstr "niet betaald"
......@@ -580,56 +606,56 @@ msgstr "Toon verjaardagen"
msgid "list"
msgstr "Lijst"
#: views.py:94
#: views.py:95
msgctxt "registration status"
msgid "registered"
msgstr "aangemeld"
#: views.py:100 views.py:135
#: views.py:101 views.py:136
msgctxt "registration status"
msgid "late cancellation"
msgstr "te laat afgemeld"
#: views.py:102
#: views.py:103
msgctxt "registration status"
msgid "cancelled"
msgstr "afgemeld"
#: views.py:106
#: views.py:107
msgctxt "registration status"
msgid "waiting"
msgstr "wachtend"
#: views.py:111 views.py:122
#: views.py:112 views.py:123
msgid "Yes"
msgstr "Ja"
#: views.py:221
#: views.py:238
msgid "[THALIA] Notification about your registration for '{}'"
msgstr "[THALIA] Bericht over je aanmelding voor ‘{}’"
#: views.py:265 views.py:276 views.py:289
#: views.py:283 views.py:294 views.py:307
msgid "Registration successful."
msgstr "Je aanmelding was succesvol."
#: views.py:271
#: views.py:289
msgid ""
"You cannot re-register anymore since you've cancelled after the deadline."
msgstr ""
"Je kunt je niet opnieuw aanmelden omdat je je hebt afgemeld na de deadline."
#: views.py:284
#: views.py:302
msgid "You may not register"
msgstr "Je mag niet je aanmelden"
#: views.py:292
#: views.py:310
msgid "You were already registered."
msgstr "Je bent al aangemeld."
#: views.py:301 views.py:309
#: views.py:319 views.py:327
msgid "You are not registered for this event."
msgstr "Je bent niet aangemeld voor dit evenement."
#: views.py:321
#: views.py:339
msgid "Registration successfully cancelled."
msgstr "Je afmelding was succesvol."
......@@ -49,6 +49,7 @@
{% endwith %}
<br>
<a href="{% url 'events:export' event_id=event.pk %}" class="button">{% trans "Export registrations" %}</a>
<a href="{% url 'events:export_email' event_id=event.pk %}" class="button">{% trans "Export email addresses of attendees" %}</a>
<a href="{% url 'events:all_present' event_id=event.pk %}" class="button">{% trans "Set all registered to paid and present" %}</a>
</div>
</div>
......
{% extends 'admin/index.html' %}
{% load i18n admin_urls static admin_modify %}
{% block title %}{{ event.title }} | {{ site_title|default:_('Thalia site admin') }}{% endblock %}
{% block opengraph_title %}{{ event.title }} | {{ site_title|default:_('Thalia site admin') }}{% endblock %}
{% block extrastyle %}
{{ block.super }}
<link href="{% static "events/css/admin.css" %}" rel="stylesheet" type="text/css">
{% endblock %}
{% block extrahead %}
{{ block.super }}
<script type="text/javascript" src="{% static "admin/js/vendor/jquery/jquery.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
<script type="text/javascript" src="{% static "events/js/admin.js" %}"></script>
{% endblock %}
{% block branding %}
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Thalia administration') }}</a></h1>
{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'home'|capfirst %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label='events' %}">{% trans 'events'|capfirst %}</a>
&rsaquo; <a href="/admin/events/event/">{% trans 'events'|capfirst %}</a>
&rsaquo; <a href="{% url 'events:admin-details' event.pk %}">{{ event.title }}</a>
&rsaquo; {% trans "Export email addresses of registrants" %}
</div>
{% endblock %}
{% block content_title %}<h1>{% trans "Copy-pasteable email addresses of registrants:" %}</h1>{% endblock %}
{% block content %}
<div id="content-main">
<p>
{{ addresses | join:', ' }}
</p>
{% if no_addresses %}
<p>
{% trans "Some registrants were added manually, and are thus not included in the list above:" %}
</p>
<p>
{{ no_addresses | join:'<br />' }}
</p>
{% endif %}
</div>
{% endblock %}
{% block sidebar %}
{% endblock %}
......@@ -17,6 +17,7 @@ urlpatterns = [
url(r'admin/(?P<event_id>\d+)/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_email/$', views.export_email, name='export_email'),
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'),
......
......@@ -146,6 +146,20 @@ def export(request, event_id):
return response
@staff_member_required
@permission_required('events.change_event')
def export_email(request, event_id):
event = get_object_or_404(Event, pk=event_id)
registrations = event.registration_set.filter(
date_cancelled=None).prefetch_related('member__user')
registrations = registrations[:event.max_participants]
addresses = [r.member.user.email for r in registrations if r.member]
no_addresses = [r.name for r in registrations if not r.member]
return render(request, 'events/admin/email_export.html',
{'event': event, 'addresses': addresses,
'no_addresses': no_addresses})
def index(request):
upcoming_activity = Event.objects.filter(
published=True,
......
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