diff --git a/src/backoffice/locale/de/LC_MESSAGES/django.po b/src/backoffice/locale/de/LC_MESSAGES/django.po index 01b290213c7b5f87cbb10d5411d17e320a4545fe..92b964a40d211ed8b986a36e680e5f5c26df885a 100644 --- a/src/backoffice/locale/de/LC_MESSAGES/django.po +++ b/src/backoffice/locale/de/LC_MESSAGES/django.po @@ -1286,6 +1286,29 @@ msgstr "Anlage derzeit nicht möglich." msgid "Room-new-other__create" msgstr "sonstigen Raum anlegen" +msgid "backoffice_schedules_tabularview" +msgstr "tabellarische Ansicht" + +# use translation from core +msgid "ScheduleSource__import_url" +msgstr "" + +# use translation from core +msgid "ScheduleSource__import_type" +msgstr "" + +# use translation from core +msgid "ScheduleSource__last_import" +msgstr "" + +# use translation from core +msgid "ScheduleSource__is_due" +msgstr "" + +# use translation from core +msgid "ScheduleSource__has_running_import" +msgstr "" + msgid "Self-organized content" msgstr "Self-organized Inhalte" diff --git a/src/backoffice/locale/en/LC_MESSAGES/django.po b/src/backoffice/locale/en/LC_MESSAGES/django.po index 5a8ded02d2136cd57c6416572e2522bd22c5ff24..31e3eb49a08090b6301a26d621b860da132f6bb8 100644 --- a/src/backoffice/locale/en/LC_MESSAGES/django.po +++ b/src/backoffice/locale/en/LC_MESSAGES/django.po @@ -1293,6 +1293,29 @@ msgstr "not available" msgid "Room-new-other__create" msgstr "create other room" +msgid "backoffice_schedules_tabularview" +msgstr "tabular view" + +# use translation from core +msgid "ScheduleSource__import_url" +msgstr "" + +# use translation from core +msgid "ScheduleSource__import_type" +msgstr "" + +# use translation from core +msgid "ScheduleSource__last_import" +msgstr "" + +# use translation from core +msgid "ScheduleSource__is_due" +msgstr "" + +# use translation from core +msgid "ScheduleSource__has_running_import" +msgstr "" + msgid "Self-organized content" msgstr "Self-organized content" diff --git a/src/backoffice/templates/backoffice/schedules_index.html b/src/backoffice/templates/backoffice/schedules_index.html index 02b783c9cf055461a07c8140848a434d11b7c8a0..62c2d74e4c817f8913452576601a080c08cc3a2b 100644 --- a/src/backoffice/templates/backoffice/schedules_index.html +++ b/src/backoffice/templates/backoffice/schedules_index.html @@ -1,13 +1,52 @@ {% extends 'backoffice/base.html' %} {% load i18n %} +{% load humanize %} {% block content %} -<div class="card"> - <div class="card-body"> - Sources: <a href="{% url 'backoffice:schedulesource-list' %}">{{ sources_count }}</a> + <div class="mb-3 align-content-end"> + <a class="btn btn-primary" href="{% url 'backoffice:schedulesource-list' %}">{% trans "backoffice_schedules_tabularview" %}</a> </div> -</div> -<div class="alert alert-warning my-3">TODO</div> -{% endblock %} \ No newline at end of file + <div class="row row-cols-1 row-cols-md-3 g-4"> + + {% for source in sources %} + {% with source.imports.first as latest %} + <div class="col"> + <div class="card{% if source.has_running_import %} border-primary{% elif source.is_due %} border-warning{% endif %}"> + <div class="card-header{% if source.has_running_import %} text-bg-primary{% elif source.is_due %} text-bg-warning{% endif %}"> + <a href="{% url 'backoffice:schedulesource-detail' pk=source.pk %}" class="float-end ms-3">Details</a> + {% if source.assembly %} + <abbr title="{% trans "Assembly" %}: {{ source.assembly.name }}">{{ source.assembly.slug }}</abbr> + {% else %} + <span title="Wildcard">*</span> + {% endif %} + </div> + <div class="card-body"> + <p> + <span class="text-muted small">{% trans "ScheduleSource__import_url" %} (<span title="{% trans "ScheduleSource__import_type" %}">{{ source.import_type }}</span>):</span><br> + {{ source.import_url_masked }} + </p> + <p> + <span class="text-muted small">{% trans "ScheduleSource__last_import" %}:</span><br> + {{ source.last_import|naturaltime|default:"-/-" }} + </p> + {% if source.is_due %} + <p class="text-warning"> + <i class="bi bi-clock-history"></i> {% trans "ScheduleSource__is_due" %} + </p> + {% endif %} + {% if source.has_running_import %} + <p class="text-primary"> + <i class="bi bi-house-gear"></i> {% trans "ScheduleSource__has_running_import" %} + </p> + {% endif %} + </div> + </div> + </div> + {% endwith %} + {% endfor %} + + </div> + +{% endblock %} diff --git a/src/backoffice/views/schedules.py b/src/backoffice/views/schedules.py index d7f0c454477c90c03012246d031a1832b558c8e9..34d7c5755ac60f95d6d267cdec7173b5fdaa375c 100644 --- a/src/backoffice/views/schedules.py +++ b/src/backoffice/views/schedules.py @@ -26,7 +26,7 @@ class SchedulesIndexView(ScheduleAdminMixin, TemplateView): def get_context_data(self, *args, **kwargs): ctx = super().get_context_data(*args, **kwargs) - ctx['sources_count'] = ScheduleSource.objects.count() + ctx['sources'] = self.conference.schedule_sources.select_related('assembly').all() return ctx