diff --git a/svjis/articles/templates/admin_messages.html b/svjis/articles/templates/admin_messages.html
new file mode 100644
index 0000000..41f597f
--- /dev/null
+++ b/svjis/articles/templates/admin_messages.html
@@ -0,0 +1,29 @@
+{% extends "base-with-aside-menu-content.html" %}
+
+{% load i18n %}
+
+{% block content %}
+
+
{% trans 'Waiting messages' %}
+
+
+
+ |
+ {% trans 'Recipient' %} |
+ {% trans 'Subject' %} |
+ {% trans 'Creation time' %} |
+
+
+ {% if object_list %}
+ {% for obj in object_list %}
+
+ {{ forloop.counter }} |
+ {{ obj.email }} |
+ {{ obj.subject }} |
+ {{ obj.creation_time | date:"d.m.Y H:i" }} |
+
+ {% endfor %}
+ {% endif %}
+
+
+{% endblock %}
diff --git a/svjis/articles/urls.py b/svjis/articles/urls.py
index 26e3a76..9631ad8 100644
--- a/svjis/articles/urls.py
+++ b/svjis/articles/urls.py
@@ -36,6 +36,7 @@
path('admin_group_edit//', views_admin.admin_group_edit_view, name='admin_group_edit'),
path('admin_group_save/', views_admin.admin_group_save_view, name='admin_group_save'),
path('admin_group_delete//', views_admin.admin_group_delete_view, name='admin_group_delete'),
+ path('admin_messages/', views_admin.admin_messages_view, name='admin_messages'),
]
if settings.DEBUG:
diff --git a/svjis/articles/views_admin.py b/svjis/articles/views_admin.py
index b53e9db..6e05932 100644
--- a/svjis/articles/views_admin.py
+++ b/svjis/articles/views_admin.py
@@ -14,6 +14,8 @@ def get_side_menu(active_item, user):
result.append({'description': _("Users"), 'link': reverse(admin_user_view), 'active': True if active_item == 'users' else False})
if user.has_perm('articles.svjis_edit_admin_groups'):
result.append({'description': _("Groups"), 'link': reverse(admin_group_view), 'active': True if active_item == 'groups' else False})
+ if user.has_perm('articles.svjis_edit_admin_groups'):
+ result.append({'description': _("Waiting messages"), 'link': reverse(admin_messages_view), 'active': True if active_item == 'messages' else False})
return result
@@ -176,3 +178,16 @@ def admin_group_delete_view(request, pk):
obj = get_object_or_404(Group, pk=pk)
obj.delete()
return redirect(admin_group_view)
+
+
+# Administration - Waiting messages
+@permission_required("articles.svjis_edit_admin_groups")
+def admin_messages_view(request):
+ message_list = models.MessageQueue.objects.filter(status=0)
+ ctx = {
+ 'aside_menu_name': _("Administration"),
+ }
+ ctx['aside_menu_items'] = get_side_menu('messages', request.user)
+ ctx['tray_menu_items'] = utils.get_tray_menu('admin', request.user)
+ ctx['object_list'] = message_list
+ return render(request, "admin_messages.html", ctx)