diff --git a/src/info/templates/info.html b/src/info/templates/info.html index 4441db43..9e787d8e 100644 --- a/src/info/templates/info.html +++ b/src/info/templates/info.html @@ -54,7 +54,14 @@ Info | {{ block.super }} + {% if request.user in category.team.responsible_members.all %} + + Edit + + {% endif %} +

{{ item.body|commonmark }}

diff --git a/src/teams/templates/team_detail.html b/src/teams/templates/team_detail.html index 3e8e316a..f53f1ea6 100644 --- a/src/teams/templates/team_detail.html +++ b/src/teams/templates/team_detail.html @@ -159,7 +159,7 @@ Team: {{ team.name }} | {{ block.super }} - Edit Task + Edit diff --git a/src/teams/urls.py b/src/teams/urls.py index 039aabb6..4de29253 100644 --- a/src/teams/urls.py +++ b/src/teams/urls.py @@ -92,7 +92,7 @@ urlpatterns = [ ]), ), url( - r'^info_items/(?P[-_\w+]+)/', include([ + r'^info/(?P[-_\w+]+)/', include([ url( r'^create/$', InfoItemCreateView.as_view(), diff --git a/src/teams/views/info.py b/src/teams/views/info.py index 315dd085..740fdd9f 100644 --- a/src/teams/views/info.py +++ b/src/teams/views/info.py @@ -35,7 +35,7 @@ class InfoItemUpdateView(LoginRequiredMixin, CampViewMixin, EnsureTeamResponsibl template_name = "info_item_form.html" fields = ['headline', 'body', 'anchor', 'weight'] slug_field = 'anchor' - slug_url_kwarg = 'anchor' + slug_url_kwarg = 'item_anchor' def get_context_data(self, *args, **kwargs): context = super().get_context_data(**kwargs) @@ -43,4 +43,7 @@ class InfoItemUpdateView(LoginRequiredMixin, CampViewMixin, EnsureTeamResponsibl return context def get_success_url(self): + next = self.request.GET.get('next') + if next: + return next return self.team.get_absolute_url()