From 936f6c1b6b8b1b16897ed44b833a6e118b7eb396 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Mon, 11 Nov 2024 23:35:22 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20rendu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agenda_culturel/administration.html | 10 ++++--- .../agenda_culturel/batch-imports-inc.html | 28 ++++++++++++++----- .../templates/agenda_culturel/imports.html | 8 +++++- .../agenda_culturel/page-rimport.html | 7 ++++- .../agenda_culturel/recent-activity-inc.html | 9 ++++++ src/agenda_culturel/views.py | 13 ++++++--- 6 files changed, 58 insertions(+), 17 deletions(-) diff --git a/src/agenda_culturel/templates/agenda_culturel/administration.html b/src/agenda_culturel/templates/agenda_culturel/administration.html index e306fbb..b85ddca 100644 --- a/src/agenda_culturel/templates/agenda_culturel/administration.html +++ b/src/agenda_culturel/templates/agenda_culturel/administration.html @@ -20,12 +20,14 @@
-

Activité des derniers jours

- {% include "agenda_culturel/recent-activity-inc.html" with modifications=daily_modifications %} +

Résumé des activités

+ {% include "agenda_culturel/recent-activity-inc.html" with modifications=daily_modifications next=1 %} + +

Derniers imports

+ {% include "agenda_culturel/batch-imports-inc.html" with objects=batch_imports next=1 %} +

Détail des imports récurrents : {% include "agenda_culturel/rimports-info-inc.html" with all=1 %}

diff --git a/src/agenda_culturel/templates/agenda_culturel/batch-imports-inc.html b/src/agenda_culturel/templates/agenda_culturel/batch-imports-inc.html index cb1d7ca..98473fc 100644 --- a/src/agenda_culturel/templates/agenda_culturel/batch-imports-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/batch-imports-inc.html @@ -16,13 +16,19 @@ - {% for obj in paginator_filter %} + {% for obj in objects %} {{ obj.id }} {{ obj.created_date }} {% if obj.recurrentImport %}{{ obj.recurrentImport.name }}{% else %} {% if obj.url_source %} - url + + {% if "facebook" in obj.url_source %} + lien facebook + {% else %} + url + {% endif %} + {% endif %} {% endif %} {{ obj.status }} @@ -33,10 +39,18 @@ {% if obj.status == "success" %}{{ obj.nb_removed }}{% endif %} {% endfor %} + {% if next %} + + ... + ... + ... + ... + + ... + ... + ... + ... + + {% endif %} -
- - {% include 'agenda_culturel/paginator.html' %} - -
\ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/imports.html b/src/agenda_culturel/templates/agenda_culturel/imports.html index 209783a..0484c2b 100644 --- a/src/agenda_culturel/templates/agenda_culturel/imports.html +++ b/src/agenda_culturel/templates/agenda_culturel/imports.html @@ -23,7 +23,13 @@

Importations par lot

- {% include "agenda_culturel/batch-imports-inc.html" with paginator_filter=paginator_filter %} + {% include "agenda_culturel/batch-imports-inc.html" with objects=paginator_filter %} + +
+ + {% include 'agenda_culturel/paginator.html' %} + +
{% include "agenda_culturel/side-nav.html" with current="imports" %} diff --git a/src/agenda_culturel/templates/agenda_culturel/page-rimport.html b/src/agenda_culturel/templates/agenda_culturel/page-rimport.html index 4153656..87879d2 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-rimport.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-rimport.html @@ -52,8 +52,13 @@ - {% include "agenda_culturel/batch-imports-inc.html" with paginator_filter=paginator_filter %} + {% include "agenda_culturel/batch-imports-inc.html" with objects=paginator_filter %} + diff --git a/src/agenda_culturel/templates/agenda_culturel/recent-activity-inc.html b/src/agenda_culturel/templates/agenda_culturel/recent-activity-inc.html index 0356a55..d346d81 100644 --- a/src/agenda_culturel/templates/agenda_culturel/recent-activity-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/recent-activity-inc.html @@ -21,6 +21,15 @@ {{ m.nb_local_copies }} {% endfor %} + {% if next %} + + ... + ... + ... + ... + ... + + {% endif %} {% endif %} \ No newline at end of file diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 95f23f2..937bc30 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -1044,7 +1044,10 @@ def administration(request): daily_modifications = Event.get_count_modifications([(d, 1) for d in days]) # get last created events - events = queryset=Event.objects.all().order_by("-created_date")[:10] + events = Event.objects.all().order_by("-created_date")[:5] + + # get last batch imports + batch_imports = BatchImportation.objects.all().order_by("-created_date")[:5] # get info about batch information newest = BatchImportation.objects.filter(recurrentImport=OuterRef("pk")).order_by( @@ -1068,8 +1071,10 @@ def administration(request): return render( request, "agenda_culturel/administration.html", - {"daily_modifications": daily_modifications, "events": events, "nb_failed": nb_failed, "nb_canceled": nb_canceled, - "nb_running": nb_running, "nb_all": nb_all}, + {"daily_modifications": daily_modifications, + "events": events, "batch_imports": batch_imports, + "nb_failed": nb_failed, "nb_canceled": nb_canceled, + "nb_running": nb_running, "nb_all": nb_all}, ) @@ -1309,7 +1314,7 @@ def event_search_full(request): @login_required(login_url="/accounts/login/") @permission_required("agenda_culturel.view_batchimportation") def imports(request): - paginator = Paginator(BatchImportation.objects.all().order_by("-created_date"), 10) + paginator = Paginator(BatchImportation.objects.all().order_by("-created_date"), 30) page = request.GET.get("page") try: