diff --git a/com/templates/com/news_admin_list.jinja b/com/templates/com/news_admin_list.jinja index f7800e74..5f7e3b1f 100644 --- a/com/templates/com/news_admin_list.jinja +++ b/com/templates/com/news_admin_list.jinja @@ -8,6 +8,8 @@ {% block content %}

{% trans %}News{% endtrans %}

+

{% trans %}Create news{% endtrans %}

+

{% trans %}Notices{% endtrans %}

{% set notices = object_list.filter(type="NOTICE").distinct().order_by('id') %} @@ -35,7 +37,9 @@ {{ user_profile_link(news.moderator) }} {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Remove{% endtrans %} + {% trans %}Remove{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} @@ -62,7 +66,9 @@ {{ user_profile_link(news.author) }} {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Moderate{% endtrans %} + {% trans %}Moderate{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} @@ -107,7 +113,9 @@ {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Remove{% endtrans %} + {% trans %}Remove{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} @@ -146,7 +154,9 @@ {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Moderate{% endtrans %} + {% trans %}Moderate{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} @@ -185,7 +195,9 @@ {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }} {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Remove{% endtrans %} + {% trans %}Remove{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} @@ -218,7 +230,9 @@ {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }} {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Moderate{% endtrans %} + {% trans %}Moderate{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} @@ -257,7 +271,9 @@ {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }} {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Remove{% endtrans %} + {% trans %}Remove{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} @@ -290,7 +306,9 @@ {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }} {% trans %}View{% endtrans %} {% trans %}Edit{% endtrans %} - {% trans %}Moderate{% endtrans %} + {% trans %}Moderate{% endtrans %} + {% trans %}Delete{% endtrans %} + {% endfor %} diff --git a/com/urls.py b/com/urls.py index f5421758..3f172693 100644 --- a/com/urls.py +++ b/com/urls.py @@ -40,6 +40,7 @@ urlpatterns = [ url(r'^news$', NewsListView.as_view(), name='news_list'), url(r'^news/admin$', NewsAdminListView.as_view(), name='news_admin_list'), url(r'^news/create$', NewsCreateView.as_view(), name='news_new'), + url(r'^news/(?P[0-9]+)/delete$', NewsDeleteView.as_view(), name='news_delete'), url(r'^news/(?P[0-9]+)/moderate$', NewsModerateView.as_view(), name='news_moderate'), url(r'^news/(?P[0-9]+)/edit$', NewsEditView.as_view(), name='news_edit'), url(r'^news/(?P[0-9]+)$', NewsDetailView.as_view(), name='news_detail'), diff --git a/com/views.py b/com/views.py index 942ed335..722d820f 100644 --- a/com/views.py +++ b/com/views.py @@ -244,6 +244,11 @@ class NewsCreateView(CanCreateMixin, CreateView): return super(NewsCreateView, self).form_valid(form) +class NewsDeleteView(CanEditMixin, DeleteView): + model = News + pk_url_kwarg = 'news_id' + template_name = 'core/delete_confirm.jinja' + class NewsModerateView(CanEditMixin, SingleObjectMixin): model = News pk_url_kwarg = 'news_id'