Amélioration de la gestion des messages

Fix #209
This commit is contained in:
Jean-Marie Favreau 2024-12-29 13:07:08 +01:00
parent 49a8f4b306
commit c9df18c822
9 changed files with 290 additions and 200 deletions

View File

@ -363,19 +363,25 @@ class EventFilterAdmin(django_filters.FilterSet):
class MessagesFilterAdmin(django_filters.FilterSet):
closed = django_filters.MultipleChoiceFilter(
label="Status",
label=_("Status"),
choices=((True, _("Closed")), (False, _("Open"))),
widget=forms.CheckboxSelectMultiple,
)
spam = django_filters.MultipleChoiceFilter(
label="Spam",
label=_("Spam"),
choices=((True, _("Spam")), (False, _("Non spam"))),
widget=forms.CheckboxSelectMultiple,
)
message_type = django_filters.MultipleChoiceFilter(
label=_("Type"),
choices=Message.TYPE.choices,
widget=forms.CheckboxSelectMultiple,
)
class Meta:
model = Message
fields = ["closed", "spam"]
fields = ["closed", "spam", "message_type"]
class SimpleSearchEventFilter(django_filters.FilterSet):

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: agenda_culturel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-29 01:06+0100\n"
"POT-Creation-Date: 2024-12-29 13:06+0100\n"
"PO-Revision-Date: 2023-10-29 14:16+0000\n"
"Last-Translator: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
"Language-Team: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
@ -110,7 +110,12 @@ msgstr "Non"
msgid "Imported from"
msgstr "Importé depuis"
#: agenda_culturel/filters.py:367 agenda_culturel/models.py:1928
#: agenda_culturel/filters.py:366 agenda_culturel/models.py:622
#: agenda_culturel/models.py:2151
msgid "Status"
msgstr "Status"
#: agenda_culturel/filters.py:367 agenda_culturel/models.py:1941
msgid "Closed"
msgstr "Fermé"
@ -118,7 +123,8 @@ msgstr "Fermé"
msgid "Open"
msgstr "Ouvert"
#: agenda_culturel/filters.py:372 agenda_culturel/models.py:1922
#: agenda_culturel/filters.py:371 agenda_culturel/filters.py:372
#: agenda_culturel/models.py:1935
msgid "Spam"
msgstr "Spam"
@ -126,7 +132,11 @@ msgstr "Spam"
msgid "Non spam"
msgstr "Non spam"
#: agenda_culturel/filters.py:383
#: agenda_culturel/filters.py:377 agenda_culturel/models.py:1956
msgid "Type"
msgstr "Type"
#: agenda_culturel/filters.py:389
msgid "Search"
msgstr "Rechercher"
@ -149,11 +159,11 @@ msgstr ""
msgid "Your email"
msgstr "Votre adresse email"
#: agenda_culturel/forms.py:135 agenda_culturel/models.py:1912
#: agenda_culturel/forms.py:135 agenda_culturel/models.py:1925
msgid "Your email address"
msgstr "Votre adresse email"
#: agenda_culturel/forms.py:141 agenda_culturel/models.py:1935
#: agenda_culturel/forms.py:141 agenda_culturel/models.py:1948
msgid "Comments"
msgstr "Commentaires"
@ -169,8 +179,8 @@ msgid "Receive notification of publication or leave a message for moderation"
msgstr "Être notifié de la publication ou laisser un message à la modération"
#: agenda_culturel/forms.py:171 agenda_culturel/models.py:185
#: agenda_culturel/models.py:627 agenda_culturel/models.py:2053
#: agenda_culturel/models.py:2163
#: agenda_culturel/models.py:627 agenda_culturel/models.py:2073
#: agenda_culturel/models.py:2183
msgid "Category"
msgstr "Catégorie"
@ -206,7 +216,7 @@ msgid "Details"
msgstr "Détails"
#: agenda_culturel/forms.py:324 agenda_culturel/models.py:657
#: agenda_culturel/models.py:2028
#: agenda_culturel/models.py:2048
msgid "Location"
msgstr "Localisation"
@ -300,7 +310,7 @@ msgid "Apply category {} to the event {}"
msgstr "Appliquer la catégorie {} à l'événement {}"
#: agenda_culturel/forms.py:746 agenda_culturel/models.py:473
#: agenda_culturel/models.py:2215
#: agenda_culturel/models.py:2235
msgid "Place"
msgstr "Lieu"
@ -341,7 +351,7 @@ msgstr "Ajouter un commentaire"
#: agenda_culturel/models.py:66 agenda_culturel/models.py:114
#: agenda_culturel/models.py:195 agenda_culturel/models.py:416
#: agenda_culturel/models.py:444 agenda_culturel/models.py:531
#: agenda_culturel/models.py:1904 agenda_culturel/models.py:1982
#: agenda_culturel/models.py:1917 agenda_culturel/models.py:2002
msgid "Name"
msgstr "Nom"
@ -578,7 +588,7 @@ msgstr "Organisme"
msgid "Organisations"
msgstr "Organismes"
#: agenda_culturel/models.py:572 agenda_culturel/models.py:2023
#: agenda_culturel/models.py:572 agenda_culturel/models.py:2043
msgid "Published"
msgstr "Publié"
@ -610,10 +620,6 @@ msgstr "Auteur de la dernière modération"
msgid "Title"
msgstr "Titre"
#: agenda_culturel/models.py:622 agenda_culturel/models.py:2131
msgid "Status"
msgstr "Status"
#: agenda_culturel/models.py:634
msgid "Start day"
msgstr "Date de début"
@ -710,19 +716,19 @@ msgstr "Ton événement a été publié"
msgid "Your message has not been retained"
msgstr "Ton événement n'a pas été retenu"
#: agenda_culturel/models.py:1333
#: agenda_culturel/models.py:1332
msgid "during import process"
msgstr "pendant le processus d'import"
#: agenda_culturel/models.py:1671
#: agenda_culturel/models.py:1674
msgid "Import"
msgstr "Import"
#: agenda_culturel/models.py:1671
#: agenda_culturel/models.py:1675
msgid "import process"
msgstr "processus d'import"
#: agenda_culturel/models.py:1671
#: agenda_culturel/models.py:1676
msgid ""
"The duration of the event is a little too long for direct publication. "
"Moderators can choose to publish it or not."
@ -730,135 +736,151 @@ msgstr ""
"La durée de l'événement est un peu trop longue pour qu'il soit publié "
"directement. Les modérateurs peuvent choisir de le publier ou non."
#: agenda_culturel/models.py:1869 agenda_culturel/models.py:1917
#: agenda_culturel/models.py:1876
msgid "From contributor"
msgstr "D'un·e contributeurice"
#: agenda_culturel/models.py:1877
msgid "Import process"
msgstr "Processus d'import"
#: agenda_culturel/models.py:1878
msgid "Contact form"
msgstr "Formulaire de contact"
#: agenda_culturel/models.py:1879
msgid "Event report"
msgstr "Signalemet d'événement"
#: agenda_culturel/models.py:1882 agenda_culturel/models.py:1930
msgid "Message"
msgstr "Message"
#: agenda_culturel/models.py:1870
#: agenda_culturel/models.py:1883
msgid "Messages"
msgstr "Messages"
#: agenda_culturel/models.py:1881
#: agenda_culturel/models.py:1894
msgid "Subject"
msgstr "Sujet"
#: agenda_culturel/models.py:1882
#: agenda_culturel/models.py:1895
msgid "The subject of your message"
msgstr "Sujet de votre message"
#: agenda_culturel/models.py:1888
#: agenda_culturel/models.py:1901
msgid "Related event"
msgstr "Événement associé"
#: agenda_culturel/models.py:1889
#: agenda_culturel/models.py:1902
msgid "The message is associated with this event."
msgstr "Le message est associé à cet événement."
#: agenda_culturel/models.py:1897
#: agenda_culturel/models.py:1910
msgid "Author of the message"
msgstr "Auteur du message"
#: agenda_culturel/models.py:1905
#: agenda_culturel/models.py:1918
msgid "Your name"
msgstr "Votre nom"
#: agenda_culturel/models.py:1911
#: agenda_culturel/models.py:1924
msgid "Email address"
msgstr "Adresse email"
#: agenda_culturel/models.py:1917
#: agenda_culturel/models.py:1930
msgid "Your message"
msgstr "Votre message"
#: agenda_culturel/models.py:1923
#: agenda_culturel/models.py:1936
msgid "This message is a spam."
msgstr "Ce message est un spam."
#: agenda_culturel/models.py:1930
#: agenda_culturel/models.py:1943
msgid "this message has been processed and no longer needs to be handled"
msgstr "Ce message a été traité et ne nécessite plus d'être pris en charge"
#: agenda_culturel/models.py:1936
#: agenda_culturel/models.py:1949
msgid "Comments on the message from the moderation team"
msgstr "Commentaires sur ce message par l'équipe de modération"
#: agenda_culturel/models.py:1951 agenda_culturel/models.py:2111
#: agenda_culturel/models.py:1971 agenda_culturel/models.py:2131
msgid "Recurrent import"
msgstr "Import récurrent"
#: agenda_culturel/models.py:1952
#: agenda_culturel/models.py:1972
msgid "Recurrent imports"
msgstr "Imports récurrents"
#: agenda_culturel/models.py:1956
#: agenda_culturel/models.py:1976
msgid "ical"
msgstr "ical"
#: agenda_culturel/models.py:1957
#: agenda_culturel/models.py:1977
msgid "ical no busy"
msgstr "ical sans busy"
#: agenda_culturel/models.py:1958
#: agenda_culturel/models.py:1978
msgid "ical no VC"
msgstr "ical sans VC"
#: agenda_culturel/models.py:1959
#: agenda_culturel/models.py:1979
msgid "lacoope.org"
msgstr "lacoope.org"
#: agenda_culturel/models.py:1960
#: agenda_culturel/models.py:1980
msgid "la comédie"
msgstr "la comédie"
#: agenda_culturel/models.py:1961
#: agenda_culturel/models.py:1981
msgid "le fotomat"
msgstr "le fotomat"
#: agenda_culturel/models.py:1962
#: agenda_culturel/models.py:1982
msgid "la puce à l'oreille"
msgstr "la puce à loreille"
#: agenda_culturel/models.py:1963
#: agenda_culturel/models.py:1983
msgid "Plugin wordpress MEC"
msgstr "Plugin wordpress MEC"
#: agenda_culturel/models.py:1964
#: agenda_culturel/models.py:1984
msgid "Événements d'une page FB"
msgstr "Événements d'une page FB"
#: agenda_culturel/models.py:1965
#: agenda_culturel/models.py:1985
msgid "la cour des 3 coquins"
msgstr "la cour des 3 coquins"
#: agenda_culturel/models.py:1966
#: agenda_culturel/models.py:1986
msgid "Arachnée concert"
msgstr "Arachnée concert"
#: agenda_culturel/models.py:1967
#: agenda_culturel/models.py:1987
msgid "Le Rio"
msgstr "Le Rio"
#: agenda_culturel/models.py:1970
#: agenda_culturel/models.py:1990
msgid "simple"
msgstr "simple"
#: agenda_culturel/models.py:1971
#: agenda_culturel/models.py:1991
msgid "Headless Chromium"
msgstr "chromium sans interface"
#: agenda_culturel/models.py:1972
#: agenda_culturel/models.py:1992
msgid "Headless Chromium (pause)"
msgstr "chromium sans interface (pause)"
#: agenda_culturel/models.py:1977
#: agenda_culturel/models.py:1997
msgid "daily"
msgstr "chaque jour"
#: agenda_culturel/models.py:1979
#: agenda_culturel/models.py:1999
msgid "weekly"
msgstr "chaque semaine"
#: agenda_culturel/models.py:1984
#: agenda_culturel/models.py:2004
msgid ""
"Recurrent import name. Be careful to choose a name that is easy to "
"understand, as it will be public and displayed on the sites About page."
@ -866,151 +888,151 @@ msgstr ""
"Nom de l'import récurrent. Attention à choisir un nom compréhensible, car il "
"sera public, et affiché sur la page à propos du site."
#: agenda_culturel/models.py:1991
#: agenda_culturel/models.py:2011
msgid "Processor"
msgstr "Processeur"
#: agenda_culturel/models.py:1994
#: agenda_culturel/models.py:2014
msgid "Downloader"
msgstr "Téléchargeur"
#: agenda_culturel/models.py:2001
#: agenda_culturel/models.py:2021
msgid "Import recurrence"
msgstr "Récurrence d'import"
#: agenda_culturel/models.py:2008
#: agenda_culturel/models.py:2028
msgid "Source"
msgstr "Source"
#: agenda_culturel/models.py:2009
#: agenda_culturel/models.py:2029
msgid "URL of the source document"
msgstr "URL du document source"
#: agenda_culturel/models.py:2013
#: agenda_culturel/models.py:2033
msgid "Browsable url"
msgstr "URL navigable"
#: agenda_culturel/models.py:2015
#: agenda_culturel/models.py:2035
msgid "URL of the corresponding document that will be shown to visitors."
msgstr "URL correspondant au document et qui sera montrée aux visiteurs"
#: agenda_culturel/models.py:2024
#: agenda_culturel/models.py:2044
msgid "Status of each imported event (published or draft)"
msgstr "Status de chaque événement importé (publié ou brouillon)"
#: agenda_culturel/models.py:2029
#: agenda_culturel/models.py:2049
msgid "Address for each imported event"
msgstr "Adresse de chaque événement importé"
#: agenda_culturel/models.py:2036
#: agenda_culturel/models.py:2056
msgid "Force location"
msgstr "Focer la localisation"
#: agenda_culturel/models.py:2037
#: agenda_culturel/models.py:2057
msgid "force location even if another is detected."
msgstr "Forcer la localisation même si une autre a été détectée."
#: agenda_culturel/models.py:2043
#: agenda_culturel/models.py:2063
msgid "Organiser"
msgstr "Organisateur"
#: agenda_culturel/models.py:2044
#: agenda_culturel/models.py:2064
msgid "Organiser of each imported event"
msgstr "Organisateur de chaque événement importé"
#: agenda_culturel/models.py:2054
#: agenda_culturel/models.py:2074
msgid "Category of each imported event"
msgstr "Catégorie de chaque événement importé"
#: agenda_culturel/models.py:2062
#: agenda_culturel/models.py:2082
msgid "Tags for each imported event"
msgstr "Étiquettes de chaque événement importé"
#: agenda_culturel/models.py:2063
#: agenda_culturel/models.py:2083
msgid "A list of tags that describe each imported event."
msgstr "Une liste d'étiquettes décrivant chaque événement importé"
#: agenda_culturel/models.py:2092
#: agenda_culturel/models.py:2112
msgid "Running"
msgstr "En cours"
#: agenda_culturel/models.py:2093
#: agenda_culturel/models.py:2113
msgid "Canceled"
msgstr "Annulé"
#: agenda_culturel/models.py:2094
#: agenda_culturel/models.py:2114
msgid "Success"
msgstr "Succès"
#: agenda_culturel/models.py:2095
#: agenda_culturel/models.py:2115
msgid "Failed"
msgstr "Erreur"
#: agenda_culturel/models.py:2098
#: agenda_culturel/models.py:2118
msgid "Batch importation"
msgstr "Importation par lot"
#: agenda_culturel/models.py:2099
#: agenda_culturel/models.py:2119
msgid "Batch importations"
msgstr "Importations par lot"
#: agenda_culturel/models.py:2112
#: agenda_culturel/models.py:2132
msgid "Reference to the recurrent import processing"
msgstr "Référence du processus d'import récurrent"
#: agenda_culturel/models.py:2120
#: agenda_culturel/models.py:2140
msgid "URL (if not recurrent import)"
msgstr "URL (si pas d'import récurrent)"
#: agenda_culturel/models.py:2122
#: agenda_culturel/models.py:2142
msgid "Source URL if no RecurrentImport is associated."
msgstr "URL source si aucun import récurrent n'est associé"
#: agenda_culturel/models.py:2135
#: agenda_culturel/models.py:2155
msgid "Error message"
msgstr "Votre message"
#: agenda_culturel/models.py:2139
#: agenda_culturel/models.py:2159
msgid "Number of collected events"
msgstr "Nombre d'événements collectés"
#: agenda_culturel/models.py:2142
#: agenda_culturel/models.py:2162
msgid "Number of imported events"
msgstr "Nombre d'événements importés"
#: agenda_culturel/models.py:2145
#: agenda_culturel/models.py:2165
msgid "Number of updated events"
msgstr "Nombre d'événements mis à jour"
#: agenda_culturel/models.py:2148
#: agenda_culturel/models.py:2168
msgid "Number of removed events"
msgstr "Nombre d'événements supprimés"
#: agenda_culturel/models.py:2156
#: agenda_culturel/models.py:2176
msgid "Weight"
msgstr "Poids"
#: agenda_culturel/models.py:2157
#: agenda_culturel/models.py:2177
msgid "The lower is the weight, the earlier the filter is applied"
msgstr "Plus le poids est léger, plus le filtre sera appliqué tôt"
#: agenda_culturel/models.py:2164
#: agenda_culturel/models.py:2184
msgid "Category applied to the event"
msgstr "Catégorie appliquée à l'événement"
#: agenda_culturel/models.py:2169
#: agenda_culturel/models.py:2189
msgid "Contained in the title"
msgstr "Contenu dans le titre"
#: agenda_culturel/models.py:2170
#: agenda_culturel/models.py:2190
msgid "Text contained in the event title"
msgstr "Texte contenu dans le titre de l'événement"
#: agenda_culturel/models.py:2176
#: agenda_culturel/models.py:2196
msgid "Exact title extract"
msgstr "Extrait exact du titre"
#: agenda_culturel/models.py:2178
#: agenda_culturel/models.py:2198
msgid ""
"If checked, the extract will be searched for in the title using the exact "
"form (capitals, accents)."
@ -1018,19 +1040,19 @@ msgstr ""
"Si coché, l'extrait sera recherché dans le titre en utilisant la forme "
"exacte (majuscules, accents)"
#: agenda_culturel/models.py:2184
#: agenda_culturel/models.py:2204
msgid "Contained in the description"
msgstr "Contenu dans la description"
#: agenda_culturel/models.py:2185
#: agenda_culturel/models.py:2205
msgid "Text contained in the description"
msgstr "Texte contenu dans la description"
#: agenda_culturel/models.py:2191
#: agenda_culturel/models.py:2211
msgid "Exact description extract"
msgstr "Extrait exact de description"
#: agenda_culturel/models.py:2193
#: agenda_culturel/models.py:2213
msgid ""
"If checked, the extract will be searched for in the description using the "
"exact form (capitals, accents)."
@ -1038,19 +1060,19 @@ msgstr ""
"Si coché, l'extrait sera recherché dans la description en utilisant la forme "
"exacte (majuscules, accents)"
#: agenda_culturel/models.py:2199
#: agenda_culturel/models.py:2219
msgid "Contained in the location"
msgstr "Contenu dans la localisation"
#: agenda_culturel/models.py:2200
#: agenda_culturel/models.py:2220
msgid "Text contained in the event location"
msgstr "Texte contenu dans la localisation de l'événement"
#: agenda_culturel/models.py:2206
#: agenda_culturel/models.py:2226
msgid "Exact location extract"
msgstr "Extrait exact de localisation"
#: agenda_culturel/models.py:2208
#: agenda_culturel/models.py:2228
msgid ""
"If checked, the extract will be searched for in the location using the exact "
"form (capitals, accents)."
@ -1058,15 +1080,15 @@ msgstr ""
"Si coché, l'extrait sera recherché dans la localisation en utilisant la "
"forme exacte (majuscules, accents)"
#: agenda_culturel/models.py:2216
#: agenda_culturel/models.py:2236
msgid "Location from place"
msgstr "Localisation depuis le lieu"
#: agenda_culturel/models.py:2225
#: agenda_culturel/models.py:2245
msgid "Categorisation rule"
msgstr "Règle de catégorisation"
#: agenda_culturel/models.py:2226
#: agenda_culturel/models.py:2246
msgid "Categorisation rules"
msgstr "Règles de catégorisation"
@ -1152,90 +1174,91 @@ msgstr ""
"L'événement a été soumis et sera publié dès qu'il aura été validé par "
"l'équipe de modération."
#: agenda_culturel/views.py:601
msgid "A message has been sent to the person who proposed the initial event."
msgstr "Un message a été envoyé à la personne qui a proposé l'événement initial."
#: agenda_culturel/views.py:605
#: agenda_culturel/views.py:602
msgid "during the creation process"
msgstr "pendant le processus d'import"
#: agenda_culturel/views.py:696 agenda_culturel/views.py:760
#: agenda_culturel/views.py:616
msgid "A message has been sent to the person who proposed the initial event."
msgstr ""
"Un message a été envoyé à la personne qui a proposé l'événement initial."
#: agenda_culturel/views.py:704 agenda_culturel/views.py:768
msgid "{} has not been submitted since its already known: {}."
msgstr "{} n'a pas été soumis car il est déjà connu: {}."
#: agenda_culturel/views.py:701 agenda_culturel/views.py:766
#: agenda_culturel/views.py:709 agenda_culturel/views.py:774
msgid ""
"{} has not been submitted since its already known and currently into "
"moderation process."
msgstr "{} n'a pas été soumis car il est déjà connu et en cours de modération"
#: agenda_culturel/views.py:711
#: agenda_culturel/views.py:719
msgid "Integrating {} url(s) into our import process."
msgstr "Intégration de {} url(s) dans notre processus d'import."
#: agenda_culturel/views.py:773
#: agenda_culturel/views.py:781
msgid "Integrating {} into our import process."
msgstr "Intégration de {} dans notre processus d'import."
#: agenda_culturel/views.py:831
#: agenda_culturel/views.py:839
msgid "Your message has been sent successfully."
msgstr "Votre message a été envoyé avec succès."
#: agenda_culturel/views.py:859
#: agenda_culturel/views.py:869
msgid "Reporting the event {} on {}"
msgstr "Signaler l'événement {} du {}"
#: agenda_culturel/views.py:869
#: agenda_culturel/views.py:879
msgid "The contact message has been successfully deleted."
msgstr "Le message de contact a été supprimé avec succès."
#: agenda_culturel/views.py:883
#: agenda_culturel/views.py:893
msgid "The contact message properties has been successfully modified."
msgstr "Les propriétés du message de contact ont été modifié avec succès."
#: agenda_culturel/views.py:1052
#: agenda_culturel/views.py:1062
msgid "Spam has been successfully deleted."
msgstr "Le spam a été supprimé avec succès"
#: agenda_culturel/views.py:1175
#: agenda_culturel/views.py:1185
msgid "The import has been run successfully."
msgstr "L'import a été lancé avec succès"
#: agenda_culturel/views.py:1194
#: agenda_culturel/views.py:1204
msgid "The import has been canceled."
msgstr "L'import a été annulé"
#: agenda_culturel/views.py:1272
#: agenda_culturel/views.py:1282
msgid "The recurrent import has been successfully modified."
msgstr "L'import récurrent a été modifié avec succès."
#: agenda_culturel/views.py:1281
#: agenda_culturel/views.py:1291
msgid "The recurrent import has been successfully deleted."
msgstr "L'import récurrent a été supprimé avec succès"
#: agenda_culturel/views.py:1321
#: agenda_culturel/views.py:1331
msgid "The import has been launched."
msgstr "L'import a été lancé"
#: agenda_culturel/views.py:1343
#: agenda_culturel/views.py:1353
msgid "Imports has been launched."
msgstr "Les imports ont été lancés"
#: agenda_culturel/views.py:1405
#: agenda_culturel/views.py:1415
msgid "Update successfully completed."
msgstr "Mise à jour réalisée avec succès."
#: agenda_culturel/views.py:1466
#: agenda_culturel/views.py:1476
msgid "Creation of a merged event has been successfully completed."
msgstr "Création d'un événement fusionné réalisée avec succès."
#: agenda_culturel/views.py:1502
#: agenda_culturel/views.py:1512
msgid "Events have been marked as unduplicated."
msgstr "Les événements ont été marqués comme non dupliqués."
#: agenda_culturel/views.py:1516 agenda_culturel/views.py:1525
#: agenda_culturel/views.py:1543
#: agenda_culturel/views.py:1526 agenda_culturel/views.py:1535
#: agenda_culturel/views.py:1553
msgid ""
"The selected item is no longer included in the list of duplicates. Someone "
"else has probably modified the list in the meantime."
@ -1243,23 +1266,23 @@ msgstr ""
"L'élément sélectionné ne fait plus partie de la liste des dupliqués. Une "
"autre personne a probablement modifié la liste entre temps."
#: agenda_culturel/views.py:1519
#: agenda_culturel/views.py:1529
msgid "The selected event has been set as representative"
msgstr "L'événement sélectionné a été défini comme representatif."
#: agenda_culturel/views.py:1534
#: agenda_culturel/views.py:1544
msgid "The event has been withdrawn from the group and made independent."
msgstr "L'événement a été retiré du groupe et rendu indépendant."
#: agenda_culturel/views.py:1578
#: agenda_culturel/views.py:1588
msgid "Cleaning up duplicates: {} item(s) fixed."
msgstr "Nettoyage des dupliqués: {} élément(s) corrigé(s)."
#: agenda_culturel/views.py:1628
#: agenda_culturel/views.py:1638
msgid "The event was successfully duplicated."
msgstr "L'événement a été marqué dupliqué avec succès."
#: agenda_culturel/views.py:1636
#: agenda_culturel/views.py:1646
msgid ""
"The event has been successfully flagged as a duplicate. The moderation team "
"will deal with your suggestion shortly."
@ -1267,32 +1290,32 @@ msgstr ""
"L'événement a été signalé comme dupliqué avec succès. Votre suggestion sera "
"prochainement prise en charge par l'équipe de modération."
#: agenda_culturel/views.py:1689
#: agenda_culturel/views.py:1699
msgid "The categorisation rule has been successfully modified."
msgstr "La règle de catégorisation a été modifiée avec succès."
#: agenda_culturel/views.py:1698
#: agenda_culturel/views.py:1708
msgid "The categorisation rule has been successfully deleted."
msgstr "La règle de catégorisation a été supprimée avec succès"
#: agenda_culturel/views.py:1720
#: agenda_culturel/views.py:1730
msgid "The rules were successfully applied and 1 event was categorised."
msgstr ""
"Les règles ont été appliquées avec succès et 1 événement a été catégorisé"
#: agenda_culturel/views.py:1727
#: agenda_culturel/views.py:1737
msgid "The rules were successfully applied and {} events were categorised."
msgstr ""
"Les règles ont été appliquées avec succès et {} événements ont été "
"catégorisés"
#: agenda_culturel/views.py:1734 agenda_culturel/views.py:1787
#: agenda_culturel/views.py:1744 agenda_culturel/views.py:1797
msgid "The rules were successfully applied and no events were categorised."
msgstr ""
"Les règles ont été appliquées avec succès et aucun événement n'a été "
"catégorisé"
#: agenda_culturel/views.py:1773
#: agenda_culturel/views.py:1783
msgid ""
"The rules were successfully applied and 1 event with default category was "
"categorised."
@ -1300,7 +1323,7 @@ msgstr ""
"Les règles ont été appliquées avec succès et 1 événement avec catégorie par "
"défaut a été catégorisé"
#: agenda_culturel/views.py:1780
#: agenda_culturel/views.py:1790
msgid ""
"The rules were successfully applied and {} events with default category were "
"categorised."
@ -1308,58 +1331,58 @@ msgstr ""
"Les règles ont été appliquées avec succès et {} événements avec catégorie "
"par défaut ont été catégorisés"
#: agenda_culturel/views.py:1872 agenda_culturel/views.py:1934
#: agenda_culturel/views.py:1972
#: agenda_culturel/views.py:1882 agenda_culturel/views.py:1944
#: agenda_culturel/views.py:1982
msgid "{} events have been updated."
msgstr "{} événements ont été mis à jour."
#: agenda_culturel/views.py:1875 agenda_culturel/views.py:1936
#: agenda_culturel/views.py:1975
#: agenda_culturel/views.py:1885 agenda_culturel/views.py:1946
#: agenda_culturel/views.py:1985
msgid "1 event has been updated."
msgstr "1 événement a été mis à jour"
#: agenda_culturel/views.py:1877 agenda_culturel/views.py:1938
#: agenda_culturel/views.py:1977
#: agenda_culturel/views.py:1887 agenda_culturel/views.py:1948
#: agenda_culturel/views.py:1987
msgid "No events have been modified."
msgstr "Aucun événement n'a été modifié."
#: agenda_culturel/views.py:1886
#: agenda_culturel/views.py:1896
msgid "The place has been successfully updated."
msgstr "Le lieu a été modifié avec succès."
#: agenda_culturel/views.py:1895
#: agenda_culturel/views.py:1905
msgid "The place has been successfully created."
msgstr "Le lieu a été créé avec succès."
#: agenda_culturel/views.py:1960
#: agenda_culturel/views.py:1970
msgid "The selected place has been assigned to the event."
msgstr "Le lieu sélectionné a été assigné à l'événement."
#: agenda_culturel/views.py:1964
#: agenda_culturel/views.py:1974
msgid "A new alias has been added to the selected place."
msgstr "Un nouvel alias a été créé pour le lieu sélectionné."
#: agenda_culturel/views.py:2066
#: agenda_culturel/views.py:2076
msgid "The organisation has been successfully updated."
msgstr "L'organisme a été modifié avec succès."
#: agenda_culturel/views.py:2075
#: agenda_culturel/views.py:2085
msgid "The organisation has been successfully created."
msgstr "L'organisme a été créé avec succès."
#: agenda_culturel/views.py:2092
#: agenda_culturel/views.py:2102
msgid "The tag has been successfully updated."
msgstr "L'étiquette a été modifiée avec succès."
#: agenda_culturel/views.py:2099
#: agenda_culturel/views.py:2109
msgid "The tag has been successfully created."
msgstr "L'étiquette a été créée avec succès."
#: agenda_culturel/views.py:2163
#: agenda_culturel/views.py:2173
msgid "You have not modified the tag name."
msgstr "Vous n'avez pas modifié le nom de l'étiquette."
#: agenda_culturel/views.py:2173
#: agenda_culturel/views.py:2183
msgid ""
"This tag {} is already in use, and is described by different information "
"from the current tag. You can force renaming by checking the corresponding "
@ -1372,7 +1395,7 @@ msgstr ""
"sera supprimée, et tous les événements associés à l'étiquette {} seront "
"associés à l'étiquette {}."
#: agenda_culturel/views.py:2180
#: agenda_culturel/views.py:2190
msgid ""
"This tag {} is already in use. You can force renaming by checking the "
"corresponding option."
@ -1380,14 +1403,14 @@ msgstr ""
"Cette étiquette {} est déjà utilisée. Vous pouvez forcer le renommage en "
"cochant l'option correspondante."
#: agenda_culturel/views.py:2214
#: agenda_culturel/views.py:2224
msgid "The tag {} has been successfully renamed to {}."
msgstr "L'étiquette {} a été renommée avec succès en {}."
#: agenda_culturel/views.py:2252
#: agenda_culturel/views.py:2262
msgid "The tag {} has been successfully deleted."
msgstr "L'événement {} a été supprimé avec succès."
#: agenda_culturel/views.py:2273
#: agenda_culturel/views.py:2283
msgid "Cache successfully cleared."
msgstr "Le cache a été vidé avec succès."

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.9 on 2024-12-29 11:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda_culturel', '0130_recurrentimport_forcelocation'),
]
operations = [
migrations.AddField(
model_name='message',
name='message_type',
field=models.CharField(choices=[('from_contributor', 'From contributor'), ('import_process', 'Import process'), ('contact_form', 'Contact form'), ('event_report', 'Event report')], default=None, max_length=20, null=True, verbose_name='Type'),
),
]

View File

@ -1150,32 +1150,38 @@ class Event(models.Model):
def get_contributor_message(self):
msg = Message.objects.filter(related_event=self.pk, email__isnull=False, closed=False).first()
if msg is None and self.other_versions:
msg = Message.objects.filter(related_event__in=self.other_versions.get_duplicated(), email__isnull=False, closed=False).first()
return msg
if self.other_versions is None or self.other_versions.representative is None:
logger.warning("cas single")
return Message.objects.filter(related_event=self.pk, message_type=Message.TYPE.FROM_CONTRIBUTOR, closed=False)
else:
logger.warning("cas multiple")
return Message.objects.filter(related_event__in=self.other_versions.get_duplicated(), message_type=Message.TYPE.FROM_CONTRIBUTOR, closed=False).first()
def notify_if_required(self, request):
notif = False
if self.status != Event.STATUS.DRAFT:
message = self.get_contributor_message()
if message and not message.closed and message.email:
# send email
context = {"sitename": Site.objects.get_current(request).name, 'event_title': self.title }
if self.status == Event.STATUS.PUBLISHED:
context["url"] = request.build_absolute_uri(self.get_absolute_url())
subject = _('Your event has been published')
body = render_to_string("agenda_culturel/emails/published.txt", context)
else:
subject = _('Your message has not been retained')
body = render_to_string("agenda_culturel/emails/retained.txt", context)
messages = self.get_contributor_message()
logger.warning("messages: ")
logger.warning(messages)
for message in messages:
if message and not message.closed and message.email:
# send email
context = {"sitename": Site.objects.get_current(request).name, 'event_title': self.title }
if self.status == Event.STATUS.PUBLISHED:
context["url"] = request.build_absolute_uri(self.get_absolute_url())
subject = _('Your event has been published')
body = render_to_string("agenda_culturel/emails/published.txt", context)
else:
subject = _('Your message has not been retained')
body = render_to_string("agenda_culturel/emails/retained.txt", context)
send_mail(subject, body, None, [message.email])
message.closed = True
message.save()
return True
send_mail(subject, body, None, [message.email])
message.closed = True
message.save()
notif = True
return False
return notif
def save(self, *args, **kwargs):
@ -1323,7 +1329,11 @@ class Event(models.Model):
result = Event(**event_structure)
result.add_pending_organisers(organisers)
if email or comments:
result.set_message(Message(subject=_('during import process'), email=email, message=comments, closed=False))
result.set_message(Message(subject=_('during import process'),
email=email,
message=comments,
closed=False,
message_type=Message.TYPE.FROM_CONTRIBUTOR))
return result
@ -1661,7 +1671,10 @@ class Event(models.Model):
if e.is_event_long_duration():
e.status = Event.STATUS.DRAFT
e.set_message(
Message(subject=_('Import'), name=_('import process'), message=_("The duration of the event is a little too long for direct publication. Moderators can choose to publish it or not."))
Message(subject=_('Import'),
name=_('import process'),
message=_("The duration of the event is a little too long for direct publication. Moderators can choose to publish it or not."),
message_type=Message.TYPE.IMPORT_PROCESS)
)
# then import all the new events
@ -1858,6 +1871,13 @@ class Event(models.Model):
class Message(models.Model):
class TYPE(models.TextChoices):
FROM_CONTRIBUTOR = "from_contributor", _("From contributor")
IMPORT_PROCESS = "import_process", _("Import process")
CONTACT_FORM = "contact_form", _("Contact form")
EVENT_REPORT = "event_report", _("Event report")
class Meta:
verbose_name = _("Message")
verbose_name_plural = _("Messages")
@ -1932,8 +1952,15 @@ class Message(models.Model):
null=True,
)
message_type = models.CharField(
verbose_name=_("Type"),
max_length=20,
choices=TYPE.choices,
default=None, null=True
)
def nb_open_messages():
return Message.objects.filter(Q(closed=False)&Q(spam=False)).count()
return Message.objects.filter(Q(closed=False)&Q(spam=False)&Q(message_type__in=[Message.TYPE.CONTACT_FORM, Message.TYPE.EVENT_REPORT])).count()
def get_absolute_url(self):
return reverse("message", kwargs={"pk": self.pk})

View File

@ -614,7 +614,7 @@ header .remarque {
}
.form.recent, .form.main-filter, .search .form {
#id_status>div {
#id_status>div, #id_representative>div {
display: inline-block;
margin-right: 2em;
}
@ -1494,19 +1494,27 @@ img.preview {
}
}
form.messages div, form.moderation-events {
@media only screen and (min-width: 992px) {
form.messages {
div {
width: 100%;
display: block;
fieldset div {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
margin-right: 1em;
}
}
@media only screen and (min-width: 800px) {
display: grid;
grid-template-columns: repeat(2, 50%);
}
fieldset {
float: left;
margin-right: 1em;
}
label {
clear: both;
float: left;
grid-template-columns: repeat(3, 1fr);
:last-child {
grid-column: 1 / 4;
}
div fieldset div {
display: block;
}
}
}
.moderate-preview .event-body {

View File

@ -34,6 +34,7 @@
<thead>
<tr>
<th>Date</th>
<th>Type</th>
<th>Sujet</th>
<th>Auteur</th>
<th>Événement</th>
@ -45,6 +46,7 @@
{% for obj in paginator_filter %}
<tr>
<td>{{ obj.date }}</td>
<td>{% if obj.message_type %}{{ obj.get_message_type_display }}{% else %}-{% endif %}</td>
<td><a href="{% url 'message' obj.pk %}">{{ obj.subject }}</a></td>
<td>{% if obj.user %}<em>{{ obj.user }}</em>{% else %}{% if obj.name %}{{ obj.name }}{% else %}-{% endif %}{% endif %}</td>
<td>{% if obj.related_event %}<a href="{{ obj.related_event.get_absolute_url }}">{{ obj.related_event.pk }}</a>{% else %}-{% endif %}</td>

View File

@ -47,7 +47,7 @@
<div class="entree">
<div><span class="ts">{{ step.timestamp }}</span></div>
<div>
<header><strong>Message</strong>{% if step.data.related_event and event != step.data.related_event %} sur
<header><strong>Message{% if not step.data.closed %} (ouvert){% endif %}</strong>{% if step.data.related_event and event != step.data.related_event %} sur
<a href="{{ step.data.related_event.get_absolute_url }}">une autre</a> version{% endif %}&nbsp;:
<a href="{{ step.data.get_absolute_url }}">{{ step.data.subject|truncatechars:20 }}</a>
{% if step.data.user %} par <em>{{ step.data.user }}</em>{% else %} par {% if step.data.name %}{{ step.data.name }}{% if step.data.email %} (<a href="mailto: {{ step.data.email }}">{{ step.data.email }}</a>){% endif %}{% else %} <a href="mailto: {{ step.data.email }}">{{ step.data.email }}</a>{% endif %}{% endif %}</header>

View File

@ -18,7 +18,7 @@ def show_badge_messages(placement="top"):
return mark_safe(
'<a href="'
+ reverse_lazy("messages")
+ '?closed=False" class="badge" data-placement="'
+ '?closed=False&message_type=contact_form&message_type=event_report" class="badge" data-placement="'
+ placement
+ '" data-tooltip="'
+ str(nb_open)

View File

@ -599,7 +599,11 @@ class EventCreateView(SuccessMessageMixin, CreateView):
if form.cleaned_data.get("email") or form.cleaned_data.get("comments"):
form.instance.set_message(
Message(subject=_('during the creation process'), message=form.cleaned_data["comments"], email=form.cleaned_data["email"]), closed=False)
Message(subject=_('during the creation process'),
message=form.cleaned_data["comments"],
email=form.cleaned_data["email"]),
closed=False,
message_type=Message.TYPE.FROM_CONTRIBUTOR)
form.instance.import_sources = None
form.instance.set_processing_user(self.request.user)
@ -851,7 +855,9 @@ class MessageCreateView(SuccessMessageMixin, CreateView):
return kwargs
def form_valid(self, form):
form.instance.user = self.request.user
if self.request.user.is_authenticated:
form.instance.user = self.request.user
form.instance.message_type = Message.TYPE.EVENT_REPORT if "pk" in self.kwargs else Message.TYPE.CONTACT_FORM
return super().form_valid(form)