From 4b5583041990981c94790fd1b5082949b8736832 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 28 Dec 2024 18:47:03 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20possibilit=C3=A9=20d'ajouter?= =?UTF-8?q?=20des=20messages=20quand=20on=20soumet=20un=20=C3=A9v=C3=A9nem?= =?UTF-8?q?ent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #209 --- src/agenda_culturel/celery.py | 14 +- src/agenda_culturel/forms.py | 54 +- src/agenda_culturel/import_tasks/extractor.py | 2 + .../locale/fr/LC_MESSAGES/django.po | 638 +++++++++--------- src/agenda_culturel/models.py | 10 + src/agenda_culturel/static/style.scss | 7 +- .../templates/agenda_culturel/import.html | 2 +- .../templates/agenda_culturel/import_set.html | 6 + .../templates/agenda_culturel/page-event.html | 5 +- src/agenda_culturel/views.py | 43 +- 10 files changed, 453 insertions(+), 328 deletions(-) diff --git a/src/agenda_culturel/celery.py b/src/agenda_culturel/celery.py index a8471a8..26c5e6d 100644 --- a/src/agenda_culturel/celery.py +++ b/src/agenda_culturel/celery.py @@ -314,7 +314,7 @@ def weekly_imports(self): run_recurrent_imports_from_list([imp.pk for imp in imports]) @app.task(base=ChromiumTask, bind=True) -def import_events_from_url(self, url, cat, tags, force=False, user_id=None): +def import_events_from_url(self, url, cat, tags, force=False, user_id=None, email=None, comments=None): from .db_importer import DBImporterEvents from agenda_culturel.models import RecurrentImport, BatchImportation from agenda_culturel.models import Event, Category @@ -348,7 +348,13 @@ def import_events_from_url(self, url, cat, tags, force=False, user_id=None): # set default values values = {} if cat is not None: - values = {"category": cat, "tags": tags} + values["category"] = cat + if tags is not None: + values["tags"] = tags + if email is not None: + values["email"] = email + if comments is not None: + values["comments"] = comments # get event events = u2e.process( @@ -377,14 +383,14 @@ def import_events_from_url(self, url, cat, tags, force=False, user_id=None): @app.task(base=ChromiumTask, bind=True) -def import_events_from_urls(self, urls_cat_tags, user_id=None): +def import_events_from_urls(self, urls_cat_tags, user_id=None, email=None, comments=None): for ucat in urls_cat_tags: if ucat is not None: url = ucat[0] cat = ucat[1] tags = ucat[2] - import_events_from_url.delay(url, cat, tags, user_id=user_id) + import_events_from_url.delay(url, cat, tags, user_id=user_id, email=email, comments=comments) app.conf.beat_schedule = { diff --git a/src/agenda_culturel/forms.py b/src/agenda_culturel/forms.py index d5cf26b..d85115a 100644 --- a/src/agenda_culturel/forms.py +++ b/src/agenda_culturel/forms.py @@ -13,7 +13,10 @@ from django.forms import ( BooleanField, HiddenInput, ModelChoiceField, + EmailField ) +from django.forms import formset_factory + from django_better_admin_arrayfield.forms.widgets import DynamicArrayWidget from .utils import PlaceGuesser @@ -125,7 +128,42 @@ class TagRenameForm(Form): def is_force(self): return "force" in self.fields and self.cleaned_data["force"] == True -class URLSubmissionForm(Form): + +class SimpleContactForm(GroupFormMixin, Form): + email = EmailField( + label=_("Your email"), + help_text=_("Your email address"), + max_length=254, + required=False + ) + + comments = CharField( + label=_("Comments"), + help_text=_("Your message for the moderation team (comments, clarifications, requests...)"), + widget=Textarea, + max_length=2048, + required=False + ) + + def __init__(self, *args, **kwargs): + is_authenticated = "is_authenticated" in kwargs and kwargs["is_authenticated"] + super().__init__(*args, **kwargs) + + if not is_authenticated: + self.add_group('communication', + _('Receive notification of publication or leave a message for moderation'), + maskable=True, + default_masked=True) + self.fields["email"].group_id = 'communication' + self.fields["comments"].group_id = 'communication' + else: + del self.fields["email"] + del self.fields["comments"] + + + + +class URLSubmissionForm(GroupFormMixin, Form): required_css_class = 'required' url = URLField(max_length=512) @@ -143,11 +181,20 @@ class URLSubmissionForm(Form): ) def __init__(self, *args, **kwargs): + is_authenticated = kwargs.pop("is_authenticated", False) super().__init__(*args, **kwargs) self.fields["tags"].choices = Tag.get_tag_groups(all=True) + self.add_group('event', _('Event')) + self.fields["url"].group_id = 'event' + self.fields["category"].group_id = 'event' + self.fields["tags"].group_id = 'event' +class URLSubmissionFormWithContact(SimpleContactForm, URLSubmissionForm): + pass + +URLSubmissionFormSet = formset_factory(URLSubmissionForm, extra=9, min_num=1) class DynamicArrayWidgetURLs(DynamicArrayWidget): template_name = "agenda_culturel/widgets/widget-urls.html" @@ -282,6 +329,8 @@ class EventForm(GroupFormMixin, ModelForm): self.fields['local_image'].group_id = 'illustration' self.fields['image_alt'].group_id = 'illustration' + self.add_group('urls', _('URLs')) + self.fields["reference_urls"].group_id = 'urls' if is_authenticated: self.add_group('meta-admin', _('Meta information')) @@ -338,6 +387,9 @@ class EventForm(GroupFormMixin, ModelForm): self.cleaned_data['local_image'] = File(name=basename, file=open(old, "rb")) +class EventFormWithContact(SimpleContactForm, EventForm): + pass + class MultipleChoiceFieldAcceptAll(MultipleChoiceField): def validate(self, value): pass diff --git a/src/agenda_culturel/import_tasks/extractor.py b/src/agenda_culturel/import_tasks/extractor.py index 3ce362b..340fccd 100644 --- a/src/agenda_culturel/import_tasks/extractor.py +++ b/src/agenda_culturel/import_tasks/extractor.py @@ -200,6 +200,8 @@ class Extractor(ABC): "published": published, "image": image, "image_alt": image_alt, + "email": self.default_value_if_exists(default_values, "email"), + "comments": self.default_value_if_exists(default_values, "comments"), } # TODO: pourquoi url_human et non reference_url if url_human is not None: diff --git a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po index a315b39..fe50f5e 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-12-22 15:52+0100\n" +"POT-Creation-Date: 2024-12-28 18:44+0100\n" "PO-Revision-Date: 2023-10-29 14:16+0000\n" "Last-Translator: Jean-Marie Favreau \n" "Language-Team: Jean-Marie Favreau \n" @@ -110,7 +110,7 @@ msgstr "Non" msgid "Imported from" msgstr "Importé depuis" -#: agenda_culturel/filters.py:367 agenda_culturel/models.py:1852 +#: agenda_culturel/filters.py:367 agenda_culturel/models.py:1883 msgid "Closed" msgstr "Fermé" @@ -118,7 +118,7 @@ msgstr "Fermé" msgid "Open" msgstr "Ouvert" -#: agenda_culturel/filters.py:372 agenda_culturel/models.py:1846 +#: agenda_culturel/filters.py:372 agenda_culturel/models.py:1877 msgid "Spam" msgstr "Spam" @@ -130,83 +130,115 @@ msgstr "Non spam" msgid "Search" msgstr "Rechercher" -#: agenda_culturel/forms.py:77 +#: agenda_culturel/forms.py:80 msgid "Other" msgstr "Autres" -#: agenda_culturel/forms.py:107 +#: agenda_culturel/forms.py:110 msgid "Name of new tag" msgstr "Nom de la nouvelle étiquette" -#: agenda_culturel/forms.py:112 +#: agenda_culturel/forms.py:115 msgid "" "Force renaming despite the existence of events already using the chosen tag." msgstr "" "Forcer le renommage malgré l'existence d'événements utilisant déjà " "l'étiquette choisie." -#: agenda_culturel/forms.py:133 agenda_culturel/models.py:178 -#: agenda_culturel/models.py:620 agenda_culturel/models.py:1977 -#: agenda_culturel/models.py:2087 +#: agenda_culturel/forms.py:134 +msgid "Your email" +msgstr "Votre adresse email" + +#: agenda_culturel/forms.py:135 agenda_culturel/models.py:1867 +msgid "Your email address" +msgstr "Votre adresse email" + +#: agenda_culturel/forms.py:141 agenda_culturel/models.py:1890 +msgid "Comments" +msgstr "Commentaires" + +#: agenda_culturel/forms.py:142 +msgid "" +"Your message for the moderation team (comments, clarifications, requests...)" +msgstr "" +"Votre message pour l'équipe de modération (commentaires, précisions, " +"demandes, ...)" + +#: agenda_culturel/forms.py:154 +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:180 +#: agenda_culturel/models.py:622 agenda_culturel/models.py:2008 +#: agenda_culturel/models.py:2118 msgid "Category" msgstr "Catégorie" -#: agenda_culturel/forms.py:139 agenda_culturel/forms.py:164 -#: agenda_culturel/forms.py:194 agenda_culturel/forms.py:349 -#: agenda_culturel/models.py:219 agenda_culturel/models.py:728 +#: agenda_culturel/forms.py:177 agenda_culturel/forms.py:211 +#: agenda_culturel/forms.py:242 agenda_culturel/forms.py:402 +#: agenda_culturel/models.py:221 agenda_culturel/models.py:730 msgid "Tags" msgstr "Étiquettes" -#: agenda_culturel/forms.py:250 +#: agenda_culturel/forms.py:188 agenda_culturel/forms.py:549 +#: agenda_culturel/models.py:814 +msgid "Event" +msgstr "Événement" + +#: agenda_culturel/forms.py:298 msgid "Main fields" msgstr "Champs principaux" -#: agenda_culturel/forms.py:253 +#: agenda_culturel/forms.py:301 msgid "Start of event" msgstr "Début de l'événement" -#: agenda_culturel/forms.py:257 +#: agenda_culturel/forms.py:305 msgid "End of event" msgstr "Fin de l'événement" -#: agenda_culturel/forms.py:262 +#: agenda_culturel/forms.py:310 msgid "This is a recurring event" msgstr "Cet événement est récurrent" -#: agenda_culturel/forms.py:271 +#: agenda_culturel/forms.py:319 msgid "Details" msgstr "Détails" -#: agenda_culturel/forms.py:276 agenda_culturel/models.py:650 -#: agenda_culturel/models.py:1952 +#: agenda_culturel/forms.py:324 agenda_culturel/models.py:652 +#: agenda_culturel/models.py:1983 msgid "Location" msgstr "Localisation" -#: agenda_culturel/forms.py:280 agenda_culturel/models.py:683 +#: agenda_culturel/forms.py:328 agenda_culturel/models.py:685 msgid "Illustration" msgstr "Illustration" -#: agenda_culturel/forms.py:286 agenda_culturel/forms.py:291 +#: agenda_culturel/forms.py:332 agenda_culturel/models.py:722 +msgid "URLs" +msgstr "URLs" + +#: agenda_culturel/forms.py:336 agenda_culturel/forms.py:341 msgid "Meta information" msgstr "Méta-informations" -#: agenda_culturel/forms.py:306 +#: agenda_culturel/forms.py:356 msgid "The end date must be after the start date." msgstr "La date de fin doit être après la date de début." -#: agenda_culturel/forms.py:322 +#: agenda_culturel/forms.py:372 msgid "The end time cannot be earlier than the start time." msgstr "L'heure de fin ne peut pas être avant l'heure de début." -#: agenda_culturel/forms.py:350 +#: agenda_culturel/forms.py:403 msgid "Select tags from existing ones." msgstr "Sélectionner des étiquettes depuis celles existantes." -#: agenda_culturel/forms.py:355 +#: agenda_culturel/forms.py:408 msgid "New tags" msgstr "Nouvelles étiquettes" -#: agenda_culturel/forms.py:356 +#: agenda_culturel/forms.py:409 msgid "" "Create new labels (sparingly). Note: by starting your tag with the " "characters “TW:”, youll create a “trigger warning” tag, and the associated " @@ -217,176 +249,172 @@ msgstr "" "étiquette “trigger warning”, et les événements associés seront annoncés " "comme tels." -#: agenda_culturel/forms.py:402 +#: agenda_culturel/forms.py:455 msgid "JSON in the format expected for the import." msgstr "JSON dans le format attendu pour l'import" -#: agenda_culturel/forms.py:424 +#: agenda_culturel/forms.py:477 msgid " (locally modified version)" msgstr " (version modifiée localement)" -#: agenda_culturel/forms.py:428 +#: agenda_culturel/forms.py:481 msgid " (synchronized on import version)" msgstr " (version synchronisée sur l'import)" -#: agenda_culturel/forms.py:432 +#: agenda_culturel/forms.py:485 msgid "Select {} as representative version." msgstr "Sélectionner {} comme version représentative" -#: agenda_culturel/forms.py:441 +#: agenda_culturel/forms.py:494 msgid "Update {} using some fields from other versions (interactive mode)." msgstr "" "Mettre à jour {} en utilisant quelques champs des autres versions (mode " "interactif)." -#: agenda_culturel/forms.py:448 +#: agenda_culturel/forms.py:501 msgid " Warning: a version is already locally modified." msgstr " Attention: une version a déjà été modifiée localement." -#: agenda_culturel/forms.py:453 +#: agenda_culturel/forms.py:506 msgid "Create a new version by merging (interactive mode)." msgstr "Créer une nouvelle version par fusion (mode interactif)." -#: agenda_culturel/forms.py:460 +#: agenda_culturel/forms.py:513 msgid "Make {} independent." msgstr "Rendre {} indépendant." -#: agenda_culturel/forms.py:462 +#: agenda_culturel/forms.py:515 msgid "Make all versions independent." msgstr "Rendre toutes les versions indépendantes." -#: agenda_culturel/forms.py:496 agenda_culturel/models.py:812 -msgid "Event" -msgstr "Événement" - -#: agenda_culturel/forms.py:521 +#: agenda_culturel/forms.py:574 msgid "Value of the selected version" msgstr "Valeur de la version sélectionnée" -#: agenda_culturel/forms.py:523 agenda_culturel/forms.py:527 +#: agenda_culturel/forms.py:576 agenda_culturel/forms.py:580 msgid "Value of version {}" msgstr "Valeur de la version {}" -#: agenda_culturel/forms.py:676 +#: agenda_culturel/forms.py:729 msgid "Apply category {} to the event {}" msgstr "Appliquer la catégorie {} à l'événement {}" -#: agenda_culturel/forms.py:693 agenda_culturel/models.py:466 -#: agenda_culturel/models.py:2139 +#: agenda_culturel/forms.py:746 agenda_culturel/models.py:468 +#: agenda_culturel/models.py:2170 msgid "Place" msgstr "Lieu" -#: agenda_culturel/forms.py:695 +#: agenda_culturel/forms.py:748 msgid "Create a missing place" msgstr "Créer un lieu manquant" -#: agenda_culturel/forms.py:705 +#: agenda_culturel/forms.py:758 msgid "Add \"{}\" to the aliases of the place" msgstr "Ajouter « {} » aux alias du lieu" -#: agenda_culturel/forms.py:734 +#: agenda_culturel/forms.py:787 msgid "On saving, use aliases to detect all matching events with missing place" msgstr "" "Lors de l'enregistrement, utiliser des alias pour détecter tous les " "événements correspondants dont la place est manquante." -#: agenda_culturel/forms.py:747 +#: agenda_culturel/forms.py:800 msgid "Header" msgstr "Entête" -#: agenda_culturel/forms.py:751 agenda_culturel/models.py:439 +#: agenda_culturel/forms.py:804 agenda_culturel/models.py:441 msgid "Address" msgstr "Adresse" -#: agenda_culturel/forms.py:757 +#: agenda_culturel/forms.py:810 msgid "Meta" msgstr "Méta" -#: agenda_culturel/forms.py:760 +#: agenda_culturel/forms.py:813 msgid "Information" msgstr "Informations" -#: agenda_culturel/forms.py:810 +#: agenda_culturel/forms.py:863 msgid "Add a comment" msgstr "Ajouter un commentaire" -#: agenda_culturel/models.py:59 agenda_culturel/models.py:107 -#: agenda_culturel/models.py:188 agenda_culturel/models.py:409 -#: agenda_culturel/models.py:437 agenda_culturel/models.py:524 -#: agenda_culturel/models.py:1828 agenda_culturel/models.py:1906 +#: agenda_culturel/models.py:61 agenda_culturel/models.py:109 +#: agenda_culturel/models.py:190 agenda_culturel/models.py:411 +#: agenda_culturel/models.py:439 agenda_culturel/models.py:526 +#: agenda_culturel/models.py:1859 agenda_culturel/models.py:1937 msgid "Name" msgstr "Nom" -#: agenda_culturel/models.py:60 agenda_culturel/models.py:107 +#: agenda_culturel/models.py:62 agenda_culturel/models.py:109 msgid "Category name" msgstr "Nom de la catégorie" -#: agenda_culturel/models.py:65 +#: agenda_culturel/models.py:67 msgid "Content" msgstr "Contenu" -#: agenda_culturel/models.py:65 +#: agenda_culturel/models.py:67 msgid "Text as shown to the visitors" msgstr "Texte tel que présenté aux visiteureuses" -#: agenda_culturel/models.py:69 +#: agenda_culturel/models.py:71 msgid "URL path" msgstr "Chemin URL" -#: agenda_culturel/models.py:70 +#: agenda_culturel/models.py:72 msgid "URL path where the content is included." msgstr "Chemin URL où le contenu est présent." -#: agenda_culturel/models.py:74 +#: agenda_culturel/models.py:76 msgid "Static content" msgstr "Contenu statique" -#: agenda_culturel/models.py:75 +#: agenda_culturel/models.py:77 msgid "Static contents" msgstr "Contenus statiques" -#: agenda_culturel/models.py:111 +#: agenda_culturel/models.py:113 msgid "Color" msgstr "Couleur" -#: agenda_culturel/models.py:112 +#: agenda_culturel/models.py:114 msgid "Color used as background for the category" msgstr "Couleur utilisée comme fond de la catégorie" -#: agenda_culturel/models.py:118 +#: agenda_culturel/models.py:120 msgid "Pictogram" msgstr "Pictogramme" -#: agenda_culturel/models.py:119 +#: agenda_culturel/models.py:121 msgid "Pictogram of the category (svg format)" msgstr "Pictogramme de la catégorie (format svg)" -#: agenda_culturel/models.py:126 +#: agenda_culturel/models.py:128 msgid "Position for ordering categories" msgstr "Position pour ordonner les catégories" -#: agenda_culturel/models.py:179 +#: agenda_culturel/models.py:181 msgid "Categories" msgstr "Catégories" -#: agenda_culturel/models.py:188 +#: agenda_culturel/models.py:190 msgid "Tag name" msgstr "Nom de l'étiquette" -#: agenda_culturel/models.py:193 agenda_culturel/models.py:449 -#: agenda_culturel/models.py:536 agenda_culturel/models.py:667 +#: agenda_culturel/models.py:195 agenda_culturel/models.py:451 +#: agenda_culturel/models.py:538 agenda_culturel/models.py:669 msgid "Description" msgstr "Description" -#: agenda_culturel/models.py:194 +#: agenda_culturel/models.py:196 msgid "Description of the tag" msgstr "Description de l'étiquette" -#: agenda_culturel/models.py:200 +#: agenda_culturel/models.py:202 msgid "Principal" msgstr "Principal" -#: agenda_culturel/models.py:201 +#: agenda_culturel/models.py:203 msgid "" "This tag is highlighted as a main tag for visitors, particularly in the " "filter." @@ -394,91 +422,91 @@ msgstr "" "Cette étiquette est mise en avant comme étiquette principale pour les " "visiteurs, en particulier dans le filtre." -#: agenda_culturel/models.py:206 +#: agenda_culturel/models.py:208 msgid "In excluded suggestions" msgstr "Dans les suggestions d'exclusion" -#: agenda_culturel/models.py:207 +#: agenda_culturel/models.py:209 msgid "This tag will be part of the excluded suggestions." msgstr "Cette étiquette fera partie des suggestions d'exclusion." -#: agenda_culturel/models.py:212 +#: agenda_culturel/models.py:214 msgid "In included suggestions" msgstr "Dans les suggestions d'inclusion." -#: agenda_culturel/models.py:213 +#: agenda_culturel/models.py:215 msgid "This tag will be part of the included suggestions." msgstr "Cette étiquette fera partie des suggestions d'inclusion." -#: agenda_culturel/models.py:218 +#: agenda_culturel/models.py:220 msgid "Tag" msgstr "Étiquette" -#: agenda_culturel/models.py:264 +#: agenda_culturel/models.py:266 msgid "Suggestions" msgstr "Suggestions" -#: agenda_culturel/models.py:265 +#: agenda_culturel/models.py:267 msgid "Others" msgstr "Autres" -#: agenda_culturel/models.py:280 +#: agenda_culturel/models.py:282 msgid "Representative event" msgstr "Événement représentatif" -#: agenda_culturel/models.py:281 +#: agenda_culturel/models.py:283 msgid "This event is the representative event of the duplicated events group" msgstr "" "Cet événement est l'événement représentatif du groupe d'événements dupliqués." -#: agenda_culturel/models.py:288 agenda_culturel/models.py:289 +#: agenda_culturel/models.py:290 agenda_culturel/models.py:291 msgid "Duplicated events" msgstr "Événements dupliqués" -#: agenda_culturel/models.py:409 +#: agenda_culturel/models.py:411 msgid "Name of the location" msgstr "Nom de la position" -#: agenda_culturel/models.py:412 +#: agenda_culturel/models.py:414 msgid "Main" msgstr "Principale" -#: agenda_culturel/models.py:413 +#: agenda_culturel/models.py:415 msgid "This location is one of the main locations (shown first higher values)." msgstr "" "Cette position est une position principale (affichage en premier des plus " "grandes valeurs)." -#: agenda_culturel/models.py:417 +#: agenda_culturel/models.py:419 msgid "Suggested distance (km)" msgstr "" -#: agenda_culturel/models.py:418 +#: agenda_culturel/models.py:420 msgid "" "If this distance is given, this location is part of the suggested filters." msgstr "" -#: agenda_culturel/models.py:424 +#: agenda_culturel/models.py:426 msgid "Reference location" msgstr "Position de référence" -#: agenda_culturel/models.py:425 +#: agenda_culturel/models.py:427 msgid "Reference locations" msgstr "Positions de référence" -#: agenda_culturel/models.py:437 +#: agenda_culturel/models.py:439 msgid "Name of the place" msgstr "Nom du lieu" -#: agenda_culturel/models.py:440 +#: agenda_culturel/models.py:442 msgid "Address of this place (without city name)" msgstr "Adresse de ce lieu (sans le nom de la ville)" -#: agenda_culturel/models.py:444 +#: agenda_culturel/models.py:446 msgid "Postcode" msgstr "Code postal" -#: agenda_culturel/models.py:444 +#: agenda_culturel/models.py:446 msgid "" "The post code is not displayed, but makes it easier to find an address when " "you enter it." @@ -486,23 +514,23 @@ msgstr "" "Le code postal ne sera pas affiché, mais facilite la recherche d'adresse au " "moment de la saisie." -#: agenda_culturel/models.py:445 +#: agenda_culturel/models.py:447 msgid "City" msgstr "Ville" -#: agenda_culturel/models.py:445 +#: agenda_culturel/models.py:447 msgid "City name" msgstr "Nom de la ville" -#: agenda_culturel/models.py:450 +#: agenda_culturel/models.py:452 msgid "Description of the place, including accessibility." msgstr "Description du lieu, inclus l'accessibilité." -#: agenda_culturel/models.py:457 +#: agenda_culturel/models.py:459 msgid "Alternative names" msgstr "Noms alternatifs" -#: agenda_culturel/models.py:459 +#: agenda_culturel/models.py:461 msgid "" "Alternative names or addresses used to match a place with the free-form " "location of an event." @@ -510,31 +538,31 @@ 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:467 +#: agenda_culturel/models.py:469 msgid "Places" msgstr "Lieux" -#: agenda_culturel/models.py:524 +#: agenda_culturel/models.py:526 msgid "Organisation name" msgstr "Nom de l'organisme" -#: agenda_culturel/models.py:528 +#: agenda_culturel/models.py:530 msgid "Website" msgstr "Site internet" -#: agenda_culturel/models.py:529 +#: agenda_culturel/models.py:531 msgid "Website of the organisation" msgstr "Site internet de l'organisme" -#: agenda_culturel/models.py:537 +#: agenda_culturel/models.py:539 msgid "Description of the organisation." msgstr "Description de l'organisme" -#: agenda_culturel/models.py:544 +#: agenda_culturel/models.py:546 msgid "Principal place" msgstr "Lieu principal" -#: agenda_culturel/models.py:545 +#: agenda_culturel/models.py:547 msgid "" "Place mainly associated with this organizer. Mainly used if there is a " "similarity in the name, to avoid redundant displays." @@ -542,75 +570,75 @@ msgstr "" "Lieu principalement associé à cet organisateur. Principalement utilisé s'il " "y a une similarité de nom, pour éviter les affichages redondants." -#: agenda_culturel/models.py:552 +#: agenda_culturel/models.py:554 msgid "Organisation" msgstr "Organisme" -#: agenda_culturel/models.py:553 +#: agenda_culturel/models.py:555 msgid "Organisations" msgstr "Organismes" -#: agenda_culturel/models.py:565 agenda_culturel/models.py:1947 +#: agenda_culturel/models.py:567 agenda_culturel/models.py:1978 msgid "Published" msgstr "Publié" -#: agenda_culturel/models.py:566 +#: agenda_culturel/models.py:568 msgid "Draft" msgstr "Brouillon" -#: agenda_culturel/models.py:567 +#: agenda_culturel/models.py:569 msgid "Trash" msgstr "Corbeille" -#: agenda_culturel/models.py:576 +#: agenda_culturel/models.py:578 msgid "Author of the event creation" msgstr "Auteur de la création de l'événement" -#: agenda_culturel/models.py:584 +#: agenda_culturel/models.py:586 msgid "Author of the last importation" msgstr "Auteur de la dernière importation" -#: agenda_culturel/models.py:592 +#: agenda_culturel/models.py:594 msgid "Author of the last modification" msgstr "Auteur de la dernière modification" -#: agenda_culturel/models.py:600 +#: agenda_culturel/models.py:602 msgid "Author of the last moderation" msgstr "Auteur de la dernière modération" -#: agenda_culturel/models.py:611 +#: agenda_culturel/models.py:613 msgid "Title" msgstr "Titre" -#: agenda_culturel/models.py:615 agenda_culturel/models.py:2055 +#: agenda_culturel/models.py:617 agenda_culturel/models.py:2086 msgid "Status" msgstr "Status" -#: agenda_culturel/models.py:627 +#: agenda_culturel/models.py:629 msgid "Start day" msgstr "Date de début" -#: agenda_culturel/models.py:630 +#: agenda_culturel/models.py:632 msgid "Start time" msgstr "Heure de début" -#: agenda_culturel/models.py:636 +#: agenda_culturel/models.py:638 msgid "End day" msgstr "Date de fin" -#: agenda_culturel/models.py:641 +#: agenda_culturel/models.py:643 msgid "End time" msgstr "Heure de fin" -#: agenda_culturel/models.py:645 +#: agenda_culturel/models.py:647 msgid "Recurrence" msgstr "Récurrence" -#: agenda_culturel/models.py:656 +#: agenda_culturel/models.py:658 msgid "Location (free form)" msgstr "Localisation (forme libre)" -#: agenda_culturel/models.py:658 +#: agenda_culturel/models.py:660 msgid "" "Address of the event in case its not available in the already known places " "(free form)" @@ -618,11 +646,11 @@ 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:675 +#: agenda_culturel/models.py:677 msgid "Organisers" msgstr "Organisateurs" -#: agenda_culturel/models.py:677 +#: agenda_culturel/models.py:679 msgid "" "list of event organisers. Organizers will only be displayed if one of them " "does not normally use the venue." @@ -630,55 +658,63 @@ msgstr "" "Liste des organisateurs de l'événements. Les organisateurs seront affichés " "uniquement si au moins un d'entre eux n'utilise pas habituellement le lieu." -#: agenda_culturel/models.py:690 +#: agenda_culturel/models.py:692 msgid "Illustration (URL)" msgstr "Illustration (URL)" -#: agenda_culturel/models.py:691 +#: agenda_culturel/models.py:693 msgid "External URL of the illustration image" msgstr "URL externe de l'image illustrative" -#: agenda_culturel/models.py:697 +#: agenda_culturel/models.py:699 msgid "Illustration description" msgstr "Description de l'illustration" -#: agenda_culturel/models.py:698 +#: agenda_culturel/models.py:700 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:706 +#: agenda_culturel/models.py:708 msgid "Importation source" msgstr "Source d'importation" -#: agenda_culturel/models.py:707 +#: agenda_culturel/models.py:709 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:713 +#: agenda_culturel/models.py:715 msgid "UUIDs" msgstr "UUIDs" -#: agenda_culturel/models.py:714 +#: agenda_culturel/models.py:716 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:720 -msgid "URLs" -msgstr "URLs" - -#: agenda_culturel/models.py:721 +#: agenda_culturel/models.py:723 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:735 +#: agenda_culturel/models.py:737 msgid "Other versions" msgstr "" -#: agenda_culturel/models.py:813 +#: agenda_culturel/models.py:815 msgid "Events" msgstr "Événements" -#: agenda_culturel/models.py:1597 +#: agenda_culturel/models.py:1288 +msgid "during import process" +msgstr "pendant le processus d'import" + +#: agenda_culturel/models.py:1626 +msgid "Import" +msgstr "Import" + +#: agenda_culturel/models.py:1626 +msgid "import process" +msgstr "processus d'import" + +#: agenda_culturel/models.py:1626 msgid "" "The duration of the event is a little too long for direct publication. " "Moderators can choose to publish it or not." @@ -686,151 +722,135 @@ 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:1606 -msgid "Import" -msgstr "Import" - -#: agenda_culturel/models.py:1606 -msgid "import process" -msgstr "processus d'import" - -#: agenda_culturel/models.py:1793 agenda_culturel/models.py:1841 +#: agenda_culturel/models.py:1824 agenda_culturel/models.py:1872 msgid "Message" msgstr "Message" -#: agenda_culturel/models.py:1794 +#: agenda_culturel/models.py:1825 msgid "Messages" msgstr "Messages" -#: agenda_culturel/models.py:1805 +#: agenda_culturel/models.py:1836 msgid "Subject" msgstr "Sujet" -#: agenda_culturel/models.py:1806 +#: agenda_culturel/models.py:1837 msgid "The subject of your message" msgstr "Sujet de votre message" -#: agenda_culturel/models.py:1812 +#: agenda_culturel/models.py:1843 msgid "Related event" msgstr "Événement associé" -#: agenda_culturel/models.py:1813 +#: agenda_culturel/models.py:1844 msgid "The message is associated with this event." msgstr "Le message est associé à cet événement." -#: agenda_culturel/models.py:1821 +#: agenda_culturel/models.py:1852 msgid "Author of the message" msgstr "Auteur du message" -#: agenda_culturel/models.py:1829 +#: agenda_culturel/models.py:1860 msgid "Your name" msgstr "Votre nom" -#: agenda_culturel/models.py:1835 +#: agenda_culturel/models.py:1866 msgid "Email address" msgstr "Adresse email" -#: agenda_culturel/models.py:1836 -msgid "Your email address" -msgstr "Votre adresse email" - -#: agenda_culturel/models.py:1841 +#: agenda_culturel/models.py:1872 msgid "Your message" msgstr "Votre message" -#: agenda_culturel/models.py:1847 +#: agenda_culturel/models.py:1878 msgid "This message is a spam." msgstr "Ce message est un spam." -#: agenda_culturel/models.py:1854 +#: agenda_culturel/models.py:1885 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:1859 -msgid "Comments" -msgstr "Commentaires" - -#: agenda_culturel/models.py:1860 +#: agenda_culturel/models.py:1891 msgid "Comments on the message from the moderation team" msgstr "Commentaires sur ce message par l'équipe de modération" -#: agenda_culturel/models.py:1875 agenda_culturel/models.py:2035 +#: agenda_culturel/models.py:1906 agenda_culturel/models.py:2066 msgid "Recurrent import" msgstr "Import récurrent" -#: agenda_culturel/models.py:1876 +#: agenda_culturel/models.py:1907 msgid "Recurrent imports" msgstr "Imports récurrents" -#: agenda_culturel/models.py:1880 +#: agenda_culturel/models.py:1911 msgid "ical" msgstr "ical" -#: agenda_culturel/models.py:1881 +#: agenda_culturel/models.py:1912 msgid "ical no busy" msgstr "ical sans busy" -#: agenda_culturel/models.py:1882 +#: agenda_culturel/models.py:1913 msgid "ical no VC" msgstr "ical sans VC" -#: agenda_culturel/models.py:1883 +#: agenda_culturel/models.py:1914 msgid "lacoope.org" msgstr "lacoope.org" -#: agenda_culturel/models.py:1884 +#: agenda_culturel/models.py:1915 msgid "la comédie" msgstr "la comédie" -#: agenda_culturel/models.py:1885 +#: agenda_culturel/models.py:1916 msgid "le fotomat" msgstr "le fotomat" -#: agenda_culturel/models.py:1886 +#: agenda_culturel/models.py:1917 msgid "la puce à l'oreille" msgstr "la puce à loreille" -#: agenda_culturel/models.py:1887 +#: agenda_culturel/models.py:1918 msgid "Plugin wordpress MEC" msgstr "Plugin wordpress MEC" -#: agenda_culturel/models.py:1888 +#: agenda_culturel/models.py:1919 msgid "Événements d'une page FB" msgstr "Événements d'une page FB" -#: agenda_culturel/models.py:1889 +#: agenda_culturel/models.py:1920 msgid "la cour des 3 coquins" msgstr "la cour des 3 coquins" -#: agenda_culturel/models.py:1890 +#: agenda_culturel/models.py:1921 msgid "Arachnée concert" msgstr "Arachnée concert" -#: agenda_culturel/models.py:1891 +#: agenda_culturel/models.py:1922 msgid "Le Rio" msgstr "Le Rio" -#: agenda_culturel/models.py:1894 +#: agenda_culturel/models.py:1925 msgid "simple" msgstr "simple" -#: agenda_culturel/models.py:1895 +#: agenda_culturel/models.py:1926 msgid "Headless Chromium" msgstr "chromium sans interface" -#: agenda_culturel/models.py:1896 +#: agenda_culturel/models.py:1927 msgid "Headless Chromium (pause)" msgstr "chromium sans interface (pause)" -#: agenda_culturel/models.py:1901 +#: agenda_culturel/models.py:1932 msgid "daily" msgstr "chaque jour" -#: agenda_culturel/models.py:1903 +#: agenda_culturel/models.py:1934 msgid "weekly" msgstr "chaque semaine" -#: agenda_culturel/models.py:1908 +#: agenda_culturel/models.py:1939 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." @@ -838,151 +858,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:1915 +#: agenda_culturel/models.py:1946 msgid "Processor" msgstr "Processeur" -#: agenda_culturel/models.py:1918 +#: agenda_culturel/models.py:1949 msgid "Downloader" msgstr "Téléchargeur" -#: agenda_culturel/models.py:1925 +#: agenda_culturel/models.py:1956 msgid "Import recurrence" msgstr "Récurrence d'import" -#: agenda_culturel/models.py:1932 +#: agenda_culturel/models.py:1963 msgid "Source" msgstr "Source" -#: agenda_culturel/models.py:1933 +#: agenda_culturel/models.py:1964 msgid "URL of the source document" msgstr "URL du document source" -#: agenda_culturel/models.py:1937 +#: agenda_culturel/models.py:1968 msgid "Browsable url" msgstr "URL navigable" -#: agenda_culturel/models.py:1939 +#: agenda_culturel/models.py:1970 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:1948 +#: agenda_culturel/models.py:1979 msgid "Status of each imported event (published or draft)" msgstr "Status de chaque événement importé (publié ou brouillon)" -#: agenda_culturel/models.py:1953 +#: agenda_culturel/models.py:1984 msgid "Address for each imported event" msgstr "Adresse de chaque événement importé" -#: agenda_culturel/models.py:1960 +#: agenda_culturel/models.py:1991 msgid "Force location" msgstr "Focer la localisation" -#: agenda_culturel/models.py:1961 +#: agenda_culturel/models.py:1992 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:1967 +#: agenda_culturel/models.py:1998 msgid "Organiser" msgstr "Organisateur" -#: agenda_culturel/models.py:1968 +#: agenda_culturel/models.py:1999 msgid "Organiser of each imported event" msgstr "Organisateur de chaque événement importé" -#: agenda_culturel/models.py:1978 +#: agenda_culturel/models.py:2009 msgid "Category of each imported event" msgstr "Catégorie de chaque événement importé" -#: agenda_culturel/models.py:1986 +#: agenda_culturel/models.py:2017 msgid "Tags for each imported event" msgstr "Étiquettes de chaque événement importé" -#: agenda_culturel/models.py:1987 +#: agenda_culturel/models.py:2018 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:2016 +#: agenda_culturel/models.py:2047 msgid "Running" msgstr "En cours" -#: agenda_culturel/models.py:2017 +#: agenda_culturel/models.py:2048 msgid "Canceled" msgstr "Annulé" -#: agenda_culturel/models.py:2018 +#: agenda_culturel/models.py:2049 msgid "Success" msgstr "Succès" -#: agenda_culturel/models.py:2019 +#: agenda_culturel/models.py:2050 msgid "Failed" msgstr "Erreur" -#: agenda_culturel/models.py:2022 +#: agenda_culturel/models.py:2053 msgid "Batch importation" msgstr "Importation par lot" -#: agenda_culturel/models.py:2023 +#: agenda_culturel/models.py:2054 msgid "Batch importations" msgstr "Importations par lot" -#: agenda_culturel/models.py:2036 +#: agenda_culturel/models.py:2067 msgid "Reference to the recurrent import processing" msgstr "Référence du processus d'import récurrent" -#: agenda_culturel/models.py:2044 +#: agenda_culturel/models.py:2075 msgid "URL (if not recurrent import)" msgstr "URL (si pas d'import récurrent)" -#: agenda_culturel/models.py:2046 +#: agenda_culturel/models.py:2077 msgid "Source URL if no RecurrentImport is associated." msgstr "URL source si aucun import récurrent n'est associé" -#: agenda_culturel/models.py:2059 +#: agenda_culturel/models.py:2090 msgid "Error message" msgstr "Votre message" -#: agenda_culturel/models.py:2063 +#: agenda_culturel/models.py:2094 msgid "Number of collected events" msgstr "Nombre d'événements collectés" -#: agenda_culturel/models.py:2066 +#: agenda_culturel/models.py:2097 msgid "Number of imported events" msgstr "Nombre d'événements importés" -#: agenda_culturel/models.py:2069 +#: agenda_culturel/models.py:2100 msgid "Number of updated events" msgstr "Nombre d'événements mis à jour" -#: agenda_culturel/models.py:2072 +#: agenda_culturel/models.py:2103 msgid "Number of removed events" msgstr "Nombre d'événements supprimés" -#: agenda_culturel/models.py:2080 +#: agenda_culturel/models.py:2111 msgid "Weight" msgstr "Poids" -#: agenda_culturel/models.py:2081 +#: agenda_culturel/models.py:2112 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:2088 +#: agenda_culturel/models.py:2119 msgid "Category applied to the event" msgstr "Catégorie appliquée à l'événement" -#: agenda_culturel/models.py:2093 +#: agenda_culturel/models.py:2124 msgid "Contained in the title" msgstr "Contenu dans le titre" -#: agenda_culturel/models.py:2094 +#: agenda_culturel/models.py:2125 msgid "Text contained in the event title" msgstr "Texte contenu dans le titre de l'événement" -#: agenda_culturel/models.py:2100 +#: agenda_culturel/models.py:2131 msgid "Exact title extract" msgstr "Extrait exact du titre" -#: agenda_culturel/models.py:2102 +#: agenda_culturel/models.py:2133 msgid "" "If checked, the extract will be searched for in the title using the exact " "form (capitals, accents)." @@ -990,19 +1010,19 @@ msgstr "" "Si coché, l'extrait sera recherché dans le titre en utilisant la forme " "exacte (majuscules, accents)" -#: agenda_culturel/models.py:2108 +#: agenda_culturel/models.py:2139 msgid "Contained in the description" msgstr "Contenu dans la description" -#: agenda_culturel/models.py:2109 +#: agenda_culturel/models.py:2140 msgid "Text contained in the description" msgstr "Texte contenu dans la description" -#: agenda_culturel/models.py:2115 +#: agenda_culturel/models.py:2146 msgid "Exact description extract" msgstr "Extrait exact de description" -#: agenda_culturel/models.py:2117 +#: agenda_culturel/models.py:2148 msgid "" "If checked, the extract will be searched for in the description using the " "exact form (capitals, accents)." @@ -1010,19 +1030,19 @@ msgstr "" "Si coché, l'extrait sera recherché dans la description en utilisant la forme " "exacte (majuscules, accents)" -#: agenda_culturel/models.py:2123 +#: agenda_culturel/models.py:2154 msgid "Contained in the location" msgstr "Contenu dans la localisation" -#: agenda_culturel/models.py:2124 +#: agenda_culturel/models.py:2155 msgid "Text contained in the event location" msgstr "Texte contenu dans la localisation de l'événement" -#: agenda_culturel/models.py:2130 +#: agenda_culturel/models.py:2161 msgid "Exact location extract" msgstr "Extrait exact de localisation" -#: agenda_culturel/models.py:2132 +#: agenda_culturel/models.py:2163 msgid "" "If checked, the extract will be searched for in the location using the exact " "form (capitals, accents)." @@ -1030,15 +1050,15 @@ msgstr "" "Si coché, l'extrait sera recherché dans la localisation en utilisant la " "forme exacte (majuscules, accents)" -#: agenda_culturel/models.py:2140 +#: agenda_culturel/models.py:2171 msgid "Location from place" msgstr "Localisation depuis le lieu" -#: agenda_culturel/models.py:2149 +#: agenda_culturel/models.py:2180 msgid "Categorisation rule" msgstr "Règle de catégorisation" -#: agenda_culturel/models.py:2150 +#: agenda_culturel/models.py:2181 msgid "Categorisation rules" msgstr "Règles de catégorisation" @@ -1046,27 +1066,27 @@ msgstr "Règles de catégorisation" msgid "French" msgstr "français" -#: agenda_culturel/views.py:154 +#: agenda_culturel/views.py:155 msgid "Recurrent import name" msgstr "Nome de l'import récurrent" -#: agenda_culturel/views.py:155 +#: agenda_culturel/views.py:156 msgid "Add another" msgstr "Ajouter un autre" -#: agenda_culturel/views.py:156 +#: agenda_culturel/views.py:157 msgid "Browse..." msgstr "Naviguer..." -#: agenda_culturel/views.py:157 +#: agenda_culturel/views.py:158 msgid "No file selected." msgstr "Pas de fichier sélectionné." -#: agenda_culturel/views.py:293 +#: agenda_culturel/views.py:294 msgid "The static content has been successfully updated." msgstr "Le contenu statique a été modifié avec succès." -#: agenda_culturel/views.py:301 +#: agenda_culturel/views.py:302 msgid "" "The event cannot be updated because the import process is not available for " "the referenced sources." @@ -1074,37 +1094,37 @@ 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:304 +#: agenda_culturel/views.py:305 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:314 +#: agenda_culturel/views.py:315 msgid "The event has been successfully modified." msgstr "L'événement a été modifié avec succès." -#: agenda_culturel/views.py:365 +#: agenda_culturel/views.py:367 msgid "The event {} has been moderated with success." msgstr "L'événement {} a été modéré avec succès." -#: agenda_culturel/views.py:480 +#: agenda_culturel/views.py:482 msgid "The event has been successfully deleted." msgstr "L'événement a été supprimé avec succès." -#: agenda_culturel/views.py:522 +#: agenda_culturel/views.py:524 msgid "Comment" msgstr "Commentaire" -#: agenda_culturel/views.py:541 +#: agenda_culturel/views.py:542 msgid "The status has been successfully modified." msgstr "Le status a été modifié avec succès." -#: agenda_culturel/views.py:575 +#: agenda_culturel/views.py:576 msgid "The event was created: {}." msgstr "L'événement a été créé: {}." -#: agenda_culturel/views.py:577 +#: agenda_culturel/views.py:578 msgid "" "The event has been submitted and will be published as soon as it has been " "validated by the moderation team." @@ -1112,82 +1132,86 @@ 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:671 agenda_culturel/views.py:723 +#: agenda_culturel/views.py:591 +msgid "during the creation process" +msgstr "pendant le processus d'import" + +#: agenda_culturel/views.py:682 agenda_culturel/views.py:746 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:676 agenda_culturel/views.py:729 +#: agenda_culturel/views.py:687 agenda_culturel/views.py:752 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:686 +#: agenda_culturel/views.py:697 msgid "Integrating {} url(s) into our import process." msgstr "Intégration de {} url(s) dans notre processus d'import." -#: agenda_culturel/views.py:736 +#: agenda_culturel/views.py:759 msgid "Integrating {} into our import process." msgstr "Intégration de {} dans notre processus d'import." -#: agenda_culturel/views.py:794 +#: agenda_culturel/views.py:817 msgid "Your message has been sent successfully." msgstr "Votre message a été envoyé avec succès." -#: agenda_culturel/views.py:822 +#: agenda_culturel/views.py:845 msgid "Reporting the event {} on {}" msgstr "Signaler l'événement {} du {}" -#: agenda_culturel/views.py:832 +#: agenda_culturel/views.py:855 msgid "The contact message has been successfully deleted." msgstr "Le message de contact a été supprimé avec succès." -#: agenda_culturel/views.py:846 +#: agenda_culturel/views.py:869 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:1015 +#: agenda_culturel/views.py:1038 msgid "Spam has been successfully deleted." msgstr "Le spam a été supprimé avec succès" -#: agenda_culturel/views.py:1138 +#: agenda_culturel/views.py:1161 msgid "The import has been run successfully." msgstr "L'import a été lancé avec succès" -#: agenda_culturel/views.py:1157 +#: agenda_culturel/views.py:1180 msgid "The import has been canceled." msgstr "L'import a été annulé" -#: agenda_culturel/views.py:1235 +#: agenda_culturel/views.py:1258 msgid "The recurrent import has been successfully modified." msgstr "L'import récurrent a été modifié avec succès." -#: agenda_culturel/views.py:1244 +#: agenda_culturel/views.py:1267 msgid "The recurrent import has been successfully deleted." msgstr "L'import récurrent a été supprimé avec succès" -#: agenda_culturel/views.py:1284 +#: agenda_culturel/views.py:1307 msgid "The import has been launched." msgstr "L'import a été lancé" -#: agenda_culturel/views.py:1306 +#: agenda_culturel/views.py:1329 msgid "Imports has been launched." msgstr "Les imports ont été lancés" -#: agenda_culturel/views.py:1368 +#: agenda_culturel/views.py:1391 msgid "Update successfully completed." msgstr "Mise à jour réalisée avec succès." -#: agenda_culturel/views.py:1429 +#: agenda_culturel/views.py:1452 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:1465 +#: agenda_culturel/views.py:1488 msgid "Events have been marked as unduplicated." msgstr "Les événements ont été marqués comme non dupliqués." -#: agenda_culturel/views.py:1479 agenda_culturel/views.py:1488 -#: agenda_culturel/views.py:1506 +#: agenda_culturel/views.py:1502 agenda_culturel/views.py:1511 +#: agenda_culturel/views.py:1529 msgid "" "The selected item is no longer included in the list of duplicates. Someone " "else has probably modified the list in the meantime." @@ -1195,23 +1219,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:1482 +#: agenda_culturel/views.py:1505 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:1497 +#: agenda_culturel/views.py:1520 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:1541 +#: agenda_culturel/views.py:1564 msgid "Cleaning up duplicates: {} item(s) fixed." msgstr "Nettoyage des dupliqués: {} élément(s) corrigé(s)." -#: agenda_culturel/views.py:1590 +#: agenda_culturel/views.py:1614 msgid "The event was successfully duplicated." msgstr "L'événement a été marqué dupliqué avec succès." -#: agenda_culturel/views.py:1598 +#: agenda_culturel/views.py:1622 msgid "" "The event has been successfully flagged as a duplicate. The moderation team " "will deal with your suggestion shortly." @@ -1219,32 +1243,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:1651 +#: agenda_culturel/views.py:1675 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:1660 +#: agenda_culturel/views.py:1684 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:1682 +#: agenda_culturel/views.py:1706 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:1689 +#: agenda_culturel/views.py:1713 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:1696 agenda_culturel/views.py:1749 +#: agenda_culturel/views.py:1720 agenda_culturel/views.py:1773 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:1735 +#: agenda_culturel/views.py:1759 msgid "" "The rules were successfully applied and 1 event with default category was " "categorised." @@ -1252,7 +1276,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:1742 +#: agenda_culturel/views.py:1766 msgid "" "The rules were successfully applied and {} events with default category were " "categorised." @@ -1260,58 +1284,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:1834 agenda_culturel/views.py:1896 -#: agenda_culturel/views.py:1934 +#: agenda_culturel/views.py:1858 agenda_culturel/views.py:1920 +#: agenda_culturel/views.py:1958 msgid "{} events have been updated." msgstr "{} événements ont été mis à jour." -#: agenda_culturel/views.py:1837 agenda_culturel/views.py:1898 -#: agenda_culturel/views.py:1937 +#: agenda_culturel/views.py:1861 agenda_culturel/views.py:1922 +#: agenda_culturel/views.py:1961 msgid "1 event has been updated." msgstr "1 événement a été mis à jour" -#: agenda_culturel/views.py:1839 agenda_culturel/views.py:1900 -#: agenda_culturel/views.py:1939 +#: agenda_culturel/views.py:1863 agenda_culturel/views.py:1924 +#: agenda_culturel/views.py:1963 msgid "No events have been modified." msgstr "Aucun événement n'a été modifié." -#: agenda_culturel/views.py:1848 +#: agenda_culturel/views.py:1872 msgid "The place has been successfully updated." msgstr "Le lieu a été modifié avec succès." -#: agenda_culturel/views.py:1857 +#: agenda_culturel/views.py:1881 msgid "The place has been successfully created." msgstr "Le lieu a été créé avec succès." -#: agenda_culturel/views.py:1922 +#: agenda_culturel/views.py:1946 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:1926 +#: agenda_culturel/views.py:1950 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:2028 +#: agenda_culturel/views.py:2052 msgid "The organisation has been successfully updated." msgstr "L'organisme a été modifié avec succès." -#: agenda_culturel/views.py:2037 +#: agenda_culturel/views.py:2061 msgid "The organisation has been successfully created." msgstr "L'organisme a été créé avec succès." -#: agenda_culturel/views.py:2054 +#: agenda_culturel/views.py:2078 msgid "The tag has been successfully updated." msgstr "L'étiquette a été modifiée avec succès." -#: agenda_culturel/views.py:2061 +#: agenda_culturel/views.py:2085 msgid "The tag has been successfully created." msgstr "L'étiquette a été créée avec succès." -#: agenda_culturel/views.py:2125 +#: agenda_culturel/views.py:2149 msgid "You have not modified the tag name." msgstr "Vous n'avez pas modifié le nom de l'étiquette." -#: agenda_culturel/views.py:2135 +#: agenda_culturel/views.py:2159 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 " @@ -1324,7 +1348,7 @@ msgstr "" "sera supprimée, et tous les événements associés à l'étiquette {} seront " "associés à l'étiquette {}." -#: agenda_culturel/views.py:2142 +#: agenda_culturel/views.py:2166 msgid "" "This tag {} is already in use. You can force renaming by checking the " "corresponding option." @@ -1332,14 +1356,14 @@ msgstr "" "Cette étiquette {} est déjà utilisée. Vous pouvez forcer le renommage en " "cochant l'option correspondante." -#: agenda_culturel/views.py:2176 +#: agenda_culturel/views.py:2200 msgid "The tag {} has been successfully renamed to {}." msgstr "L'étiquette {} a été renommée avec succès en {}." -#: agenda_culturel/views.py:2214 +#: agenda_culturel/views.py:2238 msgid "The tag {} has been successfully deleted." msgstr "L'événement {} a été supprimé avec succès." -#: agenda_culturel/views.py:2235 +#: agenda_culturel/views.py:2259 msgid "Cache successfully cleared." msgstr "Le cache a été vidé avec succès." diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 4c87da6..2dc34be 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -1182,6 +1182,12 @@ class Event(models.Model): key = make_template_fragment_key("event_body", [is_auth, self]) cache.delete(key) + # save message if required + if self.has_message(): + msg = self.get_message() + msg.related_event = self + msg.save() + # then if its a clone, update the representative if clone: self.other_versions.representative = self @@ -1198,6 +1204,8 @@ class Event(models.Model): def from_structure(event_structure, import_source=None): # organisers is a manytomany relation thus cannot be initialised before creation of the event organisers = event_structure.pop('organisers', None) + email = event_structure.pop('email', None) + comments = event_structure.pop('comments', None) if "category" in event_structure and event_structure["category"] is not None: try: @@ -1276,6 +1284,8 @@ 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)) return result diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index bf0c700..a040f65 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -1564,8 +1564,11 @@ label.required::after { } } -.maskable_group .body_group.closed { - display: none; +.maskable_group { + margin: 0.5em 0; + .body_group.closed { + display: none; + } } .form-place { diff --git a/src/agenda_culturel/templates/agenda_culturel/import.html b/src/agenda_culturel/templates/agenda_culturel/import.html index c867298..a107ea2 100644 --- a/src/agenda_culturel/templates/agenda_culturel/import.html +++ b/src/agenda_culturel/templates/agenda_culturel/import.html @@ -21,7 +21,7 @@
{% csrf_token %} {{ form.media }} - {{ form.as_p }} + {{ form }}

Si tu as plein d'événements à ajouter, tu peux les ajouter par lots.

diff --git a/src/agenda_culturel/templates/agenda_culturel/import_set.html b/src/agenda_culturel/templates/agenda_culturel/import_set.html index dec6521..1173bbf 100644 --- a/src/agenda_culturel/templates/agenda_culturel/import_set.html +++ b/src/agenda_culturel/templates/agenda_culturel/import_set.html @@ -28,6 +28,12 @@ {{ formset.management_form }} {% csrf_token %} + {% if contactform %} +
+ {{ contactform }} +
+ {% endif %} + {% for form in formset %}
diff --git a/src/agenda_culturel/templates/agenda_culturel/page-event.html b/src/agenda_culturel/templates/agenda_culturel/page-event.html index 81bbdcf..7abd7fc 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page-event.html +++ b/src/agenda_culturel/templates/agenda_culturel/page-event.html @@ -47,7 +47,10 @@
{{ step.timestamp }}
-
Message{% if step.data.related_event and event != step.data.related_event %} sur une autre version{% endif %} : {{ step.data.subject|truncatechars:20 }} {% if step.data.user %} par {{ step.data.user }}{% else %} par {{ step.data.name }}{% if step.data.email %} ({{ step.data.email }}){% endif %}{% endif %}
+
Message{% if step.data.related_event and event != step.data.related_event %} sur + une autre version{% endif %} : + {{ step.data.subject|truncatechars:20 }} + {% if step.data.user %} par {{ step.data.user }}{% else %} par {% if step.data.name %}{{ step.data.name }}{% if step.data.email %} ({{ step.data.email }}){% endif %}{% else %} {{ step.data.email }}{% endif %}{% endif %}
{{ step.data.message|safe }}
{% if step.data.comments %}
Commentaire : {{ step.data.comments }}
diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 6474766..d765ecc 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -25,11 +25,9 @@ from django.urls import reverse from collections import Counter import emoji -from django.forms import formset_factory - from .forms import ( - URLSubmissionForm, EventForm, + EventFormWithContact, BatchImportationForm, FixDuplicates, SelectEventInList, @@ -45,6 +43,9 @@ from .forms import ( TagRenameForm, MessageForm, MessageEventForm, + URLSubmissionFormWithContact, + URLSubmissionFormSet, + SimpleContactForm, ) from .filters import ( @@ -496,7 +497,6 @@ class EventDetailView(UserPassesTestMixin, DetailView, ModelFormMixin): def get_object(self): o = super().get_object() - logger.warning(">>>> details") o.download_missing_image() y = self.kwargs["year"] m = self.kwargs["month"] @@ -558,7 +558,7 @@ def import_event_proxy(request): class EventCreateView(SuccessMessageMixin, CreateView): model = Event - form_class = EventForm + form_class = EventFormWithContact def get_form_kwargs(self): kwargs = super().get_form_kwargs() @@ -585,6 +585,10 @@ class EventCreateView(SuccessMessageMixin, CreateView): if form.cleaned_data['cloning']: form.instance.set_in_moderation_process() + + if form.cleaned_data["email"] or form.cleaned_data["comments"]: + form.instance.set_message( + Message(subject=_('during the creation process'), message=form.cleaned_data["comments"], email=form.cleaned_data["email"])) form.instance.import_sources = None form.instance.set_processing_user(self.request.user) @@ -658,11 +662,14 @@ class URLEventEvaluation: def import_from_urls(request): - URLSubmissionFormSet = formset_factory(URLSubmissionForm, extra=9, min_num=1) + if request.method == "POST": formset = URLSubmissionFormSet(request.POST, request.FILES) - if formset.is_valid(): + + if not request.user.is_authenticated: + contactform = SimpleContactForm(request.POST) + if formset.is_valid() and (request.user.is_authenticated or contactform.is_valid()): # evaluate all the forms ucat = [URLEventEvaluation(form, request.user.is_authenticated) for form in formset.forms] @@ -689,20 +696,32 @@ def import_from_urls(request): request, _('Integrating {} url(s) into our import process.').format(len(ucat)) ) - import_events_from_urls.delay(ucat, user_id=request.user.pk if request.user else None) + email = None + comments = None + if not request.user.is_authenticated: + email = contactform.cleaned_data["email"] + comments = contactform.cleaned_data["comments"] + import_events_from_urls.delay(ucat, + user_id=request.user.pk if request.user else None, + email=email, comments=comments) return HttpResponseRedirect(reverse("thank_you")) else: return HttpResponseRedirect(reverse("home")) else: formset = URLSubmissionFormSet() + if not request.user.is_authenticated: + contactform = SimpleContactForm() - return render(request, "agenda_culturel/import_set.html", context={"formset": formset}) + context = {"formset": formset} + if not request.user.is_authenticated: + context["contactform"] = contactform + return render(request, "agenda_culturel/import_set.html", context=context) def import_from_url(request): - form = URLSubmissionForm() + form = URLSubmissionFormWithContact(is_authenticated=request.user.is_authenticated) initial = { "start_day": date.today() + timedelta(days=1), @@ -714,7 +733,7 @@ def import_from_url(request): # if the form has been sent if request.method == "POST": - form = URLSubmissionForm(request.POST) + form = URLSubmissionFormWithContact(request.POST, is_authenticated=request.user.is_authenticated) # if the form is valid if form.is_valid(): @@ -739,7 +758,7 @@ def import_from_url(request): request, _('Integrating {} into our import process.').format(uc.url) ) - import_events_from_url.delay(uc.url, uc.cat, uc.tags, user_id=request.user.pk if request.user else None) + import_events_from_url.delay(uc.url, uc.cat, uc.tags, user_id=request.user.pk if request.user else None, email=form.cleaned_data.get("email"), comments=form.cleaned_data.get("comments")) return HttpResponseRedirect(reverse("thank_you"))