From b94e3917925c4810f27292c3d39c8deddbb624d6 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sun, 5 Nov 2023 13:34:49 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'=C3=A9dition=20des=20=C3=A9v?= =?UTF-8?q?=C3=A9nements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/static/style.scss | 13 ++++ .../templates/agenda_culturel/event-inc.html | 69 +++++++++++-------- .../agenda_culturel/event_confirm_delete.html | 15 ++++ .../agenda_culturel/event_create_form.html | 13 ++++ .../templates/agenda_culturel/event_form.html | 15 ++++ .../templates/agenda_culturel/list.html | 5 ++ .../templates/agenda_culturel/page.html | 1 + src/agenda_culturel/urls.py | 3 + src/agenda_culturel/views.py | 19 +++++ 9 files changed, 124 insertions(+), 29 deletions(-) create mode 100644 src/agenda_culturel/templates/agenda_culturel/event_confirm_delete.html create mode 100644 src/agenda_culturel/templates/agenda_culturel/event_create_form.html create mode 100644 src/agenda_culturel/templates/agenda_culturel/event_form.html diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index 99a7048..f1f8940 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -148,3 +148,16 @@ footer { clear: both; } +.infos-and-buttons { + display: flex; + flex-direction: row; + align-items: stretch +} + +.infos-and-buttons .infos { + flex: 50; +} + +.infos-and-buttons .buttons { + flex: auto; +} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/event-inc.html b/src/agenda_culturel/templates/agenda_culturel/event-inc.html index 7366959..919d027 100644 --- a/src/agenda_culturel/templates/agenda_culturel/event-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/event-inc.html @@ -3,6 +3,12 @@ {% load utils_extra %} {% load event_extra %} +{% comment %} + TODO: + * utiliser flex plutôt que float pour l'image et pour la date + * gérer le flex des boutons dans le cas de petits écrans +{% endcomment %} +
{% if display in "in list by day" %} {% if display == "in list by day" and event|can_show_start_time %} @@ -76,39 +82,44 @@ {% comment %} On affiche le pied qui contient les informations de tags, catégories, etc {% endcomment %} -
-

- {% if mode %} - {% if category %} - {{ event.category | small_cat }} +

+
+

+ {% if mode %} + {% if category %} + {{ event.category | small_cat }} + {% else %} + {% url 'view_mode_cat' selected_mode.name event.category.pk as url_cat %} + {{ event.category | small_cat:url_cat }} + {% endif %} {% else %} - {% url 'view_mode_cat' selected_mode.name event.category.pk as url_cat %} - {{ event.category | small_cat:url_cat }} + {{ event.category | small_cat }} {% endif %} - {% else %} - {{ event.category | small_cat }} - {% endif %} -

-

- {% for tag in event.tags %} - {{ tag }} +

+

+ {% for tag in event.tags %} + {{ tag }} + {% endfor %} +

+ + {% if event.reference_urls %} + {% if display in "in list by day" %} +

Source{{ event.reference_urls|pluralize }} : + {% else %} +

Cet événement est proposé par : + {% endif %} + {% for eurl in event.reference_urls %} + {{ eurl|hostname }}{% if not forloop.last %}, {% endif %} {% endfor %} -

- - {% if event.reference_urls %} - {% if display in "in list by day" %} -

Source{{ event.reference_urls|pluralize }} : +

{% else %} -

Cet événement est proposé par : - {% endif %} - {% for eurl in event.reference_urls %} - {{ eurl|hostname }}{% if not forloop.last %}, {% endif %} - {% endfor %} -

-{% else %} -

Cet événement est disponible uniquement sur les nuits énimagmatiques.

-{% endif %} - +

Cet événement est disponible uniquement sur les nuits énimagmatiques.

+ {% endif %} +
+
diff --git a/src/agenda_culturel/templates/agenda_culturel/event_confirm_delete.html b/src/agenda_culturel/templates/agenda_culturel/event_confirm_delete.html new file mode 100644 index 0000000..e783d4b --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/event_confirm_delete.html @@ -0,0 +1,15 @@ +{% extends "agenda_culturel/page.html" %} + +{% block title %}Supprimer {{ object.title }}{% endblock %} + + +{% block content %} + +

Suppression de l'événement {{ object.title }} ({{ object.start_day }})

+
{% csrf_token %} +

Êtes-vous sûr·e de vouloir supprimer l'événement « {{ object }} » ?

+ {{ form }} + +
+ +{% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/event_create_form.html b/src/agenda_culturel/templates/agenda_culturel/event_create_form.html new file mode 100644 index 0000000..d29ad07 --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/event_create_form.html @@ -0,0 +1,13 @@ +{% extends "agenda_culturel/page.html" %} + +{% block title %}Proposer un événement{% endblock %} + + +{% block content %} +

Proposer un événement

+ +
{% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/event_form.html b/src/agenda_culturel/templates/agenda_culturel/event_form.html new file mode 100644 index 0000000..1b44218 --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/event_form.html @@ -0,0 +1,15 @@ +{% extends "agenda_culturel/page.html" %} + +{% block title %}Éditer {{ object.title }}{% endblock %} + + + +{% block content %} +

Édition de l'événement {{ object.title }} ({{ object.start_day }})

+ +
{% csrf_token %} + {{ form.as_p }} + +
+ +{% endblock %} \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/list.html b/src/agenda_culturel/templates/agenda_culturel/list.html index 22283fa..9608ca2 100644 --- a/src/agenda_culturel/templates/agenda_culturel/list.html +++ b/src/agenda_culturel/templates/agenda_culturel/list.html @@ -2,6 +2,11 @@ {% block title %}Tous les événements{% endblock %} +{% comment %} + TODO: + * améliorer le rendu ici +{% endcomment %} + {% block content %}

Derniers événements soumis

diff --git a/src/agenda_culturel/templates/agenda_culturel/page.html b/src/agenda_culturel/templates/agenda_culturel/page.html index 0f077fe..e1dfbbb 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page.html +++ b/src/agenda_culturel/templates/agenda_culturel/page.html @@ -41,6 +41,7 @@ Événements