Skip to content
Snippets Groups Projects
Commit 85984181 authored by Dominik Weitz's avatar Dominik Weitz
Browse files

Add the "Express Interest" button on the AK overview

parent 0adacca7
Branches master
No related tags found
No related merge requests found
Pipeline #8951 passed
......@@ -52,6 +52,9 @@
<a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}" data-toggle="tooltip"
title="{% trans 'Edit' %}"
class="btn btn-success">{% fa5_icon 'pencil-alt' 'fas' %}</a>
<a href="{% url 'submit:overview_inc_interest' event_slug=event.slug pk=ak.pk %}" data-toggle="tooltip"
title="{% trans 'Show Interest' %}"
class="btn btn-primary">{% fa5_icon 'thumbs-up' 'fas' %}</a>
{% endif %}
</td>
</tr>
......
......@@ -13,6 +13,7 @@ urlpatterns = [
path('ak/<int:pk>/history/', views.AKHistoryView.as_view(), name='ak_history'),
path('ak/<int:pk>/edit/', views.AKEditView.as_view(), name='ak_edit'),
path('ak/<int:pk>/interest/', views.AKInterestView.as_view(), name='inc_interest'),
path('ak/<int:pk>/overview_interest/', views.AKOverviewInterestView.as_view(), name='overview_inc_interest'),
path('ak/<int:pk>/add_slot/', views.AKSlotAddView.as_view(), name='akslot_add'),
path('ak/<int:pk>/add_message/', views.AKAddOrgaMessageView.as_view(), name='akmessage_add'),
path('akslot/<int:pk>/edit/', views.AKSlotEditView.as_view(), name='akslot_edit'),
......
......@@ -289,6 +289,20 @@ class AKInterestView(RedirectView):
return super().get_redirect_url(*args, **kwargs)
# when the interest increase request comes from the AK overview page, redirect to that instead of the AK overview page
class AKOverviewInterestView(RedirectView):
permanent = False
pattern_name = 'submit:submission_overview'
def get_redirect_url(self, *args, **kwargs):
ak = get_object_or_404(AK, pk=kwargs['pk'])
if ak.event.active:
ak.increment_interest()
messages.add_message(self.request, messages.SUCCESS, _("Interest saved"))
del kwargs['pk']
return super().get_redirect_url(*args, **kwargs)
class AKOwnerCreateView(EventSlugMixin, EventInactiveRedirectMixin, CreateView):
model = AKOwner
template_name = 'AKSubmission/akowner_create_update.html'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment