Skip to content
Snippets Groups Projects
Commit d5c3416b authored by N.Geisler & B. Hättasch's avatar N.Geisler & B. Hättasch
Browse files

hide edit links when event is not active

parent 55310a00
No related branches found
No related tags found
1 merge request!8New features
......@@ -222,6 +222,10 @@ msgstr "Neuer AK"
msgid "Edit Person Info"
msgstr "Personen-Info bearbeiten"
#: templates/AKSubmission/submission_overview.html:62
msgid "This event is not active. You cannot add or change AKs"
msgstr "Dieses Event is nicht aktiv. Es können keine AKs hinzugefügt oder bearbeitet werden"
#: templates/AKSubmission/submission_overview.html:53
msgid "Current AKs"
msgstr "Aktuelle AKs"
......
......@@ -21,9 +21,10 @@
{% if ak.link != "" %}
<a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a>
{% endif %}
<a href="{% url 'submit:ak_edit' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
</div>
{% if ak.event.active %}
<a href="{% url 'submit:ak_edit' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
{% endif %} </div>
<h2>{% if ak.wish %}{% trans "AK Wish" %}: {% endif %}{{ ak.name }}</h2>
......@@ -88,9 +89,11 @@
</tbody>
</table>
<div class="">
<a href="{% url 'submit:akslot_add' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'plus' %} {% trans "Add another slot" %}</a>
</div>
{% if ak.event.active %}
<div class="">
<a href="{% url 'submit:akslot_add' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'plus' %} {% trans "Add another slot" %}</a>
</div>
{% endif %}
{% endblock %}
......@@ -4,47 +4,53 @@
{% load tags_AKSubmission %}
<table id="akTable" class="table table-striped">
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Who?" %}</th>
<th>{% trans 'Category' %}</th>
<th>{% trans "Tags" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for ak in AKs %}
<tr>
<td>
<b>{{ ak.name }}</b>
{% if ak.present %}
<span class="badge badge-dark badge-pill" title="{% trans 'present this AK' %}">{% fontawesome_icon "bullhorn" %}</span>
{% endif %}
{% if ak.reso %}
<span class="badge badge-dark badge-pill" title="{% trans 'Reso' %}">{% fontawesome_icon "scroll" %}</span>
{% endif %}
</td>
<td>
{% if ak.wish %}
<span class="badge badge-dark badge-pill">{% trans "AK Wish" %}</span>
{% else %}
{{ ak.owners_list }}
{% endif %}
</td>
<td>{% category_linked_badge ak.category event.slug %}</td>
<td>{% tag_list ak.tags.all event.slug %}</td>
<td class="text-right">
<a href="{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}" class="btn btn-primary">{% fontawesome_icon 'info' %}</a>
{% if ak.link %}
<a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a>
{% endif %}
<a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
</td>
</tr>
<tr>
<td colspan="5" class="small">{{ ak.description }}</td>
</tr>
{% endfor %}
</tbody>
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Who?" %}</th>
<th>{% trans 'Category' %}</th>
<th>{% trans "Tags" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for ak in AKs %}
<tr>
<td>
<b>{{ ak.name }}</b>
{% if ak.present %}
<span class="badge badge-dark badge-pill"
title="{% trans 'present this AK' %}">{% fontawesome_icon "bullhorn" %}</span>
{% endif %}
{% if ak.reso %}
<span class="badge badge-dark badge-pill"
title="{% trans 'Reso' %}">{% fontawesome_icon "scroll" %}</span>
{% endif %}
</td>
<td>
{% if ak.wish %}
<span class="badge badge-dark badge-pill">{% trans "AK Wish" %}</span>
{% else %}
{{ ak.owners_list }}
{% endif %}
</td>
<td>{% category_linked_badge ak.category event.slug %}</td>
<td>{% tag_list ak.tags.all event.slug %}</td>
<td class="text-right">
<a href="{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-primary">{% fontawesome_icon 'info' %}</a>
{% if ak.link %}
<a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a>
{% endif %}
{% if event.active %}
<a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
{% endif %}
</td>
</tr>
<tr>
<td colspan="5" class="small">{{ ak.description }}</td>
</tr>
{% endfor %}
</tbody>
</table>
......@@ -26,37 +26,42 @@
{% blocktrans %}On this page you can see a list of current AKs, change them and add new ones.{% endblocktrans %}
<div class="jumbotron" style="margin-top:20px;">
<form method="POST" action="#" class="form-row">
{% csrf_token %}
<a href="{% url 'submit:submit_ak_wish' event_slug=event.slug %}" class="btn btn-info">
{% trans "New AK Wish" %}
</a>
<span style="font-size: 1.5em">
&nbsp;&nbsp; | &nbsp;
<label for="selectOwnerId" class="align-middle d-inline">{% trans "Who" %}:</label>
</span>&nbsp;&nbsp;
<select name="owner_id" id="selectOwnerId" class="">
<option value="-1">{% trans "I do not own AKs yet" %}</option>
{% for owner in existingOwners %}
<option value="{{ owner.pk }}">{{ owner }}</option>
{% endfor %}
</select> &nbsp;&nbsp;
<input
type="submit"
class="btn btn-primary"
value="{% trans "New AK" %}"
formaction="{% url 'submit:akowner_select' event_slug=event.slug %}"
/>&nbsp;&nbsp;
<input
type="submit"
class="btn btn-success"
value="{% trans 'Edit Person Info' %}"
formaction="{% url 'submit:akowner_edit_dispatch' event_slug=event.slug %}"
/>
</form>
</div>
{% if event.active %}
<div class="jumbotron" style="margin-top:20px;">
<form method="POST" action="#" class="form-row">
{% csrf_token %}
<a href="{% url 'submit:submit_ak_wish' event_slug=event.slug %}" class="btn btn-info">
{% trans "New AK Wish" %}
</a>
<span style="font-size: 1.5em">
&nbsp;&nbsp; | &nbsp;
<label for="selectOwnerId" class="align-middle d-inline">{% trans "Who" %}:</label>
</span>&nbsp;&nbsp;
<select name="owner_id" id="selectOwnerId" class="">
<option value="-1">{% trans "I do not own AKs yet" %}</option>
{% for owner in existingOwners %}
<option value="{{ owner.pk }}">{{ owner }}</option>
{% endfor %}
</select> &nbsp;&nbsp;
<input
type="submit"
class="btn btn-primary"
value="{% trans "New AK" %}"
formaction="{% url 'submit:akowner_select' event_slug=event.slug %}"
/>&nbsp;&nbsp;
<input
type="submit"
class="btn btn-success"
value="{% trans 'Edit Person Info' %}"
formaction="{% url 'submit:akowner_edit_dispatch' event_slug=event.slug %}"
/>
</form>
</div>
{% else %}
<div class="alert alert-warning" style="margin-top:20px;margin-bottom: 20px;">
{% trans "This event is not active. You cannot add or change AKs" %}
</div>
{% endif %}
<h2>{% trans "Current AKs" %}</h2>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment