diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 3106142..9e610e5 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -1391,6 +1391,9 @@ class RecurrentImport(models.Model): null=True, ) + def __str__(self): + return self.name + def nb_imports(self): return BatchImportation.objects.filter(recurrentImport=self).count() diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index 3eab92a..6431e03 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -1252,7 +1252,11 @@ article { } } -form.messages div { +form.messages div, form.moderation-events { + @media only screen and (min-width: 992px) { + display: grid; + grid-template-columns: repeat(2, 50%); + } fieldset { float: left; margin-right: 1em; @@ -1261,8 +1265,4 @@ form.messages div { clear: both; float: left; } - div { - display: inline-block; - margin-right: 1em; - } } \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/moderation.html b/src/agenda_culturel/templates/agenda_culturel/moderation.html index f63439c..2c3a23c 100644 --- a/src/agenda_culturel/templates/agenda_culturel/moderation.html +++ b/src/agenda_culturel/templates/agenda_culturel/moderation.html @@ -20,10 +20,16 @@

Derniers événements soumis

-
- {{ filter.form }}
+ + {{ filter.form.as_div }}

+ {% if filter.form.import_sources.value %} +
+ Voir l'import récurrent {% picto_from_name "chevron-right" %} +
+
+ {% endif %}
diff --git a/src/agenda_culturel/templates/agenda_culturel/page-rimport.html b/src/agenda_culturel/templates/agenda_culturel/page-rimport.html index 79e0ac9..f436df7 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-rimport.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-rimport.html @@ -18,8 +18,9 @@
- < Retour + < Tous les imports récurrents
+ Voir les événements {% picto_from_name "calendar" %} Exécuter {% picto_from_name "download-cloud" %} Éditer {% picto_from_name "edit" %} Supprimer {% picto_from_name "trash" %} diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 2d8aa5a..11ce8ee 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -875,6 +875,16 @@ class EventFilterAdmin(django_filters.FilterSet): choices=Event.STATUS.choices, widget=forms.CheckboxSelectMultiple ) + import_sources = django_filters.ModelChoiceFilter( + label="Importé depuis", + method="filter_by_source", + queryset=RecurrentImport.objects.all().order_by("name__unaccent") + ) + + def filter_by_source(self, queryset, name, value): + src = RecurrentImport.objects.get(pk=value.pk).source + return queryset.filter(import_sources__contains=[src]) + class Meta: model = Event fields = ["status"]