diff --git a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po index 5fb4d84..7d0ad3d 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: 2023-12-16 18:21+0000\n" +"POT-Creation-Date: 2023-12-16 20:13+0000\n" "PO-Revision-Date: 2023-10-29 14:16+0000\n" "Last-Translator: Jean-Marie Favreau \n" "Language-Team: Jean-Marie Favreau \n" @@ -34,7 +34,7 @@ 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/models.py:19 agenda_culturel/models.py:48 -#: agenda_culturel/models.py:179 +#: agenda_culturel/models.py:183 msgid "Name" msgstr "Nom" @@ -204,47 +204,47 @@ msgstr "Événement" msgid "Events" msgstr "Événements" -#: agenda_culturel/models.py:178 +#: agenda_culturel/models.py:182 msgid "Subject" msgstr "Sujet" -#: agenda_culturel/models.py:178 +#: agenda_culturel/models.py:182 msgid "The subject of your message" msgstr "Sujet de votre message" -#: agenda_culturel/models.py:179 +#: agenda_culturel/models.py:183 msgid "Your name" msgstr "Votre nom" -#: agenda_culturel/models.py:180 +#: agenda_culturel/models.py:184 msgid "Email address" msgstr "Adresse email" -#: agenda_culturel/models.py:180 +#: agenda_culturel/models.py:184 msgid "Your email address" msgstr "Votre adresse email" -#: agenda_culturel/models.py:181 +#: agenda_culturel/models.py:185 msgid "Message" msgstr "Message" -#: agenda_culturel/models.py:181 +#: agenda_culturel/models.py:185 msgid "Your message" msgstr "Votre message" -#: agenda_culturel/models.py:185 +#: agenda_culturel/models.py:189 agenda_culturel/views.py:334 msgid "Closed" msgstr "Fermé" -#: agenda_culturel/models.py:185 +#: agenda_culturel/models.py:189 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:186 +#: agenda_culturel/models.py:190 msgid "Comments" msgstr "Commentaires" -#: agenda_culturel/models.py:186 +#: agenda_culturel/models.py:190 msgid "Comments on the message from the moderation team" msgstr "Commentaires sur ce message par l'équipe de modération" @@ -260,23 +260,19 @@ msgstr "français" msgid "The static content has been successfully updated." msgstr "Le contenu statique a été modifié avec succès." -#: agenda_culturel/views.py:191 -msgid "Your message has been sent successfully." -msgstr "L'événement a été supprimé avec succès" - -#: agenda_culturel/views.py:197 +#: agenda_culturel/views.py:188 msgid "The event has been successfully modified." msgstr "L'événement a été modifié avec succès." -#: agenda_culturel/views.py:208 +#: agenda_culturel/views.py:199 msgid "The event has been successfully deleted." msgstr "L'événement a été supprimé avec succès" -#: agenda_culturel/views.py:246 +#: agenda_culturel/views.py:237 msgid "The event is saved." msgstr "L'événement est enregistré." -#: agenda_culturel/views.py:249 +#: agenda_culturel/views.py:240 msgid "" "The event has been submitted and will be published as soon as it has been " "validated by the moderation team." @@ -284,7 +280,7 @@ 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:279 +#: agenda_culturel/views.py:270 msgid "" "The event has been successfully extracted, and you can now submit it after " "modifying it if necessary." @@ -292,7 +288,7 @@ msgstr "" "L'événement a été extrait avec succès, vous pouvez maintenant le soumettre " "après l'avoir modifié au besoin." -#: agenda_culturel/views.py:283 +#: agenda_culturel/views.py:274 msgid "" "Unable to extract an event from the proposed URL. Please use the form below " "to submit the event." @@ -300,11 +296,12 @@ msgstr "" "Impossible d'extraire un événement depuis l'URL proposée. Veuillez utiliser " "le formulaire ci-dessous pour soumettre l'événement." -#: agenda_culturel/views.py:292 +#: agenda_culturel/views.py:283 msgid "This URL has already been submitted, and you can find the event below." -msgstr "Cette URL a déjà été soumise, et vous trouverez l'événement ci-dessous." +msgstr "" +"Cette URL a déjà été soumise, et vous trouverez l'événement ci-dessous." -#: agenda_culturel/views.py:296 +#: agenda_culturel/views.py:287 msgid "" "This URL has already been submitted, but has not been selected for " "publication by the moderation team." @@ -312,10 +309,22 @@ msgstr "" "Cette URL a déjà été soumise, mais n'a pas été retenue par l'équipe de " "modération pour la publication." -#: agenda_culturel/views.py:298 +#: agenda_culturel/views.py:289 msgid "This URL has already been submitted and is awaiting moderation." msgstr "Cette URL a déjà été soumise, et est en attente de modération" -#: agenda_culturel/views.py:329 +#: agenda_culturel/views.py:311 +msgid "Your message has been sent successfully." +msgstr "L'événement a été supprimé avec succès" + +#: agenda_culturel/views.py:319 +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:334 +msgid "Open" +msgstr "Ouvert" + +#: agenda_culturel/views.py:374 msgid "Search" msgstr "Rechercher" diff --git a/src/agenda_culturel/migrations/0010_alter_contactmessage_comments.py b/src/agenda_culturel/migrations/0010_alter_contactmessage_comments.py new file mode 100644 index 0000000..fec7fd1 --- /dev/null +++ b/src/agenda_culturel/migrations/0010_alter_contactmessage_comments.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.7 on 2023-12-16 19:54 + +import ckeditor.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('agenda_culturel', '0009_contactmessage_comments_alter_contactmessage_message'), + ] + + operations = [ + migrations.AlterField( + model_name='contactmessage', + name='comments', + field=ckeditor.fields.RichTextField(blank=True, default='', help_text='Comments on the message from the moderation team', null=True, verbose_name='Comments'), + ), + ] diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index e3b1936..8d590b9 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -172,6 +172,10 @@ class Event(models.Model): def modified(self): return abs((self.modified_date - self.created_date).total_seconds()) > 1 + def nb_draft_events(): + return Event.objects.filter(status=Event.STATUS.DRAFT).count() + + class ContactMessage(models.Model): @@ -183,5 +187,7 @@ class ContactMessage(models.Model): date = models.DateTimeField(auto_now_add=True) closed = models.BooleanField(verbose_name=_('Closed'), help_text=_('this message has been processed and no longer needs to be handled'), default=False) - comments = RichTextField(verbose_name=_('Comments'), help_text=_('Comments on the message from the moderation team'), default="") + comments = RichTextField(verbose_name=_('Comments'), help_text=_('Comments on the message from the moderation team'), default="", blank=True, null=True) + def nb_open_contactmessages(): + return ContactMessage.objects.filter(closed=False).count() diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index a875238..22c34e1 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -599,8 +599,10 @@ nav .badge { @extend [role="button"]; font-size: 70%; padding: 0.2em .8em; - border-radius: 40%; - + border-radius: .5em; + svg { + vertical-align: -0.125em; + } } form [role="button"] { @@ -616,4 +618,13 @@ form [role="button"] { grid-column-gap: var(--nav-element-spacing-vertical); grid-template-columns: auto 25%; } - } \ No newline at end of file + } + +aside nav a.selected { + background: var(--primary-focus); +} +aside nav a.badge { + float: right; + z-index: 1; + margin-top: -2em; +} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/contactmessage_create_form.html b/src/agenda_culturel/templates/agenda_culturel/contactmessage_create_form.html new file mode 100644 index 0000000..8ac2692 --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/contactmessage_create_form.html @@ -0,0 +1,35 @@ +{% extends "agenda_culturel/page.html" %} +{% load static %} + +{% block title %}Contact{% endblock %} + +{% block entete_header %} + + + + + + +{% endblock %} + + +{% block content %} + +

Contact

+ +
+{% url 'contact' as local_url %} +{% include "agenda_culturel/static_content.html" with name="contact" url_path=local_url %} +
+ +
+ +

Attention : n'utilisez pas le formulaire ci-dessous pour proposer un événement, il sera ignoré. Utilisez plutôt la page ajouter un événement.

+ +
{% csrf_token %} + {{ form.as_p }} + +
+
+ +{% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/contactmessage_moderation_form.html b/src/agenda_culturel/templates/agenda_culturel/contactmessage_moderation_form.html new file mode 100644 index 0000000..833c894 --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/contactmessage_moderation_form.html @@ -0,0 +1,43 @@ +{% extends "agenda_culturel/page.html" %} +{% load static %} + +{% block title %}Message de contact : {{ obj.subject }}{% endblock %} + +{% block entete_header %} + + + + + + +{% endblock %} + + +{% block content %} +
+
+
+
+

Modération du message « {{ object.subject }} »

+ +
+
+ {{ object.message }} +
+
+ +
+
{% csrf_token %} + {{ form.as_p }} + +
+
+
+ +{% include "agenda_culturel/side-nav.html" with current="contactmessages" %} +
+ +{% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/contactmessages.html b/src/agenda_culturel/templates/agenda_culturel/contactmessages.html new file mode 100644 index 0000000..e0add62 --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/contactmessages.html @@ -0,0 +1,63 @@ +{% extends "agenda_culturel/page.html" %} + +{% block title %}Derniers messages de contact reçus{% endblock %} + +{% load utils_extra %} +{% load cat_extra %} +{% block entete_header %} + {% css_categories %} +{% endblock %} + +{% block content %} +
+
+
+

Derniers messages de contact reçus

+
+ {{ filter.form }}
+
+
+ + + + + + + + + + + + {% for obj in paginator_filter %} + + + + + + + {% endfor %} + +
DateSujetAuteurFermé
{{ obj.date }}{{ obj.subject }}{{ obj.name }}{% if obj.closed %}{% picto_from_name "check-square" "fermé" %}{% else %}{% picto_from_name "square" "ouvert" %}{% endif %}
+
+ + {% if paginator_filter.has_previous %} + « premier + précédent + {% endif %} + + + Page {{ paginator_filter.number }} sur {{ paginator_filter.paginator.num_pages }} + + + {% if paginator_filter.has_next %} + suivant + dernier » + {% endif %} + +
+
+ +{% include "agenda_culturel/side-nav.html" with current="contactmessages" %} +
+ +{% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/moderation.html b/src/agenda_culturel/templates/agenda_culturel/moderation.html index b3ce143..3ff00b4 100644 --- a/src/agenda_culturel/templates/agenda_culturel/moderation.html +++ b/src/agenda_culturel/templates/agenda_culturel/moderation.html @@ -43,22 +43,7 @@ - +{% include "agenda_culturel/side-nav.html" with current="moderation" %} {% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/page.html b/src/agenda_culturel/templates/agenda_culturel/page.html index 23fd797..f6325b0 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page.html +++ b/src/agenda_culturel/templates/agenda_culturel/page.html @@ -23,6 +23,7 @@ {% endblock %} {% load event_extra %} +{% load contactmessages_extra %} {% load utils_extra %}