diff --git a/dav_event_office/templates/dav_event_office/event_detail.html b/dav_event_office/templates/dav_event_office/event_detail.html
index 4235d70..ede551e 100644
--- a/dav_event_office/templates/dav_event_office/event_detail.html
+++ b/dav_event_office/templates/dav_event_office/event_detail.html
@@ -175,13 +175,16 @@
{% with position=participant.position %}
+ class="btn btn-link no-padding" title="Bei dieser Anmeldung hast du bereits
+am {{ registration.status.updated_at|date:'d. F Y, G:i' }}
+auf {% if registration.status.accepted %}Plus{% else %}Minus{% endif %} geklickt.
+">
{% bootstrap_icon 'plus-sign' %}
+ class="btn btn-link no-padding" title="Bei dieser Anmeldung hast du bereits
+am {{ registration.status.updated_at|date:'d. F Y, G:i' }}
+auf {% if registration.status.accepted %}Plus{% else %}Minus{% endif %} geklickt.
+">
{% bootstrap_icon 'minus-sign' %}
@@ -509,13 +518,20 @@ Wichtig: das System verschickt keine Bestätigung an dich oder den neuen Teilneh
{% bootstrap_icon 'info-sign' %}
-
-
- {% bootstrap_icon 'question-sign' %}
-
+
+ {% if has_permission_update_registration %}
+
+
+
+ {% endif %}
{% endfor %}
@@ -541,6 +557,14 @@ auf {% if registration.status.accepted %}Plus{% else %}Minus{% endif %} geklickt
{% for participant in participants_trash %}
+
+ {% bootstrap_icon 'trash' %}
+
+
{{ participant.get_full_name }}
({{ participant.email_address }} ,
@@ -562,13 +586,20 @@ auf {% if registration.status.accepted %}Plus{% else %}Minus{% endif %} geklickt
{% endif %}
-
-
- {% bootstrap_icon 'question-sign' %}
-
+
+ {% if has_permission_update_participants %}
+
+
+
+ {% endif %}
{% endfor %}
diff --git a/dav_events/views/events.py b/dav_events/views/events.py
index 08f41fb..b9ccdb7 100644
--- a/dav_events/views/events.py
+++ b/dav_events/views/events.py
@@ -299,6 +299,11 @@ class EventRegistrationsView(EventPermissionMixin, generic.DetailView):
def _reject_registration(self, registration):
registration.rejected()
+ def _reset_registration(self, registration):
+ registration.status.accepted = None
+ registration.status.answered = False
+ registration.status.save()
+
def _swap_participants_position(self, participant1, participant2):
event = participant1.event
pos_tmp = event.participants.count() + 1
@@ -347,6 +352,14 @@ class EventRegistrationsView(EventPermissionMixin, generic.DetailView):
self._reject_registration(registration)
else:
raise FieldDoesNotExist('Event has no registrations')
+ elif action == 'untrash_registration':
+ self.enforce_permission(event, permission='update-registration')
+ if hasattr(event, 'registrations'):
+ registration_id = request.POST.get('registration')
+ registration = event.registrations.get(id=registration_id)
+ self._reset_registration(registration)
+ else:
+ raise FieldDoesNotExist('Event has no registrations')
elif action == 'confirm_payment':
self.enforce_permission(event, permission='payment')
participant_id = request.POST.get('id')
@@ -374,6 +387,18 @@ class EventRegistrationsView(EventPermissionMixin, generic.DetailView):
participant.save()
messages.success(request, _(u'Teilnehmer in den Papierkorb verschoben: {}'.format(trashed.get_full_name())))
+ elif action == 'untrash_participant':
+ self.enforce_permission(event, permission='update-participants')
+ trashed_id = request.POST.get('id')
+ trashed = event.trashed_participants.get(id=trashed_id)
+ trashed.position = event.participants.count() + 1
+
+ data = trashed.get_data_dict()
+ del data['trashed_at']
+ participant = models.Participant.objects.create(**data)
+ trashed.delete()
+
+ messages.success(request, _(u'Teilnehmer zurückgeholt: {}'.format(participant.get_full_name())))
elif action == 'moveup_participant':
self.enforce_permission(event, permission='update-participants')
participant_id = request.POST.get('id')