diff --git a/src/teams/templates/info_item_delete_confirm.html b/src/teams/templates/info_item_delete_confirm.html
new file mode 100644
index 00000000..fe9f2403
--- /dev/null
+++ b/src/teams/templates/info_item_delete_confirm.html
@@ -0,0 +1,30 @@
+{% extends 'base.html' %}
+{% load commonmark %}
+{% load bootstrap3 %}
+
+{% block title %}
+{% if form.instance.id %}
+Edit Info Item: {{ form.instance.headline }}
+{% else %}
+Create Info item
+{% endif %}
+in {{ form.instance.category.headline }}
+{% endblock %}
+
+{% block content %}
+
- {% if form.instance.id %}
- Edit Info Item: {{ form.instance.name }}
+ {% if object %}
+ Editing "{{ object.headline }}"
{% else %}
Create Info Item
{% endif %}
- in {{ form.instance.category.headline }}
+ in "{{ object.category.headline }}"
diff --git a/src/teams/urls.py b/src/teams/urls.py
index 4de29253..d528b2c1 100644
--- a/src/teams/urls.py
+++ b/src/teams/urls.py
@@ -10,7 +10,7 @@ from teams.views.base import (
TeamManageView,
FixIrcAclView,
)
-from teams.views.info import InfoItemUpdateView, InfoItemCreateView
+from teams.views.info import InfoItemUpdateView, InfoItemCreateView, InfoItemDeleteView
from teams.views.tasks import (
TaskCreateView,
@@ -105,6 +105,11 @@ urlpatterns = [
InfoItemUpdateView.as_view(),
name='info_item_update',
),
+ url(
+ r'^delete/$',
+ InfoItemDeleteView.as_view(),
+ name='info_item_delete',
+ ),
]),
),
])
diff --git a/src/teams/views/info.py b/src/teams/views/info.py
index 740fdd9f..5a6efaaa 100644
--- a/src/teams/views/info.py
+++ b/src/teams/views/info.py
@@ -1,6 +1,6 @@
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponseRedirect
-from django.views.generic import CreateView, UpdateView
+from django.views.generic import CreateView, UpdateView, DeleteView
from reversion.views import RevisionMixin
from camps.mixins import CampViewMixin
@@ -47,3 +47,16 @@ class InfoItemUpdateView(LoginRequiredMixin, CampViewMixin, EnsureTeamResponsibl
if next:
return next
return self.team.get_absolute_url()
+
+
+class InfoItemDeleteView(LoginRequiredMixin, CampViewMixin, EnsureTeamResponsibleMixin, RevisionMixin, DeleteView):
+ model = InfoItem
+ template_name = "info_item_delete_confirm.html"
+ slug_field = 'anchor'
+ slug_url_kwarg = 'item_anchor'
+
+ def get_success_url(self):
+ next = self.request.GET.get('next')
+ if next:
+ return next
+ return self.team.get_absolute_url()