Add event edit link for admins

This commit is contained in:
Maxime Bloch 2020-07-25 02:41:33 +02:00
parent eaa154f829
commit 62b71a5df6

View file

@ -8,7 +8,11 @@
{% if events %}
<ul>
{% for x in events %}
<li id="{{x.event.id}}">{{ x.event.date|date:"d F Y" }}, {{ x.event.time_str }}{% if x.event.note %}, <b>{{ x.event.note }}</b>{% endif %}
<li id="{{x.event.id}}">
{% if user.is_staff %}
<a href="/admin/events/event/{{ x.event.id }}/change/">Edit</a>
{% endif %}
{{ x.event.date|date:"d F Y" }}, {{ x.event.time_str }}{% if x.event.note %}, <b>{{ x.event.note }}</b>{% endif %}
{% include "events/registrations.html" with event=x.event my_registration=x.my_registration %}
</li>
{% endfor %}