From 98517da4744bb542a70ef913f91a8fee840d6c3b Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Thu, 7 Nov 2024 22:56:53 +0100 Subject: [PATCH] =?UTF-8?q?Simplification=20de=20la=20description=20des=20?= =?UTF-8?q?=C3=A9l=C3=A9ments=20s=C3=A9lectionn=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../locale/fr/LC_MESSAGES/django.po | 432 +++++++++--------- .../0102_duplicatedevents_representative.py | 19 + ...3_update_duplicatedevents_datastructure.py | 59 +++ .../0104_remove_duplicatedevents_fixed.py | 17 + src/agenda_culturel/models.py | 41 +- .../agenda_culturel/duplicate-inc.html | 4 +- .../templates/agenda_culturel/duplicate.html | 4 +- .../templates/agenda_culturel/duplicates.html | 5 +- .../agenda_culturel/fix_duplicate.html | 4 +- .../templates/agenda_culturel/page-event.html | 2 +- .../single-event/event-single-inc.html | 2 +- .../templatetags/duplicated_extra.py | 5 +- src/agenda_culturel/views.py | 5 +- 13 files changed, 340 insertions(+), 259 deletions(-) create mode 100644 src/agenda_culturel/migrations/0102_duplicatedevents_representative.py create mode 100644 src/agenda_culturel/migrations/0103_update_duplicatedevents_datastructure.py create mode 100644 src/agenda_culturel/migrations/0104_remove_duplicatedevents_fixed.py diff --git a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po index fe04c53..8f531c0 100644 --- a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po +++ b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: agenda_culturel\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-02 12:32+0100\n" +"POT-Creation-Date: 2024-11-07 22:56+0100\n" "PO-Revision-Date: 2023-10-29 14:16+0000\n" "Last-Translator: Jean-Marie Favreau \n" "Language-Team: Jean-Marie Favreau \n" @@ -91,8 +91,8 @@ msgid "Evening" msgstr "Soir" #: agenda_culturel/forms.py:44 agenda_culturel/models.py:165 -#: agenda_culturel/models.py:191 agenda_culturel/models.py:431 -#: agenda_culturel/models.py:1491 agenda_culturel/models.py:1596 +#: agenda_culturel/models.py:191 agenda_culturel/models.py:417 +#: agenda_culturel/models.py:1494 agenda_culturel/models.py:1599 msgid "Category" msgstr "Catégorie" @@ -117,8 +117,8 @@ msgstr "JSON dans le format attendu pour l'import" msgid "Apply category {} to the event {}" msgstr "Appliquer la catégorie {} à l'événement {}" -#: agenda_culturel/forms.py:421 agenda_culturel/models.py:355 -#: agenda_culturel/models.py:1648 +#: agenda_culturel/forms.py:421 agenda_culturel/models.py:341 +#: agenda_culturel/models.py:1651 msgid "Place" msgstr "Lieu" @@ -137,9 +137,9 @@ msgstr "" "événements correspondants dont la place est manquante." #: agenda_culturel/models.py:49 agenda_culturel/models.py:94 -#: agenda_culturel/models.py:172 agenda_culturel/models.py:317 -#: agenda_culturel/models.py:334 agenda_culturel/models.py:1363 -#: agenda_culturel/models.py:1437 +#: agenda_culturel/models.py:172 agenda_culturel/models.py:303 +#: agenda_culturel/models.py:320 agenda_culturel/models.py:1366 +#: agenda_culturel/models.py:1440 msgid "Name" msgstr "Nom" @@ -199,7 +199,7 @@ msgstr "Catégories" msgid "Tag name" msgstr "Nom de l'étiquette" -#: agenda_culturel/models.py:177 agenda_culturel/models.py:484 +#: agenda_culturel/models.py:177 agenda_culturel/models.py:470 msgid "Description" msgstr "Description" @@ -222,70 +222,66 @@ msgstr "" #: agenda_culturel/models.py:192 msgid "This tags corresponds to a sub-category of the given category" msgstr "" -"Cette étiquette correspond à une sous-catégorie de la catégorie " -"donnée." +"Cette étiquette correspond à une sous-catégorie de la catégorie donnée." -#: agenda_culturel/models.py:205 -msgid "Fixed" -msgstr "Résolu" +#: agenda_culturel/models.py:208 +msgid "Representative event" +msgstr "Événement représentatif" -#: agenda_culturel/models.py:206 -msgid "" -"This duplicated events is fixed, ie exactly one of the listed events is not " -"masked." +#: agenda_culturel/models.py:209 +msgid "This event is the representative event of the duplicated events group" msgstr "" -"Cet événement dupliqué est résolu, c'est-à-dire qu'exactement un seul des " -"événements listés n'est pas masqué." +"Cet événement est l'événement représentatif du groupe d'événements dupliqués." -#: agenda_culturel/models.py:213 agenda_culturel/models.py:214 +#: agenda_culturel/models.py:216 agenda_culturel/models.py:217 msgid "Duplicated events" msgstr "Événements dupliqués" -#: agenda_culturel/models.py:317 +#: agenda_culturel/models.py:303 msgid "Name of the location" msgstr "Nom de la position" -#: agenda_culturel/models.py:320 +#: agenda_culturel/models.py:306 msgid "Main" msgstr "Principale" -#: agenda_culturel/models.py:321 +#: agenda_culturel/models.py:307 msgid "This location is one of the main locations (shown first)." msgstr "Cette position est une position principale (affichée en premier)." -#: agenda_culturel/models.py:326 +#: agenda_culturel/models.py:312 msgid "Reference location" msgstr "Position de référence" -#: agenda_culturel/models.py:327 +#: agenda_culturel/models.py:313 msgid "Reference locations" msgstr "Positions de référence" -#: agenda_culturel/models.py:334 +#: agenda_culturel/models.py:320 msgid "Name of the place" msgstr "Nom du lieu" -#: agenda_culturel/models.py:336 +#: agenda_culturel/models.py:322 msgid "Address" msgstr "Adresse" -#: agenda_culturel/models.py:337 +#: agenda_culturel/models.py:323 msgid "Address of this place (without city name)" msgstr "Adresse de ce lieu (sans le nom de la ville)" -#: agenda_culturel/models.py:341 +#: agenda_culturel/models.py:327 msgid "City" msgstr "Ville" -#: agenda_culturel/models.py:341 +#: agenda_culturel/models.py:327 msgid "City name" msgstr "Nom de la ville" -#: agenda_culturel/models.py:346 +#: agenda_culturel/models.py:332 msgid "Alternative names" msgstr "Noms alternatifs" -#: agenda_culturel/models.py:348 +#: agenda_culturel/models.py:334 msgid "" "Alternative names or addresses used to match a place with the free-form " "location of an event." @@ -293,77 +289,77 @@ msgstr "" "Noms et adresses alternatives qui seront utilisées pour associer une adresse " "avec la localisation en forme libre d'un événement" -#: agenda_culturel/models.py:356 +#: agenda_culturel/models.py:342 msgid "Places" msgstr "Lieux" -#: agenda_culturel/models.py:409 agenda_culturel/models.py:1478 +#: agenda_culturel/models.py:395 agenda_culturel/models.py:1481 msgid "Published" msgstr "Publié" -#: agenda_culturel/models.py:410 +#: agenda_culturel/models.py:396 msgid "Draft" msgstr "Brouillon" -#: agenda_culturel/models.py:411 +#: agenda_culturel/models.py:397 msgid "Trash" msgstr "Corbeille" -#: agenda_culturel/models.py:422 +#: agenda_culturel/models.py:408 msgid "Title" msgstr "Titre" -#: agenda_culturel/models.py:422 +#: agenda_culturel/models.py:408 msgid "Short title" msgstr "Titre court" -#: agenda_culturel/models.py:426 agenda_culturel/models.py:1564 +#: agenda_culturel/models.py:412 agenda_culturel/models.py:1567 msgid "Status" msgstr "Status" -#: agenda_culturel/models.py:432 +#: agenda_culturel/models.py:418 msgid "Category of the event" msgstr "Catégorie de l'événement" -#: agenda_culturel/models.py:439 +#: agenda_culturel/models.py:425 msgid "Day of the event" msgstr "Date de l'événement" -#: agenda_culturel/models.py:442 agenda_culturel/models.py:443 +#: agenda_culturel/models.py:428 agenda_culturel/models.py:429 msgid "Starting time" msgstr "Heure de début" -#: agenda_culturel/models.py:449 +#: agenda_culturel/models.py:435 msgid "End day of the event" msgstr "Fin de l'événement" -#: agenda_culturel/models.py:451 +#: agenda_culturel/models.py:437 msgid "End day of the event, only required if different from the start day." msgstr "" "Date de fin de l'événement, uniquement nécessaire s'il est différent du " "premier jour de l'événement" -#: agenda_culturel/models.py:457 +#: agenda_culturel/models.py:443 msgid "Final time" msgstr "Heure de fin" -#: agenda_culturel/models.py:461 +#: agenda_culturel/models.py:447 msgid "Recurrence" msgstr "Récurrence" -#: agenda_culturel/models.py:466 agenda_culturel/models.py:1483 +#: agenda_culturel/models.py:452 agenda_culturel/models.py:1486 msgid "Location" msgstr "Localisation" -#: agenda_culturel/models.py:467 +#: agenda_culturel/models.py:453 msgid "Address of the event" msgstr "Adresse de l'événement" -#: agenda_culturel/models.py:473 +#: agenda_culturel/models.py:459 msgid "Location (free form)" msgstr "Localisation (forme libre)" -#: agenda_culturel/models.py:475 +#: agenda_culturel/models.py:461 msgid "" "Address of the event in case its not available in the already known places " "(free form)" @@ -371,219 +367,219 @@ msgstr "" "Addresse d'un événement si elle n'est pas déjà présente dans la liste des " "lieux disponible (forme libre)" -#: agenda_culturel/models.py:485 +#: agenda_culturel/models.py:471 msgid "General description of the event" msgstr "Description générale de l'événement" -#: agenda_culturel/models.py:491 +#: agenda_culturel/models.py:477 msgid "Illustration (local image)" msgstr "Illustration (image locale)" -#: agenda_culturel/models.py:492 +#: agenda_culturel/models.py:478 msgid "Illustration image stored in the agenda server" msgstr "Image d'illustration stockée sur le serveur de l'agenda" -#: agenda_culturel/models.py:499 +#: agenda_culturel/models.py:485 msgid "Illustration" msgstr "Illustration" -#: agenda_culturel/models.py:500 +#: agenda_culturel/models.py:486 msgid "URL of the illustration image" msgstr "URL de l'image illustrative" -#: agenda_culturel/models.py:506 +#: agenda_culturel/models.py:492 msgid "Illustration description" msgstr "Description de l'illustration" -#: agenda_culturel/models.py:507 +#: agenda_culturel/models.py:493 msgid "Alternative text used by screen readers for the image" msgstr "Texte alternatif utiliser par les lecteurs d'écrans pour l'image" -#: agenda_culturel/models.py:514 +#: agenda_culturel/models.py:500 msgid "Masked" msgstr "Masqué" -#: agenda_culturel/models.py:515 +#: agenda_culturel/models.py:501 msgid "This event is masked by a duplicated version." msgstr "L'événement est masqué par une version dupliquée." -#: agenda_culturel/models.py:523 +#: agenda_culturel/models.py:509 msgid "Importation source" msgstr "Source d'importation" -#: agenda_culturel/models.py:524 +#: agenda_culturel/models.py:510 msgid "Importation source used to detect removed entries." msgstr "Source d'importation utilisée pour détecter les éléments supprimés/" -#: agenda_culturel/models.py:530 +#: agenda_culturel/models.py:516 msgid "UUIDs" msgstr "UUIDs" -#: agenda_culturel/models.py:531 +#: agenda_culturel/models.py:517 msgid "UUIDs from import to detect duplicated entries." msgstr "UUIDs utilisés pendant l'import pour détecter les entrées dupliquées" -#: agenda_culturel/models.py:537 +#: agenda_culturel/models.py:523 msgid "URLs" msgstr "URLs" -#: agenda_culturel/models.py:538 +#: agenda_culturel/models.py:524 msgid "List of all the urls where this event can be found." msgstr "Liste de toutes les urls où l'événement peut être trouvé." -#: agenda_culturel/models.py:545 +#: agenda_culturel/models.py:531 msgid "Tags" msgstr "Étiquettes" -#: agenda_culturel/models.py:546 +#: agenda_culturel/models.py:532 msgid "A list of tags that describe the event." msgstr "Une liste d'étiquettes décrivant l'événement" -#: agenda_culturel/models.py:553 +#: agenda_culturel/models.py:539 msgid "Possibly duplicated" msgstr "Possibles doublons" -#: agenda_culturel/models.py:618 +#: agenda_culturel/models.py:604 msgid "Event" msgstr "Événement" -#: agenda_culturel/models.py:619 +#: agenda_culturel/models.py:605 msgid "Events" msgstr "Événements" -#: agenda_culturel/models.py:1354 +#: agenda_culturel/models.py:1357 msgid "Contact message" msgstr "Message de contact" -#: agenda_culturel/models.py:1355 +#: agenda_culturel/models.py:1358 msgid "Contact messages" msgstr "Messages de contact" -#: agenda_culturel/models.py:1358 +#: agenda_culturel/models.py:1361 msgid "Subject" msgstr "Sujet" -#: agenda_culturel/models.py:1359 +#: agenda_culturel/models.py:1362 msgid "The subject of your message" msgstr "Sujet de votre message" -#: agenda_culturel/models.py:1364 +#: agenda_culturel/models.py:1367 msgid "Your name" msgstr "Votre nom" -#: agenda_culturel/models.py:1370 +#: agenda_culturel/models.py:1373 msgid "Email address" msgstr "Adresse email" -#: agenda_culturel/models.py:1371 +#: agenda_culturel/models.py:1374 msgid "Your email address" msgstr "Votre adresse email" -#: agenda_culturel/models.py:1376 +#: agenda_culturel/models.py:1379 msgid "Message" msgstr "Message" -#: agenda_culturel/models.py:1376 +#: agenda_culturel/models.py:1379 msgid "Your message" msgstr "Votre message" -#: agenda_culturel/models.py:1381 agenda_culturel/views.py:951 +#: agenda_culturel/models.py:1384 agenda_culturel/views.py:952 msgid "Spam" msgstr "Spam" -#: agenda_culturel/models.py:1382 +#: agenda_culturel/models.py:1385 msgid "This message is a spam." msgstr "Ce message est un spam." -#: agenda_culturel/models.py:1387 agenda_culturel/views.py:946 +#: agenda_culturel/models.py:1390 agenda_culturel/views.py:947 msgid "Closed" msgstr "Fermé" -#: agenda_culturel/models.py:1389 +#: agenda_culturel/models.py:1392 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:1394 +#: agenda_culturel/models.py:1397 msgid "Comments" msgstr "Commentaires" -#: agenda_culturel/models.py:1395 +#: agenda_culturel/models.py:1398 msgid "Comments on the message from the moderation team" msgstr "Commentaires sur ce message par l'équipe de modération" -#: agenda_culturel/models.py:1407 agenda_culturel/models.py:1544 +#: agenda_culturel/models.py:1410 agenda_culturel/models.py:1547 msgid "Recurrent import" msgstr "Import récurrent" -#: agenda_culturel/models.py:1408 +#: agenda_culturel/models.py:1411 msgid "Recurrent imports" msgstr "Imports récurrents" -#: agenda_culturel/models.py:1412 +#: agenda_culturel/models.py:1415 msgid "ical" msgstr "ical" -#: agenda_culturel/models.py:1413 +#: agenda_culturel/models.py:1416 msgid "ical no busy" msgstr "ical sans busy" -#: agenda_culturel/models.py:1414 +#: agenda_culturel/models.py:1417 msgid "ical no VC" msgstr "ical sans VC" -#: agenda_culturel/models.py:1415 +#: agenda_culturel/models.py:1418 msgid "lacoope.org" msgstr "lacoope.org" -#: agenda_culturel/models.py:1416 +#: agenda_culturel/models.py:1419 msgid "la comédie" msgstr "la comédie" -#: agenda_culturel/models.py:1417 +#: agenda_culturel/models.py:1420 msgid "le fotomat" msgstr "le fotomat" -#: agenda_culturel/models.py:1418 +#: agenda_culturel/models.py:1421 msgid "la puce à l'oreille" msgstr "la puce à loreille" -#: agenda_culturel/models.py:1419 +#: agenda_culturel/models.py:1422 msgid "Plugin wordpress MEC" msgstr "Plugin wordpress MEC" -#: agenda_culturel/models.py:1420 +#: agenda_culturel/models.py:1423 msgid "Événements d'une page FB" msgstr "Événements d'une page FB" -#: agenda_culturel/models.py:1421 +#: agenda_culturel/models.py:1424 msgid "la cour des 3 coquins" msgstr "la cour des 3 coquins" -#: agenda_culturel/models.py:1422 +#: agenda_culturel/models.py:1425 msgid "Arachnée concert" msgstr "Arachnée concert" -#: agenda_culturel/models.py:1425 +#: agenda_culturel/models.py:1428 msgid "simple" msgstr "simple" -#: agenda_culturel/models.py:1426 +#: agenda_culturel/models.py:1429 msgid "Headless Chromium" msgstr "chromium sans interface" -#: agenda_culturel/models.py:1427 +#: agenda_culturel/models.py:1430 msgid "Headless Chromium (pause)" msgstr "chromium sans interface (pause)" -#: agenda_culturel/models.py:1432 +#: agenda_culturel/models.py:1435 msgid "daily" msgstr "chaque jour" -#: agenda_culturel/models.py:1434 +#: agenda_culturel/models.py:1437 msgid "weekly" msgstr "chaque semaine" -#: agenda_culturel/models.py:1439 +#: agenda_culturel/models.py:1442 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." @@ -591,135 +587,135 @@ 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:1446 +#: agenda_culturel/models.py:1449 msgid "Processor" msgstr "Processeur" -#: agenda_culturel/models.py:1449 +#: agenda_culturel/models.py:1452 msgid "Downloader" msgstr "Téléchargeur" -#: agenda_culturel/models.py:1456 +#: agenda_culturel/models.py:1459 msgid "Import recurrence" msgstr "Récurrence d'import" -#: agenda_culturel/models.py:1463 +#: agenda_culturel/models.py:1466 msgid "Source" msgstr "Source" -#: agenda_culturel/models.py:1464 +#: agenda_culturel/models.py:1467 msgid "URL of the source document" msgstr "URL du document source" -#: agenda_culturel/models.py:1468 +#: agenda_culturel/models.py:1471 msgid "Browsable url" msgstr "URL navigable" -#: agenda_culturel/models.py:1470 +#: agenda_culturel/models.py:1473 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:1479 +#: agenda_culturel/models.py:1482 msgid "Status of each imported event (published or draft)" msgstr "Status de chaque événement importé (publié ou brouillon)" -#: agenda_culturel/models.py:1484 +#: agenda_culturel/models.py:1487 msgid "Address for each imported event" msgstr "Adresse de chaque événement importé" -#: agenda_culturel/models.py:1492 +#: agenda_culturel/models.py:1495 msgid "Category of each imported event" msgstr "Catégorie de chaque événement importé" -#: agenda_culturel/models.py:1500 +#: agenda_culturel/models.py:1503 msgid "Tags for each imported event" msgstr "Étiquettes de chaque événement importé" -#: agenda_culturel/models.py:1501 +#: agenda_culturel/models.py:1504 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:1530 +#: agenda_culturel/models.py:1533 msgid "Running" msgstr "En cours" -#: agenda_culturel/models.py:1531 +#: agenda_culturel/models.py:1534 msgid "Canceled" msgstr "Annulé" -#: agenda_culturel/models.py:1532 +#: agenda_culturel/models.py:1535 msgid "Success" msgstr "Succès" -#: agenda_culturel/models.py:1533 +#: agenda_culturel/models.py:1536 msgid "Failed" msgstr "Erreur" -#: agenda_culturel/models.py:1536 +#: agenda_culturel/models.py:1539 msgid "Batch importation" msgstr "Importation par lot" -#: agenda_culturel/models.py:1537 +#: agenda_culturel/models.py:1540 msgid "Batch importations" msgstr "Importations par lot" -#: agenda_culturel/models.py:1545 +#: agenda_culturel/models.py:1548 msgid "Reference to the recurrent import processing" msgstr "Référence du processus d'import récurrent" -#: agenda_culturel/models.py:1553 +#: agenda_culturel/models.py:1556 msgid "URL (if not recurrent import)" msgstr "URL (si pas d'import récurrent)" -#: agenda_culturel/models.py:1555 +#: agenda_culturel/models.py:1558 msgid "Source URL if no RecurrentImport is associated." msgstr "URL source si aucun import récurrent n'est associé" -#: agenda_culturel/models.py:1568 +#: agenda_culturel/models.py:1571 msgid "Error message" msgstr "Votre message" -#: agenda_culturel/models.py:1572 +#: agenda_culturel/models.py:1575 msgid "Number of collected events" msgstr "Nombre d'événements collectés" -#: agenda_culturel/models.py:1575 +#: agenda_culturel/models.py:1578 msgid "Number of imported events" msgstr "Nombre d'événements importés" -#: agenda_culturel/models.py:1578 +#: agenda_culturel/models.py:1581 msgid "Number of updated events" msgstr "Nombre d'événements mis à jour" -#: agenda_culturel/models.py:1581 +#: agenda_culturel/models.py:1584 msgid "Number of removed events" msgstr "Nombre d'événements supprimés" -#: agenda_culturel/models.py:1589 +#: agenda_culturel/models.py:1592 msgid "Weight" msgstr "Poids" -#: agenda_culturel/models.py:1590 +#: agenda_culturel/models.py:1593 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:1597 +#: agenda_culturel/models.py:1600 msgid "Category applied to the event" msgstr "Catégorie appliquée à l'événement" -#: agenda_culturel/models.py:1602 +#: agenda_culturel/models.py:1605 msgid "Contained in the title" msgstr "Contenu dans le titre" -#: agenda_culturel/models.py:1603 +#: agenda_culturel/models.py:1606 msgid "Text contained in the event title" msgstr "Texte contenu dans le titre de l'événement" -#: agenda_culturel/models.py:1609 +#: agenda_culturel/models.py:1612 msgid "Exact title extract" msgstr "Extrait exact du titre" -#: agenda_culturel/models.py:1611 +#: agenda_culturel/models.py:1614 msgid "" "If checked, the extract will be searched for in the title using the exact " "form (capitals, accents)." @@ -727,19 +723,19 @@ msgstr "" "Si coché, l'extrait sera recherché dans le titre en utilisant la forme " "exacte (majuscules, accents)" -#: agenda_culturel/models.py:1617 +#: agenda_culturel/models.py:1620 msgid "Contained in the description" msgstr "Contenu dans la description" -#: agenda_culturel/models.py:1618 +#: agenda_culturel/models.py:1621 msgid "Text contained in the description" msgstr "Texte contenu dans la description" -#: agenda_culturel/models.py:1624 +#: agenda_culturel/models.py:1627 msgid "Exact description extract" msgstr "Extrait exact de description" -#: agenda_culturel/models.py:1626 +#: agenda_culturel/models.py:1629 msgid "" "If checked, the extract will be searched for in the description using the " "exact form (capitals, accents)." @@ -747,19 +743,19 @@ msgstr "" "Si coché, l'extrait sera recherché dans la description en utilisant la forme " "exacte (majuscules, accents)" -#: agenda_culturel/models.py:1632 +#: agenda_culturel/models.py:1635 msgid "Contained in the location" msgstr "Contenu dans la localisation" -#: agenda_culturel/models.py:1633 +#: agenda_culturel/models.py:1636 msgid "Text contained in the event location" msgstr "Texte contenu dans la localisation de l'événement" -#: agenda_culturel/models.py:1639 +#: agenda_culturel/models.py:1642 msgid "Exact location extract" msgstr "Extrait exact de localisation" -#: agenda_culturel/models.py:1641 +#: agenda_culturel/models.py:1644 msgid "" "If checked, the extract will be searched for in the location using the exact " "form (capitals, accents)." @@ -767,56 +763,56 @@ msgstr "" "Si coché, l'extrait sera recherché dans la localisation en utilisant la " "forme exacte (majuscules, accents)" -#: agenda_culturel/models.py:1649 +#: agenda_culturel/models.py:1652 msgid "Location from place" msgstr "Localisation depuis le lieu" -#: agenda_culturel/models.py:1658 +#: agenda_culturel/models.py:1661 msgid "Categorisation rule" msgstr "Règle de catégorisation" -#: agenda_culturel/models.py:1659 +#: agenda_culturel/models.py:1662 msgid "Categorisation rules" msgstr "Règles de catégorisation" -#: agenda_culturel/models.py:1730 agenda_culturel/models.py:1762 +#: agenda_culturel/models.py:1733 agenda_culturel/models.py:1765 msgid "Question" msgstr "Question" -#: agenda_culturel/models.py:1731 agenda_culturel/models.py:1769 +#: agenda_culturel/models.py:1734 agenda_culturel/models.py:1772 msgid "Text that will be shown to moderators" msgstr "Text tel que présenté aux modérateurices" -#: agenda_culturel/models.py:1737 +#: agenda_culturel/models.py:1740 msgid "Moderation question" msgstr "Question de modération" -#: agenda_culturel/models.py:1738 +#: agenda_culturel/models.py:1741 msgid "Moderation questions" msgstr "Questions de modération" -#: agenda_culturel/models.py:1763 +#: agenda_culturel/models.py:1766 msgid "Associated question from moderation" msgstr "Question associée pour la modération" -#: agenda_culturel/models.py:1768 +#: agenda_culturel/models.py:1771 msgid "Answer" msgstr "Réponse" -#: agenda_culturel/models.py:1775 +#: agenda_culturel/models.py:1778 msgid "Adds tags" msgstr "Ajoute les étiquettes" -#: agenda_culturel/models.py:1776 +#: agenda_culturel/models.py:1779 msgid "A list of tags that will be added if you choose this answer." msgstr "" "Une liste d'étiquettes qui seront ajoutées si vous choisissez cette réponse." -#: agenda_culturel/models.py:1782 +#: agenda_culturel/models.py:1785 msgid "Removes tags" msgstr "Retire les étiquettes" -#: agenda_culturel/models.py:1783 +#: agenda_culturel/models.py:1786 msgid "A list of tags that will be removed if you choose this answer." msgstr "" "Une liste d'étiquettes qui seront retirées si vous choisissez cette réponse." @@ -845,11 +841,11 @@ msgstr "Naviguer..." msgid "No file selected." msgstr "Pas de fichier sélectionné." -#: agenda_culturel/views.py:540 +#: agenda_culturel/views.py:541 msgid "The static content has been successfully updated." msgstr "Le contenu statique a été modifié avec succès." -#: agenda_culturel/views.py:548 +#: agenda_culturel/views.py:549 msgid "" "The event cannot be updated because the import process is not available for " "the referenced sources." @@ -857,17 +853,17 @@ msgstr "" "La mise à jour de l'événement n'est pas possible car le processus d'import " "n'est pas disponible pour les sources référencées." -#: agenda_culturel/views.py:551 +#: agenda_culturel/views.py:552 msgid "The event update has been queued and will be completed shortly." msgstr "" "La mise à jour de l'événement a été mise en attente et sera effectuée sous " "peu." -#: agenda_culturel/views.py:561 agenda_culturel/views.py:609 +#: agenda_culturel/views.py:562 agenda_culturel/views.py:610 msgid "The event has been successfully modified." msgstr "L'événement a été modifié avec succès." -#: agenda_culturel/views.py:566 +#: agenda_culturel/views.py:567 msgid "" "Please note that this event has not been modified since it was last updated " "by import. If you modify any information from this import, the event will be " @@ -879,19 +875,19 @@ msgstr "" "l'événement sera désynchronisé d'avec la source, et nécessitera une fusion à " "chaque import automatique futurs." -#: agenda_culturel/views.py:578 +#: agenda_culturel/views.py:579 msgid "The event has been successfully deleted." msgstr "L'événement a été supprimé avec succès" -#: agenda_culturel/views.py:634 +#: agenda_culturel/views.py:635 msgid "The status has been successfully modified." msgstr "Le status a été modifié avec succès." -#: agenda_culturel/views.py:665 +#: agenda_culturel/views.py:666 msgid "The event was created: {}." msgstr "L'événement a été créé: {}." -#: agenda_culturel/views.py:667 agenda_culturel/views.py:682 +#: agenda_culturel/views.py:668 agenda_culturel/views.py:683 msgid "" "The event has been submitted and will be published as soon as it has been " "validated by the moderation team." @@ -899,110 +895,110 @@ 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:676 +#: agenda_culturel/views.py:677 msgid "The event is saved." msgstr "L'événement est enregistré." -#: agenda_culturel/views.py:768 agenda_culturel/views.py:820 +#: agenda_culturel/views.py:769 agenda_culturel/views.py:821 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:773 agenda_culturel/views.py:826 +#: agenda_culturel/views.py:774 agenda_culturel/views.py:827 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:783 +#: agenda_culturel/views.py:784 msgid "Integrating {} url(s) into our import process." msgstr "Intégration de {} url(s) dans notre processus d'import." -#: agenda_culturel/views.py:833 +#: agenda_culturel/views.py:834 msgid "Integrating {} into our import process." msgstr "Intégration de {} dans notre processus d'import." -#: agenda_culturel/views.py:906 +#: agenda_culturel/views.py:907 msgid "Your message has been sent successfully." msgstr "Votre message a été envoyé avec succès." -#: agenda_culturel/views.py:916 +#: agenda_culturel/views.py:917 msgid "The contact message has been successfully deleted." msgstr "Le message de contact a été supprimé avec succès." -#: agenda_culturel/views.py:930 +#: agenda_culturel/views.py:931 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:946 +#: agenda_culturel/views.py:947 msgid "Open" msgstr "Ouvert" -#: agenda_culturel/views.py:951 +#: agenda_culturel/views.py:952 msgid "Non spam" msgstr "Non spam" -#: agenda_culturel/views.py:1014 +#: agenda_culturel/views.py:1015 msgid "Spam has been successfully deleted." msgstr "Le spam a été supprimé avec succès" -#: agenda_culturel/views.py:1031 +#: agenda_culturel/views.py:1032 msgid "Search" msgstr "Rechercher" -#: agenda_culturel/views.py:1217 +#: agenda_culturel/views.py:1218 msgid "The import has been run successfully." msgstr "L'import a été lancé avec succès" -#: agenda_culturel/views.py:1236 +#: agenda_culturel/views.py:1237 msgid "The import has been canceled." msgstr "L'import a été annulé" -#: agenda_culturel/views.py:1310 +#: agenda_culturel/views.py:1311 msgid "The recurrent import has been successfully modified." msgstr "L'import récurrent a été modifié avec succès." -#: agenda_culturel/views.py:1319 +#: agenda_culturel/views.py:1320 msgid "The recurrent import has been successfully deleted." msgstr "L'import récurrent a été supprimé avec succès" -#: agenda_culturel/views.py:1359 +#: agenda_culturel/views.py:1360 msgid "The import has been launched." msgstr "L'import a été lancé" -#: agenda_culturel/views.py:1381 +#: agenda_culturel/views.py:1382 msgid "Imports has been launched." msgstr "Les imports ont été lancés" -#: agenda_culturel/views.py:1467 +#: agenda_culturel/views.py:1471 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:1504 +#: agenda_culturel/views.py:1508 msgid "Events have been marked as unduplicated." msgstr "Les événements ont été marqués comme non dupliqués." -#: agenda_culturel/views.py:1520 +#: agenda_culturel/views.py:1524 msgid "The selected event has been retained, while the other has been masked." msgstr "L'événement sélectionné a été retenu, l'autre a été masqué." -#: agenda_culturel/views.py:1527 +#: agenda_culturel/views.py:1531 msgid "" "The selected event has been retained, while the others havec been masked." msgstr "L'événement sélectionné a été retenu, les autres ont été masqués." -#: agenda_culturel/views.py:1540 +#: 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:1573 +#: agenda_culturel/views.py:1577 msgid "Cleaning up duplicates: {} item(s) fixed." msgstr "Nettoyage des dupliqués: {} élément(s) corrigé(s)." -#: agenda_culturel/views.py:1620 +#: agenda_culturel/views.py:1624 msgid "The event was successfully duplicated." msgstr "L'événement a été marqué dupliqué avec succès." -#: agenda_culturel/views.py:1628 +#: agenda_culturel/views.py:1632 msgid "" "The event has been successfully flagged as a duplicate. The moderation team " "will deal with your suggestion shortly." @@ -1010,32 +1006,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:1681 +#: agenda_culturel/views.py:1685 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:1690 +#: agenda_culturel/views.py:1694 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:1712 +#: agenda_culturel/views.py:1716 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:1719 +#: agenda_culturel/views.py:1723 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:1726 agenda_culturel/views.py:1779 +#: agenda_culturel/views.py:1730 agenda_culturel/views.py:1783 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:1765 +#: agenda_culturel/views.py:1769 msgid "" "The rules were successfully applied and 1 event with default category was " "categorised." @@ -1043,7 +1039,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:1772 +#: agenda_culturel/views.py:1776 msgid "" "The rules were successfully applied and {} events with default category were " "categorised." @@ -1051,51 +1047,51 @@ 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:1819 +#: agenda_culturel/views.py:1823 msgid "The moderation question has been created with success." msgstr "La question de modération a été créée avec succès." -#: agenda_culturel/views.py:1945 agenda_culturel/views.py:2007 -#: agenda_culturel/views.py:2045 +#: agenda_culturel/views.py:1949 agenda_culturel/views.py:2011 +#: agenda_culturel/views.py:2049 msgid "{} events have been updated." msgstr "{} événements ont été mis à jour." -#: agenda_culturel/views.py:1948 agenda_culturel/views.py:2009 -#: agenda_culturel/views.py:2048 +#: agenda_culturel/views.py:1952 agenda_culturel/views.py:2013 +#: agenda_culturel/views.py:2052 msgid "1 event has been updated." msgstr "1 événement a été mis à jour" -#: agenda_culturel/views.py:1950 agenda_culturel/views.py:2011 -#: agenda_culturel/views.py:2050 +#: agenda_culturel/views.py:1954 agenda_culturel/views.py:2015 +#: agenda_culturel/views.py:2054 msgid "No events have been modified." msgstr "Aucun événement n'a été modifié." -#: agenda_culturel/views.py:1959 +#: agenda_culturel/views.py:1963 msgid "The place has been successfully updated." msgstr "Le lieu a été modifié avec succès." -#: agenda_culturel/views.py:1968 +#: agenda_culturel/views.py:1972 msgid "The place has been successfully created." msgstr "Le lieu a été créé avec succès." -#: agenda_culturel/views.py:2033 +#: agenda_culturel/views.py:2037 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:2037 +#: agenda_culturel/views.py:2041 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:2093 +#: agenda_culturel/views.py:2097 msgid "The tag has been successfully updated." msgstr "L'étiquette a été modifiée avec succès." -#: agenda_culturel/views.py:2100 +#: agenda_culturel/views.py:2104 msgid "The tag has been successfully created." msgstr "L'étiquette a été créée avec succès." -#~ msgid "Unknown" -#~ msgstr "Inconnue" +#~ msgid "Fixed" +#~ msgstr "Résolu" -#~ msgid "This" -#~ msgstr "Ce" +#~ msgid "Not fixed" +#~ msgstr "Non résolu" diff --git a/src/agenda_culturel/migrations/0102_duplicatedevents_representative.py b/src/agenda_culturel/migrations/0102_duplicatedevents_representative.py new file mode 100644 index 0000000..431ea45 --- /dev/null +++ b/src/agenda_culturel/migrations/0102_duplicatedevents_representative.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.9 on 2024-11-07 20:53 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('agenda_culturel', '0101_alter_tag_category'), + ] + + operations = [ + migrations.AddField( + model_name='duplicatedevents', + name='representative', + field=models.ForeignKey(default=None, help_text='This event is the representative event of the duplicated events group', null=True, on_delete=django.db.models.deletion.SET_DEFAULT, to='agenda_culturel.event', verbose_name='Representative event'), + ), + ] diff --git a/src/agenda_culturel/migrations/0103_update_duplicatedevents_datastructure.py b/src/agenda_culturel/migrations/0103_update_duplicatedevents_datastructure.py new file mode 100644 index 0000000..ee60421 --- /dev/null +++ b/src/agenda_culturel/migrations/0103_update_duplicatedevents_datastructure.py @@ -0,0 +1,59 @@ +# Generated by Django 4.2.9 on 2024-11-07 20:53 + +from django.db import migrations + +def set_representative_from_fixed_masked(apps, cats): + # get all duplicated events + DuplicatedEvents = apps.get_model("agenda_culturel", "DuplicatedEvents") + duplicated = DuplicatedEvents.objects.all().prefetch_related('event_set') + + to_update = [] + for d in duplicated: + # there is no representative + d.representative = None + # except if d is fixed + if d.fixed: + # and if there is at least one non masked (should be the case) + e_not_masked = [e for e in d.event_set.all() if not e.masked] + # keep the first one + if len(e_not_masked) >= 1: + d.representative = e_not_masked[0] + to_update.append(d) + + DuplicatedEvents.objects.bulk_update(to_update, fields=["representative"]) + +def set_fixed_masked_from_representative(apps, cats): + Event = apps.get_model("agenda_culturel", "Event") + events = Event.objects.all().prefetch_related("possibly_duplicated") + + to_update = [] + for e in events: + if not e.possibly_duplicated: + e.masked = False + else: + e.masked = e.possibly_duplicated.representative and e.possibly_duplicated.representative == e + to_update.append(e) + + Event.objects.bulk_update(to_update, fields=["masked"]) + + # get all duplicated events + DuplicatedEvents = apps.get_model("agenda_culturel", "DuplicatedEvents") + duplicated = DuplicatedEvents.objects.all().prefetch_related('event_set') + + # for each event + to_update = [] + for d in duplicated: + d.fixed = not d.representative is None + to_update.append(d) + + DuplicatedEvents.objects.bulk_update(to_update, fields=["fixed"]) + +class Migration(migrations.Migration): + + dependencies = [ + ('agenda_culturel', '0102_duplicatedevents_representative'), + ] + + operations = [ + migrations.RunPython(set_representative_from_fixed_masked, reverse_code=set_fixed_masked_from_representative), + ] diff --git a/src/agenda_culturel/migrations/0104_remove_duplicatedevents_fixed.py b/src/agenda_culturel/migrations/0104_remove_duplicatedevents_fixed.py new file mode 100644 index 0000000..8e4b6a1 --- /dev/null +++ b/src/agenda_culturel/migrations/0104_remove_duplicatedevents_fixed.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.9 on 2024-11-07 21:24 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('agenda_culturel', '0103_update_duplicatedevents_datastructure'), + ] + + operations = [ + migrations.RemoveField( + model_name='duplicatedevents', + name='fixed', + ), + ] diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 0612e7f..c279a7c 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -202,12 +202,14 @@ class Tag(models.Model): class DuplicatedEvents(models.Model): - fixed = models.BooleanField( - verbose_name=_("Fixed"), - help_text=_("This duplicated events is fixed, ie exactly one of the listed events is not masked."), - default=False, - blank=True, + + representative = models.ForeignKey( + "Event", + verbose_name=_("Representative event"), + help_text=_("This event is the representative event of the duplicated events group"), null=True, + default=None, + on_delete=models.SET_DEFAULT, ) class Meta: @@ -217,9 +219,6 @@ class DuplicatedEvents(models.Model): def nb_duplicated(self): return self.event_set.count() - def nb_duplicated_not_fixed(self): - return self.event_set.filter(possibly_duplicated=self, fixed=False).count() - def get_duplicated(self): return self.event_set.order_by( "created_date" @@ -238,7 +237,7 @@ class DuplicatedEvents(models.Model): e.possibly_duplicated = other # save them e.save() - other.save(force_fixed=False) + other.save() # then delete the empty group self.delete() @@ -283,13 +282,8 @@ class DuplicatedEvents(models.Model): def fix_similar_entries(): to_be_fixed = [] - dup_events = Event.objects.order_by('possibly_duplicated').prefetch_related('possibly_duplicated', 'category') - duplicates = defaultdict(list) - for e in dup_events: - duplicates[e.possibly_duplicated].append(e) - - for d in duplicates: - comp = Event.get_comparison(duplicates[d]) + for d in DuplicatedEvents.objects.filter(representative__isnull=True).prefetch_related('event_set'): + comp = Event.get_comparison(d.event_set.all()) similar = len([c for c in comp if not c["similar"]]) == 0 if similar: to_be_fixed.append(d) @@ -297,23 +291,14 @@ class DuplicatedEvents(models.Model): nb = len(to_be_fixed) if nb > 0: logger.warning("Removing: " + str(nb) + " similar duplicated") + for e in to_be_fixed: + logger.warning(" " + e.event_set.first().title) for s in to_be_fixed: s.fix() return nb - def save(self, *args, **kwargs): - if "force_fixed" in kwargs: - self.fixed = kwargs["force_fixed"] - del kwargs["force_fixed"] - elif not self.pk: - self.fixed = False - else: - self.fixed = self.event_set.filter(masked=False).count() == 1 - - super().save(*args, **kwargs) - class ReferenceLocation(models.Model): name = models.CharField(verbose_name=_("Name"), help_text=_("Name of the location"), unique=True, null=False) location = LocationField(based_fields=["name"], zoom=12, default=Point(3.08333, 45.783329), srid=4326) @@ -1047,7 +1032,7 @@ class Event(models.Model): else: # otherwise merge existing groups group = DuplicatedEvents.merge_groups(groups) - group.save(force_fixed=False) + group.save() # set the possibly duplicated group for the current object self.possibly_duplicated = group diff --git a/src/agenda_culturel/templates/agenda_culturel/duplicate-inc.html b/src/agenda_culturel/templates/agenda_culturel/duplicate-inc.html index c584bc2..0005343 100644 --- a/src/agenda_culturel/templates/agenda_culturel/duplicate-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/duplicate-inc.html @@ -5,7 +5,7 @@
- {% if duplicate.fixed %}Duplication{% else %}Possible duplication{% endif %} + {% if duplicate.representative %}Duplication{% else %}Possible duplication{% endif %}  : {{ events|length }} événements le {{ events.0.start_day }}
    @@ -18,7 +18,7 @@
    {% endif %} diff --git a/src/agenda_culturel/templates/agenda_culturel/duplicate.html b/src/agenda_culturel/templates/agenda_culturel/duplicate.html index cfceb96..e0236dd 100644 --- a/src/agenda_culturel/templates/agenda_culturel/duplicate.html +++ b/src/agenda_culturel/templates/agenda_culturel/duplicate.html @@ -14,8 +14,8 @@
    < Tous les dupliqués -

    {% block title %}{% block og_title %}Événements {% if not object.fixed %}possiblement{% endif %} dupliqués{% endblock %}{% endblock %}

    - {% if object.fixed %} +

    {% block title %}{% block og_title %}Événements {% if not object.representative %}possiblement{% endif %} dupliqués{% endblock %}{% endblock %}

    + {% if object.representative %}

    Les événements ci-dessous sont des duplicats du même événement, probablement issus de différentes sources. La version qui sera affichée aux internautes en priorité est la version {% for e in object.get_duplicated %}{% if not e.masked %}{{ forloop.counter0|int_to_abc }}{% endif %}{% endfor %}. diff --git a/src/agenda_culturel/templates/agenda_culturel/duplicates.html b/src/agenda_culturel/templates/agenda_culturel/duplicates.html index 0207046..bc211d4 100644 --- a/src/agenda_culturel/templates/agenda_culturel/duplicates.html +++ b/src/agenda_culturel/templates/agenda_culturel/duplicates.html @@ -25,7 +25,10 @@
    -

    {{ paginator.count }} événement{{ paginator.count|pluralize }} dupliqués {% if filter.form.fixed.value %}sont résolus{% else %}doivent être résolus{% endif %}.

    +

    {{ paginator.count }} événement{{ paginator.count|pluralize }} dupliqués{% if filter.form.fixed.value == None %}.{% else %} + {% if filter.form.fixed.value %}sont résolus. + {% else %}doivent être résolus.{% endif %} + {% endif %}

    diff --git a/src/agenda_culturel/templates/agenda_culturel/fix_duplicate.html b/src/agenda_culturel/templates/agenda_culturel/fix_duplicate.html index 6a68eb9..b8cd8e8 100644 --- a/src/agenda_culturel/templates/agenda_culturel/fix_duplicate.html +++ b/src/agenda_culturel/templates/agenda_culturel/fix_duplicate.html @@ -12,8 +12,8 @@ {% block content %}
    -

    {% block title %}{% block og_title %}{% if object.fixed %}Modifier{% else %}Corriger{% endif %} des événements {% if not object.fixed %}possiblement{% endif %} dupliqués{% endblock %}{% endblock %}

    - {% if object.fixed %} +

    {% block title %}{% block og_title %}{% if object.representative %}Modifier{% else %}Corriger{% endif %} des événements {% if not object.representative %}possiblement{% endif %} dupliqués{% endblock %}{% endblock %}

    + {% if object.representative %}

    Les événements ci-dessous sont des duplicats du même événement, probablement issus de différentes sources. La version qui sera affichée aux internautes en priorité est la version {% for e in object.get_duplicated %}{% if not e.masked %}{{ forloop.counter0|int_to_abc }}{% endif %}{% endfor %}. diff --git a/src/agenda_culturel/templates/agenda_culturel/page-event.html b/src/agenda_culturel/templates/agenda_culturel/page-event.html index 7d839d8..b6f490e 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-event.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-event.html @@ -89,7 +89,7 @@ {% if poss_dup.count > 0 %}

    - {% if event.possibly_duplicated.fixed %} + {% if event.possibly_duplicated.representative %}

    Sources multiples

    L'événement affiché a également été trouvé à partir {% if poss_dup.count == 1 %} diff --git a/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html b/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html index 71e903b..bda0ac2 100644 --- a/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html @@ -22,7 +22,7 @@ {% with poss_dup=event.get_possibly_duplicated|only_allowed:user.is_authenticated %} {% if poss_dup.count > 0 %}

    - {% if event.possibly_duplicated.fixed %} + {% if event.possibly_duplicated.representative %} cet événement a été {% if user.is_authenticated %}importé plusieurs fois{% else %}importé plusieurs fois{% endif %}, {% if event.masked %} vous pouvez consulter l'import principal diff --git a/src/agenda_culturel/templatetags/duplicated_extra.py b/src/agenda_culturel/templatetags/duplicated_extra.py index 78ee429..dfb2de3 100644 --- a/src/agenda_culturel/templatetags/duplicated_extra.py +++ b/src/agenda_culturel/templatetags/duplicated_extra.py @@ -16,14 +16,13 @@ register = template.Library() @register.simple_tag def show_badge_duplicated(placement="top"): - nb_duplicated = DuplicatedEvents.objects.annotate(nb_duplicated=Count('event', - filter=Q(fixed=False), distinct=True)).filter(nb_duplicated__gte=1).count() + nb_duplicated = DuplicatedEvents.objects.filter(representative=None).count() if nb_duplicated != 0: return mark_safe( '