diff --git a/com/templates/com/news_admin_list.jinja b/com/templates/com/news_admin_list.jinja index 7db75800..f7800e74 100644 --- a/com/templates/com/news_admin_list.jinja +++ b/com/templates/com/news_admin_list.jinja @@ -7,7 +7,155 @@ {% block content %}

{% trans %}News{% endtrans %}

-

{% trans %}Displayed news{% endtrans %}

+ +
+

{% trans %}Notices{% endtrans %}

+ {% set notices = object_list.filter(type="NOTICE").distinct().order_by('id') %} +
{% trans %}Displayed notices{% endtrans %}
+ + + + + + + + + + + + + + {% for news in notices.filter(is_moderated=True) %} + + + + + + + + + + {% endfor %} + +
{% trans %}Type{% endtrans %}{% trans %}Title{% endtrans %}{% trans %}Summary{% endtrans %}{% trans %}Club{% endtrans %}{% trans %}Author{% endtrans %}{% trans %}Moderator{% endtrans %}{% trans %}Actions{% endtrans %}
{{ news.get_type_display() }}{{ news.title }}{{ news.summary|markdown }}{{ news.club }}{{ user_profile_link(news.author) }}{{ user_profile_link(news.moderator) }}{% trans %}View{% endtrans %} + {% trans %}Edit{% endtrans %} + {% trans %}Remove{% endtrans %}
+
{% trans %}Notices to moderate{% endtrans %}
+ + + + + + + + + + + + + {% for news in notices.filter(is_moderated=False) %} + + + + + + + + + {% endfor %} + +
{% trans %}Type{% endtrans %}{% trans %}Title{% endtrans %}{% trans %}Summary{% endtrans %}{% trans %}Club{% endtrans %}{% trans %}Author{% endtrans %}{% trans %}Actions{% endtrans %}
{{ news.get_type_display() }}{{ news.title }}{{ news.summary|markdown }}{{ news.club }}{{ user_profile_link(news.author) }}{% trans %}View{% endtrans %} + {% trans %}Edit{% endtrans %} + {% trans %}Moderate{% endtrans %}
+ +
+

{% trans %}Weeklies{% endtrans %}

+ {% set weeklies = object_list.filter(type="WEEKLY", dates__end_date__gte=timezone.now()).distinct().order_by('id') %} +
{% trans %}Displayed weeklies{% endtrans %}
+ + + + + + + + + + + + + + + {% for news in weeklies.filter(is_moderated=True) %} + + + + + + + + + + + {% endfor %} + +
{% trans %}Type{% endtrans %}{% trans %}Title{% endtrans %}{% trans %}Summary{% endtrans %}{% trans %}Club{% endtrans %}{% trans %}Author{% endtrans %}{% trans %}Moderator{% endtrans %}{% trans %}Dates{% endtrans %}{% trans %}Actions{% endtrans %}
{{ news.get_type_display() }}{{ news.title }}{{ news.summary|markdown }}{{ news.club }}{{ user_profile_link(news.author) }}{{ user_profile_link(news.moderator) }} +
    + {% for d in news.dates.all() %} +
  • {{ d.start_date|localtime|date(DATETIME_FORMAT) }} + {{ d.start_date|localtime|time(DATETIME_FORMAT) }} - + {{ d.end_date|localtime|date(DATETIME_FORMAT) }} + {{ d.end_date|localtime|time(DATETIME_FORMAT) }} +
  • + {% endfor %} +
+
{% trans %}View{% endtrans %} + {% trans %}Edit{% endtrans %} + {% trans %}Remove{% endtrans %}
+
{% trans %}Weeklies to moderate{% endtrans %}
+ + + + + + + + + + + + + + {% for news in weeklies.filter(is_moderated=False) %} + + + + + + + + + + {% endfor %} + +
{% trans %}Type{% endtrans %}{% trans %}Title{% endtrans %}{% trans %}Summary{% endtrans %}{% trans %}Club{% endtrans %}{% trans %}Author{% endtrans %}{% trans %}Dates{% endtrans %}{% trans %}Actions{% endtrans %}
{{ news.get_type_display() }}{{ news.title }}{{ news.summary|markdown }}{{ news.club }}{{ user_profile_link(news.author) }} +
    + {% for d in news.dates.all() %} +
  • {{ d.start_date|localtime|date(DATETIME_FORMAT) }} + {{ d.start_date|localtime|time(DATETIME_FORMAT) }} - + {{ d.end_date|localtime|date(DATETIME_FORMAT) }} + {{ d.end_date|localtime|time(DATETIME_FORMAT) }} +
  • + {% endfor %} +
+
{% trans %}View{% endtrans %} + {% trans %}Edit{% endtrans %} + {% trans %}Moderate{% endtrans %}
+ +
+

{% trans %}Calls{% endtrans %}

+ {% set calls = object_list.filter(type="CALL", dates__end_date__gte=timezone.now()).distinct().order_by('id') %} +
{% trans %}Displayed calls{% endtrans %}
@@ -23,7 +171,7 @@ - {% for news in object_list.filter(is_moderated=True) %} + {% for news in calls.filter(is_moderated=True) %} @@ -42,7 +190,7 @@ {% endfor %}
{{ news.get_type_display() }} {{ news.title }}
-

{% trans %}News to moderate{% endtrans %}

+
{% trans %}Calls to moderate{% endtrans %}
@@ -57,7 +205,79 @@ - {% for news in object_list.filter(is_moderated=False) %} + {% for news in calls.filter(is_moderated=False) %} + + + + + + + + + + + {% endfor %} + +
{{ news.get_type_display() }}{{ news.title }}{{ news.summary|markdown }}{{ news.club }}{{ user_profile_link(news.author) }}{{ news.dates.first().start_date|localtime|date(DATETIME_FORMAT) }} + {{ news.dates.first().start_date|localtime|time(DATETIME_FORMAT) }}{{ news.dates.first().end_date|localtime|date(DATETIME_FORMAT) }} + {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }}{% trans %}View{% endtrans %} + {% trans %}Edit{% endtrans %} + {% trans %}Moderate{% endtrans %}
+ +
+

{% trans %}Events{% endtrans %}

+ {% set events = object_list.filter(type="EVENT", dates__end_date__gte=timezone.now()).distinct().order_by('id') %} +
{% trans %}Displayed events{% endtrans %}
+ + + + + + + + + + + + + + + + {% for news in events.filter(is_moderated=True) %} + + + + + + + + + + + + {% endfor %} + +
{% trans %}Type{% endtrans %}{% trans %}Title{% endtrans %}{% trans %}Summary{% endtrans %}{% trans %}Club{% endtrans %}{% trans %}Author{% endtrans %}{% trans %}Moderator{% endtrans %}{% trans %}Start{% endtrans %}{% trans %}End{% endtrans %}{% trans %}Actions{% endtrans %}
{{ news.get_type_display() }}{{ news.title }}{{ news.summary|markdown }}{{ news.club }}{{ user_profile_link(news.author) }}{{ user_profile_link(news.moderator) }}{{ news.dates.first().start_date|localtime|date(DATETIME_FORMAT) }} + {{ news.dates.first().start_date|localtime|time(DATETIME_FORMAT) }}{{ news.dates.first().end_date|localtime|date(DATETIME_FORMAT) }} + {{ news.dates.first().end_date|localtime|time(DATETIME_FORMAT) }}{% trans %}View{% endtrans %} + {% trans %}Edit{% endtrans %} + {% trans %}Remove{% endtrans %}
+
{% trans %}Events to moderate{% endtrans %}
+ + + + + + + + + + + + + + + {% for news in events.filter(is_moderated=False) %} diff --git a/com/views.py b/com/views.py index fd676a8d..8f675ef5 100644 --- a/com/views.py +++ b/com/views.py @@ -257,7 +257,7 @@ class NewsModerateView(CanEditMixin, SingleObjectMixin): class NewsAdminListView(CanEditMixin, ListView): model = News template_name = 'com/news_admin_list.jinja' - queryset = News.objects.filter(dates__end_date__gte=timezone.now()).distinct().order_by('id') + queryset = News.objects.all() class NewsListView(CanViewMixin, ListView):
{% trans %}Type{% endtrans %}{% trans %}Title{% endtrans %}{% trans %}Summary{% endtrans %}{% trans %}Club{% endtrans %}{% trans %}Author{% endtrans %}{% trans %}Start{% endtrans %}{% trans %}End{% endtrans %}{% trans %}Actions{% endtrans %}
{{ news.get_type_display() }} {{ news.title }}