Skip to content
Snippets Groups Projects
Commit da3df3ef authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Add edit view for AK

Set URLs for edit views in templates
parent d702212f
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-23 23:56+0000\n" "POT-Creation-Date: 2019-10-24 14:18+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -26,7 +26,7 @@ msgstr "" ...@@ -26,7 +26,7 @@ msgstr ""
#: templates/AKSubmission/submission_overview.html:6 #: templates/AKSubmission/submission_overview.html:6
#: templates/AKSubmission/submission_overview.html:11 #: templates/AKSubmission/submission_overview.html:11
#: templates/AKSubmission/submission_overview.html:15 #: templates/AKSubmission/submission_overview.html:15
#: templates/AKSubmission/submit_new.html:13 #: templates/AKSubmission/submit_new.html:19
#: templates/AKSubmission/submit_new_wish.html:10 #: templates/AKSubmission/submit_new_wish.html:10
msgid "AK Submission" msgid "AK Submission"
msgstr "AK-Eintragung" msgstr "AK-Eintragung"
...@@ -98,17 +98,17 @@ msgid "AK Owner" ...@@ -98,17 +98,17 @@ msgid "AK Owner"
msgstr "AK-Leitung" msgstr "AK-Leitung"
#: templates/AKSubmission/akowner_create_update.html:25 #: templates/AKSubmission/akowner_create_update.html:25
#: templates/AKSubmission/submit_new.html:27 #: templates/AKSubmission/submit_new.html:34
msgid "Reset" msgid "Reset"
msgstr "Zurücksetzen" msgstr "Zurücksetzen"
#: templates/AKSubmission/akowner_create_update.html:29 #: templates/AKSubmission/akowner_create_update.html:29
#: templates/AKSubmission/submit_new.html:31 #: templates/AKSubmission/submit_new.html:38
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
#: templates/AKSubmission/akowner_create_update.html:32 #: templates/AKSubmission/akowner_create_update.html:32
#: templates/AKSubmission/submit_new.html:34 #: templates/AKSubmission/submit_new.html:41
msgid "Submit" msgid "Submit"
msgstr "Eintragen" msgstr "Eintragen"
...@@ -135,9 +135,9 @@ msgid "I do not own AKs yet" ...@@ -135,9 +135,9 @@ msgid "I do not own AKs yet"
msgstr "Ich leite bisher keine AKs" msgstr "Ich leite bisher keine AKs"
#: templates/AKSubmission/submission_overview.html:40 #: templates/AKSubmission/submission_overview.html:40
#: templates/AKSubmission/submit_new.html:7 #: templates/AKSubmission/submit_new.html:8
#: templates/AKSubmission/submit_new.html:15
#: templates/AKSubmission/submit_new.html:21 #: templates/AKSubmission/submit_new.html:21
#: templates/AKSubmission/submit_new.html:28
msgid "New AK" msgid "New AK"
msgstr "Neuer AK" msgstr "Neuer AK"
...@@ -163,10 +163,14 @@ msgstr "" ...@@ -163,10 +163,14 @@ msgstr ""
msgid "AK successfully created" msgid "AK successfully created"
msgstr "AK erfolgreich angelegt" msgstr "AK erfolgreich angelegt"
#: views.py:183 #: views.py:149
msgid "AK successfully updated"
msgstr "AK erfolgreich bearbeitet"
#: views.py:193
msgid "Person Info successfully updated" msgid "Person Info successfully updated"
msgstr "Personen-Info erfolgreich bearbeitet" msgstr "Personen-Info erfolgreich bearbeitet"
#: views.py:195 #: views.py:205
msgid "No user selected" msgid "No user selected"
msgstr "Keine Person ausgewählt" msgstr "Keine Person ausgewählt"
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
{% if ak.link != "" %} {% if ak.link != "" %}
<a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a> <a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a>
{% endif %} {% endif %}
<a href="#" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a> <a href="{% url 'submit:ak_edit' event_slug=ak.event.slug pk=ak.pk %}" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
</div> </div>
<h2>{% if ak.wish %}{% trans "AK Wish" %}: {% endif %}{{ ak.name }}</h2> <h2>{% if ak.wish %}{% trans "AK Wish" %}: {% endif %}{{ ak.name }}</h2>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
{% if ak.link %} {% if ak.link %}
<a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a> <a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a>
{% endif %} {% endif %}
<a href="#" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a> <a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}" class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -10,6 +10,7 @@ urlpatterns = [ ...@@ -10,6 +10,7 @@ urlpatterns = [
include([ include([
path('', views.SubmissionOverviewView.as_view(), name='submission_overview'), path('', views.SubmissionOverviewView.as_view(), name='submission_overview'),
path('ak/<int:pk>', views.AKDetailView.as_view(), name='ak_detail'), path('ak/<int:pk>', views.AKDetailView.as_view(), name='ak_detail'),
path('ak/<int:pk>/edit/', views.AKEditView.as_view(), name='ak_edit'),
path('aks/', views.AKListView.as_view(), name='ak_list'), path('aks/', views.AKListView.as_view(), name='ak_list'),
path('aks/category/<int:category_pk>', views.AKListByCategoryView.as_view(), name='ak_list_by_category'), path('aks/category/<int:category_pk>', views.AKListByCategoryView.as_view(), name='ak_list_by_category'),
path('aks/tag/<int:tag_pk>', views.AKListByTagView.as_view(), name='ak_list_by_tag'), path('aks/tag/<int:tag_pk>', views.AKListByTagView.as_view(), name='ak_list_by_tag'),
......
...@@ -140,6 +140,16 @@ class AKWishSubmissionView(AKAndAKWishSubmissionView): ...@@ -140,6 +140,16 @@ class AKWishSubmissionView(AKAndAKWishSubmissionView):
form_class = AKWishForm form_class = AKWishForm
class AKEditView(EventSlugMixin, UpdateView):
model = AK
template_name = 'AKSubmission/submit_new.html'
form_class = AKForm
def get_success_url(self):
messages.add_message(self.request, messages.SUCCESS, _("AK successfully updated"))
return reverse_lazy('submit:ak_detail', kwargs={'event_slug': self.kwargs['event_slug'], 'pk': self.object.pk})
class AKOwnerCreateView(EventSlugMixin, CreateView): class AKOwnerCreateView(EventSlugMixin, CreateView):
model = AKOwner model = AKOwner
template_name = 'AKSubmission/akowner_create_update.html' template_name = 'AKSubmission/akowner_create_update.html'
......
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