From 8eaee2b1a6a190ee2b87258d891f503e9434d6b0 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 5 Oct 2024 16:23:52 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20page=20=C3=A9v=C3=A9nements=20?= =?UTF-8?q?=C3=A0=20venir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/calendar.py | 68 +++ .../locale/fr/LC_MESSAGES/django.po | 491 ++++++++++-------- src/agenda_culturel/static/style.scss | 17 +- .../agenda_culturel/page-upcoming.html | 95 ++++ .../templates/agenda_culturel/page.html | 4 +- .../event-in-list-by-day-inc.html | 2 +- .../single-event/event-in-upcoming-inc.html | 83 +++ .../templatetags/event_extra.py | 8 +- src/agenda_culturel/urls.py | 1 + src/agenda_culturel/views.py | 22 + 10 files changed, 576 insertions(+), 215 deletions(-) create mode 100644 src/agenda_culturel/templates/agenda_culturel/page-upcoming.html create mode 100644 src/agenda_culturel/templates/agenda_culturel/single-event/event-in-upcoming-inc.html diff --git a/src/agenda_culturel/calendar.py b/src/agenda_culturel/calendar.py index 4db3056..4f8dd8b 100644 --- a/src/agenda_culturel/calendar.py +++ b/src/agenda_culturel/calendar.py @@ -2,6 +2,9 @@ from datetime import datetime, timedelta, date, time import calendar from django.db.models import Q from django.utils import timezone +from django.utils.translation import gettext_lazy as _ +from django.template.defaultfilters import date as _date + import logging @@ -28,10 +31,12 @@ class DayInCalendar: self.in_past = d < now self.today = d == now + self.tomorrow = d == now + timedelta(days=+1) self.events = [] self.on_requested_interval = on_requested_interval self.events_by_category = {} + self.time_intervals = None def is_in_past(self): return self.in_past @@ -39,6 +44,9 @@ class DayInCalendar: def is_today(self): return self.today + def is_tomorrow(self): + return self.tomorrow + def is_ancestor_uuid_event_from_other(self, event): for e in self.events: if event.is_ancestor_by_uuid(e): @@ -114,6 +122,51 @@ class DayInCalendar: result.append((c.name, self.events_by_category[c.name])) return result + def build_time_intervals(self, all_day_name, interval_names, interval_markers): + self.time_intervals = [IntervalInDay(self.date, i, n) for i, n in enumerate([all_day_name] + interval_names)] + + nm2 = datetime.now() + timedelta(hours=-2) + for e in self.events: + if e.start_time is None: + self.time_intervals[0].add_event(e) + else: + dt = datetime.combine(e.start_day, e.start_time) + if dt >= nm2: + ok = False + for i in range(len(interval_markers)): + if dt < interval_markers[i]: + self.time_intervals[i + 1].add_event(e) + ok = True + break + if not ok: + self.time_intervals[-1].add_event(e) + + def get_time_intervals(self): + if self.time_intervals is None: + if self.is_today(): + all_day_name = _('All day today') + interval_names = [_('This morning'), _('This noon'), _('This afternoon'), _('This evening')] + elif self.is_tomorrow(): + name = _("Tomorrow") + all_day_name = _('All day tomorrow') + interval_names = [_('%s morning') % name, _('%s noon') % name, _('%s afternoon') % name, _('%s evening') % name] + else: + name = _date(self.date, "l") + all_day_name = _('All day %s') % name + interval_names = [_('%s morning') % name, _('%s noon') % name, _('%s afternoon') % name, _('%s evening') % name] + interval_markers = [datetime.combine(self.date, time(h, m)) for h, m in [(11, 30), (13, 0), (18, 0)]] + self.build_time_intervals(all_day_name, interval_names, interval_markers) + + logger.error("hop " + str(len(self.time_intervals))) + return self.time_intervals + + +class IntervalInDay(DayInCalendar): + + def __init__(self, d, id, name): + self.name = name + self.id = d.strftime('%Y-%m-%d') + '-' + str(id) + super().__init__(d) class CalendarList: def __init__(self, firstdate, lastdate, filter=None, exact=False): @@ -208,6 +261,21 @@ class CalendarList: def calendar_days_list(self): return list(self.get_calendar_days().values()) + def time_intervals_list(self, onlyfirst=False): + ds = self.calendar_days_list() + result = [] + for d in ds: + tis = d.get_time_intervals() + for t in tis: + if len(t.events) > 0: + result.append(t) + if onlyfirst: + break + return result + + def time_intervals_list_first(self): + return self.time_intervals_list(True) + def export_to_ics(self): from .models import Event events = [event for day in self.get_calendar_days().values() for event in day.events] diff --git a/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po b/src/agenda_culturel/locale/fr/LC_MESSAGES/django.po index 5b78164..26ec8ae 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-09-05 22:42+0200\n" +"POT-Creation-Date: 2024-10-05 15:12+0200\n" "PO-Revision-Date: 2023-10-29 14:16+0000\n" "Last-Translator: Jean-Marie Favreau \n" "Language-Team: Jean-Marie Favreau \n" @@ -17,9 +17,62 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: agenda_culturel/forms.py:44 agenda_culturel/models.py:150 -#: agenda_culturel/models.py:317 agenda_culturel/models.py:1315 -#: agenda_culturel/models.py:1412 +#: agenda_culturel/calendar.py:146 +msgid "All day today" +msgstr "Aujourd'hui toute la journée" + +#: agenda_culturel/calendar.py:147 +msgid "This morning" +msgstr "Ce matin" + +#: agenda_culturel/calendar.py:147 +msgid "This noon" +msgstr "Ce midi" + +#: agenda_culturel/calendar.py:147 +msgid "This afternoon" +msgstr "Cet après-midi" + +#: agenda_culturel/calendar.py:147 +msgid "This evening" +msgstr "Ce soir" + +#: agenda_culturel/calendar.py:149 +msgid "Tomorrow" +msgstr "Demain" + +#: agenda_culturel/calendar.py:150 +msgid "All day tomorrow" +msgstr "Toute la journée de demain" + +#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155 +#, python-format +msgid "%s morning" +msgstr "%s matin" + +#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155 +#, python-format +msgid "%s noon" +msgstr "%s midi" + +#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155 +#, python-format +msgid "%s afternoon" +msgstr "%s après-midi" + +#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155 +#, python-format +msgid "%s evening" +msgstr "%s soir" + +#: agenda_culturel/calendar.py:154 +#, python-format +msgid "All day %s" +msgstr "Toute la journée de %s" + +#: agenda_culturel/forms.py:44 agenda_culturel/models.py:168 +#: agenda_culturel/models.py:336 agenda_culturel/models.py:1341 +#: agenda_culturel/models.py:1441 msgid "Category" msgstr "Catégorie" @@ -44,120 +97,134 @@ msgstr "L'heure de fin ne peut pas être avant l'heure de début." msgid "JSON in the format expected for the import." msgstr "JSON dans le format attendu pour l'import" -#: agenda_culturel/forms.py:404 +#: agenda_culturel/forms.py:403 msgid "Apply category {} to the event {}" msgstr "Appliquer la catégorie {} à l'événement {}" -#: agenda_culturel/forms.py:419 agenda_culturel/models.py:241 -#: agenda_culturel/models.py:1464 +#: agenda_culturel/forms.py:418 agenda_culturel/models.py:260 +#: agenda_culturel/models.py:1493 msgid "Place" msgstr "Lieu" -#: agenda_culturel/forms.py:421 +#: agenda_culturel/forms.py:420 msgid "Create a missing place" msgstr "Créer un lieu manquant" -#: agenda_culturel/forms.py:431 +#: agenda_culturel/forms.py:430 msgid "Add \"{}\" to the aliases of the place" msgstr "Ajouter « {} » aux alias du lieu" -#: agenda_culturel/forms.py:458 +#: agenda_culturel/forms.py:457 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/models.py:44 agenda_culturel/models.py:89 -#: agenda_culturel/models.py:220 agenda_culturel/models.py:1194 -#: agenda_culturel/models.py:1261 +#: agenda_culturel/models.py:47 agenda_culturel/models.py:92 +#: agenda_culturel/models.py:239 agenda_culturel/models.py:1220 +#: agenda_culturel/models.py:1287 msgid "Name" msgstr "Nom" -#: agenda_culturel/models.py:45 agenda_culturel/models.py:89 +#: agenda_culturel/models.py:48 agenda_culturel/models.py:92 msgid "Category name" msgstr "Nom de la catégorie" -#: agenda_culturel/models.py:50 +#: agenda_culturel/models.py:53 msgid "Content" msgstr "Contenu" -#: agenda_culturel/models.py:50 +#: agenda_culturel/models.py:53 msgid "Text as shown to the visitors" msgstr "Texte tel que présenté aux visiteureuses" -#: agenda_culturel/models.py:54 +#: agenda_culturel/models.py:57 msgid "URL path" msgstr "Chemin URL" -#: agenda_culturel/models.py:55 +#: agenda_culturel/models.py:58 msgid "URL path where the content is included." msgstr "Chemin URL où le contenu est présent." -#: agenda_culturel/models.py:59 +#: agenda_culturel/models.py:62 msgid "Static content" msgstr "Contenu statique" -#: agenda_culturel/models.py:60 +#: agenda_culturel/models.py:63 msgid "Static contents" msgstr "Contenus statiques" -#: agenda_culturel/models.py:92 +#: agenda_culturel/models.py:95 msgid "Alternative Name" msgstr "Nom alternatif" -#: agenda_culturel/models.py:93 +#: agenda_culturel/models.py:96 msgid "Alternative name used with a time period" msgstr "Nom alternatif utilisé avec une période de temps" -#: agenda_culturel/models.py:97 +#: agenda_culturel/models.py:100 msgid "Short name" msgstr "Nom court" -#: agenda_culturel/models.py:98 +#: agenda_culturel/models.py:101 msgid "Short name of the category" msgstr "Nom court de la catégorie" -#: agenda_culturel/models.py:102 +#: agenda_culturel/models.py:105 msgid "Color" msgstr "Couleur" -#: agenda_culturel/models.py:103 +#: agenda_culturel/models.py:106 msgid "Color used as background for the category" msgstr "Couleur utilisée comme fond de la catégorie" -#: agenda_culturel/models.py:151 +#: agenda_culturel/models.py:112 +msgid "Pictogram" +msgstr "Pictogramme" + +#: agenda_culturel/models.py:113 +#, fuzzy +#| msgid "Short name of the category" +msgid "Pictogram of the category (svg format)" +msgstr "Pictogramme de la catégorie (format svg)" + +#: agenda_culturel/models.py:120 +msgid "Position for ordering categories" +msgstr "Position pour ordonner les catégories" + +#: agenda_culturel/models.py:169 msgid "Categories" msgstr "Catégories" -#: agenda_culturel/models.py:156 agenda_culturel/models.py:157 +#: agenda_culturel/models.py:174 agenda_culturel/models.py:175 msgid "Duplicated events" msgstr "Événements dupliqués" -#: agenda_culturel/models.py:220 +#: agenda_culturel/models.py:239 msgid "Name of the place" msgstr "Nom du lieu" -#: agenda_culturel/models.py:222 +#: agenda_culturel/models.py:241 msgid "Address" msgstr "Adresse" -#: agenda_culturel/models.py:223 +#: agenda_culturel/models.py:242 msgid "Address of this place (without city name)" msgstr "Adresse de ce lieu (sans le nom de la ville)" -#: agenda_culturel/models.py:227 +#: agenda_culturel/models.py:246 msgid "City" msgstr "Ville" -#: agenda_culturel/models.py:227 +#: agenda_culturel/models.py:246 msgid "City name" msgstr "Nom de la ville" -#: agenda_culturel/models.py:232 +#: agenda_culturel/models.py:251 msgid "Alternative names" msgstr "Noms alternatifs" -#: agenda_culturel/models.py:234 +#: agenda_culturel/models.py:253 msgid "" "Alternative names or addresses used to match a place with the free-form " "location of an event." @@ -165,77 +232,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:242 +#: agenda_culturel/models.py:261 msgid "Places" msgstr "Lieux" -#: agenda_culturel/models.py:295 agenda_culturel/models.py:1302 +#: agenda_culturel/models.py:314 agenda_culturel/models.py:1328 msgid "Published" msgstr "Publié" -#: agenda_culturel/models.py:296 +#: agenda_culturel/models.py:315 msgid "Draft" msgstr "Brouillon" -#: agenda_culturel/models.py:297 +#: agenda_culturel/models.py:316 msgid "Trash" msgstr "Corbeille" -#: agenda_culturel/models.py:308 +#: agenda_culturel/models.py:327 msgid "Title" msgstr "Titre" -#: agenda_culturel/models.py:308 +#: agenda_culturel/models.py:327 msgid "Short title" msgstr "Titre court" -#: agenda_culturel/models.py:312 agenda_culturel/models.py:1380 +#: agenda_culturel/models.py:331 agenda_culturel/models.py:1409 msgid "Status" msgstr "Status" -#: agenda_culturel/models.py:318 +#: agenda_culturel/models.py:337 msgid "Category of the event" msgstr "Catégorie de l'événement" -#: agenda_culturel/models.py:325 +#: agenda_culturel/models.py:344 msgid "Day of the event" msgstr "Date de l'événement" -#: agenda_culturel/models.py:328 agenda_culturel/models.py:329 +#: agenda_culturel/models.py:347 agenda_culturel/models.py:348 msgid "Starting time" msgstr "Heure de début" -#: agenda_culturel/models.py:335 +#: agenda_culturel/models.py:354 msgid "End day of the event" msgstr "Fin de l'événement" -#: agenda_culturel/models.py:337 +#: agenda_culturel/models.py:356 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:343 +#: agenda_culturel/models.py:362 msgid "Final time" msgstr "Heure de fin" -#: agenda_culturel/models.py:347 +#: agenda_culturel/models.py:366 msgid "Recurrence" msgstr "Récurrence" -#: agenda_culturel/models.py:352 agenda_culturel/models.py:1307 +#: agenda_culturel/models.py:371 agenda_culturel/models.py:1333 msgid "Location" msgstr "Localisation" -#: agenda_culturel/models.py:353 +#: agenda_culturel/models.py:372 msgid "Address of the event" msgstr "Adresse de l'événement" -#: agenda_culturel/models.py:359 +#: agenda_culturel/models.py:378 msgid "Location (free form)" msgstr "Localisation (forme libre)" -#: agenda_culturel/models.py:361 +#: agenda_culturel/models.py:380 msgid "" "Address of the event in case its not available in the already known places " "(free form)" @@ -243,205 +310,205 @@ 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:370 +#: agenda_culturel/models.py:389 msgid "Description" msgstr "Description" -#: agenda_culturel/models.py:371 +#: agenda_culturel/models.py:390 msgid "General description of the event" msgstr "Description générale de l'événement" -#: agenda_culturel/models.py:377 +#: agenda_culturel/models.py:396 msgid "Illustration (local image)" msgstr "Illustration (image locale)" -#: agenda_culturel/models.py:378 +#: agenda_culturel/models.py:397 msgid "Illustration image stored in the agenda server" msgstr "Image d'illustration stockée sur le serveur de l'agenda" -#: agenda_culturel/models.py:385 +#: agenda_culturel/models.py:404 msgid "Illustration" msgstr "Illustration" -#: agenda_culturel/models.py:386 +#: agenda_culturel/models.py:405 msgid "URL of the illustration image" msgstr "URL de l'image illustrative" -#: agenda_culturel/models.py:392 +#: agenda_culturel/models.py:411 msgid "Illustration description" msgstr "Description de l'illustration" -#: agenda_culturel/models.py:393 +#: agenda_culturel/models.py:412 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:401 +#: agenda_culturel/models.py:420 msgid "Importation source" msgstr "Source d'importation" -#: agenda_culturel/models.py:402 +#: agenda_culturel/models.py:421 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:408 +#: agenda_culturel/models.py:427 msgid "UUIDs" msgstr "UUIDs" -#: agenda_culturel/models.py:409 +#: agenda_culturel/models.py:428 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:415 +#: agenda_culturel/models.py:434 msgid "URLs" msgstr "URLs" -#: agenda_culturel/models.py:416 +#: agenda_culturel/models.py:435 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:423 +#: agenda_culturel/models.py:442 msgid "Tags" msgstr "Étiquettes" -#: agenda_culturel/models.py:424 +#: agenda_culturel/models.py:443 msgid "A list of tags that describe the event." msgstr "Une liste d'étiquettes décrivant l'événement" -#: agenda_culturel/models.py:431 +#: agenda_culturel/models.py:450 msgid "Possibly duplicated" msgstr "Possibles doublons" -#: agenda_culturel/models.py:480 +#: agenda_culturel/models.py:499 msgid "Event" msgstr "Événement" -#: agenda_culturel/models.py:481 +#: agenda_culturel/models.py:500 msgid "Events" msgstr "Événements" -#: agenda_culturel/models.py:1185 +#: agenda_culturel/models.py:1211 msgid "Contact message" msgstr "Message de contact" -#: agenda_culturel/models.py:1186 +#: agenda_culturel/models.py:1212 msgid "Contact messages" msgstr "Messages de contact" -#: agenda_culturel/models.py:1189 +#: agenda_culturel/models.py:1215 msgid "Subject" msgstr "Sujet" -#: agenda_culturel/models.py:1190 +#: agenda_culturel/models.py:1216 msgid "The subject of your message" msgstr "Sujet de votre message" -#: agenda_culturel/models.py:1195 +#: agenda_culturel/models.py:1221 msgid "Your name" msgstr "Votre nom" -#: agenda_culturel/models.py:1201 +#: agenda_culturel/models.py:1227 msgid "Email address" msgstr "Adresse email" -#: agenda_culturel/models.py:1202 +#: agenda_culturel/models.py:1228 msgid "Your email address" msgstr "Votre adresse email" -#: agenda_culturel/models.py:1207 +#: agenda_culturel/models.py:1233 msgid "Message" msgstr "Message" -#: agenda_culturel/models.py:1207 +#: agenda_culturel/models.py:1233 msgid "Your message" msgstr "Votre message" -#: agenda_culturel/models.py:1212 agenda_culturel/views.py:812 +#: agenda_culturel/models.py:1238 agenda_culturel/views.py:895 msgid "Closed" msgstr "Fermé" -#: agenda_culturel/models.py:1214 +#: agenda_culturel/models.py:1240 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:1219 +#: agenda_culturel/models.py:1245 msgid "Comments" msgstr "Commentaires" -#: agenda_culturel/models.py:1220 +#: agenda_culturel/models.py:1246 msgid "Comments on the message from the moderation team" msgstr "Commentaires sur ce message par l'équipe de modération" -#: agenda_culturel/models.py:1232 agenda_culturel/models.py:1360 +#: agenda_culturel/models.py:1258 agenda_culturel/models.py:1389 msgid "Recurrent import" msgstr "Import récurrent" -#: agenda_culturel/models.py:1233 +#: agenda_culturel/models.py:1259 msgid "Recurrent imports" msgstr "Imports récurrents" -#: agenda_culturel/models.py:1237 +#: agenda_culturel/models.py:1263 msgid "ical" msgstr "ical" -#: agenda_culturel/models.py:1238 +#: agenda_culturel/models.py:1264 msgid "ical no busy" msgstr "ical sans busy" -#: agenda_culturel/models.py:1239 +#: agenda_culturel/models.py:1265 msgid "ical no VC" msgstr "ical sans VC" -#: agenda_culturel/models.py:1240 +#: agenda_culturel/models.py:1266 msgid "lacoope.org" msgstr "lacoope.org" -#: agenda_culturel/models.py:1241 +#: agenda_culturel/models.py:1267 msgid "la comédie" msgstr "la comédie" -#: agenda_culturel/models.py:1242 +#: agenda_culturel/models.py:1268 msgid "le fotomat" msgstr "le fotomat" -#: agenda_culturel/models.py:1243 +#: agenda_culturel/models.py:1269 #, fuzzy #| msgid "la puce à loreille" msgid "la puce à l'oreille" msgstr "la puce à loreille" -#: agenda_culturel/models.py:1244 +#: agenda_culturel/models.py:1270 msgid "Plugin wordpress MEC" msgstr "Plugin wordpress MEC" -#: agenda_culturel/models.py:1245 +#: agenda_culturel/models.py:1271 msgid "Événements d'une page" msgstr "Événements d'une page" -#: agenda_culturel/models.py:1246 +#: agenda_culturel/models.py:1272 msgid "la cour des 3 coquins" msgstr "la cour des 3 coquins" -#: agenda_culturel/models.py:1249 +#: agenda_culturel/models.py:1275 msgid "simple" msgstr "simple" -#: agenda_culturel/models.py:1250 +#: agenda_culturel/models.py:1276 msgid "Headless Chromium" msgstr "chromium sans interface" -#: agenda_culturel/models.py:1251 +#: agenda_culturel/models.py:1277 msgid "Headless Chromium (pause)" msgstr "chromium sans interface (pause)" -#: agenda_culturel/models.py:1256 +#: agenda_culturel/models.py:1282 msgid "daily" msgstr "chaque jour" -#: agenda_culturel/models.py:1258 +#: agenda_culturel/models.py:1284 msgid "weekly" msgstr "chaque semaine" -#: agenda_culturel/models.py:1263 +#: agenda_culturel/models.py:1289 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." @@ -449,135 +516,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:1270 +#: agenda_culturel/models.py:1296 msgid "Processor" msgstr "Processeur" -#: agenda_culturel/models.py:1273 +#: agenda_culturel/models.py:1299 msgid "Downloader" msgstr "Téléchargeur" -#: agenda_culturel/models.py:1280 +#: agenda_culturel/models.py:1306 msgid "Import recurrence" msgstr "Récurrence d'import" -#: agenda_culturel/models.py:1287 +#: agenda_culturel/models.py:1313 msgid "Source" msgstr "Source" -#: agenda_culturel/models.py:1288 +#: agenda_culturel/models.py:1314 msgid "URL of the source document" msgstr "URL du document source" -#: agenda_culturel/models.py:1292 +#: agenda_culturel/models.py:1318 msgid "Browsable url" msgstr "URL navigable" -#: agenda_culturel/models.py:1294 +#: agenda_culturel/models.py:1320 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:1303 +#: agenda_culturel/models.py:1329 msgid "Status of each imported event (published or draft)" msgstr "Status de chaque événement importé (publié ou brouillon)" -#: agenda_culturel/models.py:1308 +#: agenda_culturel/models.py:1334 msgid "Address for each imported event" msgstr "Adresse de chaque événement importé" -#: agenda_culturel/models.py:1316 +#: agenda_culturel/models.py:1342 msgid "Category of each imported event" msgstr "Catégorie de chaque événement importé" -#: agenda_culturel/models.py:1322 +#: agenda_culturel/models.py:1348 msgid "Tags for each imported event" msgstr "Étiquettes de chaque événement importé" -#: agenda_culturel/models.py:1323 +#: agenda_culturel/models.py:1349 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:1346 +#: agenda_culturel/models.py:1375 msgid "Running" msgstr "En cours" -#: agenda_culturel/models.py:1347 +#: agenda_culturel/models.py:1376 msgid "Canceled" msgstr "Annulé" -#: agenda_culturel/models.py:1348 +#: agenda_culturel/models.py:1377 msgid "Success" msgstr "Succès" -#: agenda_culturel/models.py:1349 +#: agenda_culturel/models.py:1378 msgid "Failed" msgstr "Erreur" -#: agenda_culturel/models.py:1352 +#: agenda_culturel/models.py:1381 msgid "Batch importation" msgstr "Importation par lot" -#: agenda_culturel/models.py:1353 +#: agenda_culturel/models.py:1382 msgid "Batch importations" msgstr "Importations par lot" -#: agenda_culturel/models.py:1361 +#: agenda_culturel/models.py:1390 msgid "Reference to the recurrent import processing" msgstr "Référence du processus d'import récurrent" -#: agenda_culturel/models.py:1369 +#: agenda_culturel/models.py:1398 msgid "URL (if not recurrent import)" msgstr "URL (si pas d'import récurrent)" -#: agenda_culturel/models.py:1371 +#: agenda_culturel/models.py:1400 msgid "Source URL if no RecurrentImport is associated." msgstr "URL source si aucun import récurrent n'est associé" -#: agenda_culturel/models.py:1384 +#: agenda_culturel/models.py:1413 msgid "Error message" msgstr "Votre message" -#: agenda_culturel/models.py:1388 +#: agenda_culturel/models.py:1417 msgid "Number of collected events" msgstr "Nombre d'événements collectés" -#: agenda_culturel/models.py:1391 +#: agenda_culturel/models.py:1420 msgid "Number of imported events" msgstr "Nombre d'événements importés" -#: agenda_culturel/models.py:1394 +#: agenda_culturel/models.py:1423 msgid "Number of updated events" msgstr "Nombre d'événements mis à jour" -#: agenda_culturel/models.py:1397 +#: agenda_culturel/models.py:1426 msgid "Number of removed events" msgstr "Nombre d'événements supprimés" -#: agenda_culturel/models.py:1405 +#: agenda_culturel/models.py:1434 msgid "Weight" msgstr "Poids" -#: agenda_culturel/models.py:1406 +#: agenda_culturel/models.py:1435 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:1413 +#: agenda_culturel/models.py:1442 msgid "Category applied to the event" msgstr "Catégorie appliquée à l'événement" -#: agenda_culturel/models.py:1418 +#: agenda_culturel/models.py:1447 msgid "Contained in the title" msgstr "Contenu dans le titre" -#: agenda_culturel/models.py:1419 +#: agenda_culturel/models.py:1448 msgid "Text contained in the event title" msgstr "Texte contenu dans le titre de l'événement" -#: agenda_culturel/models.py:1425 +#: agenda_culturel/models.py:1454 msgid "Exact title extract" msgstr "Extrait exact du titre" -#: agenda_culturel/models.py:1427 +#: agenda_culturel/models.py:1456 msgid "" "If checked, the extract will be searched for in the title using the exact " "form (capitals, accents)." @@ -585,19 +652,19 @@ msgstr "" "Si coché, l'extrait sera recherché dans le titre en utilisant la forme " "exacte (majuscules, accents)" -#: agenda_culturel/models.py:1433 +#: agenda_culturel/models.py:1462 msgid "Contained in the description" msgstr "Contenu dans la description" -#: agenda_culturel/models.py:1434 +#: agenda_culturel/models.py:1463 msgid "Text contained in the description" msgstr "Texte contenu dans la description" -#: agenda_culturel/models.py:1440 +#: agenda_culturel/models.py:1469 msgid "Exact description extract" msgstr "Extrait exact de description" -#: agenda_culturel/models.py:1442 +#: agenda_culturel/models.py:1471 msgid "" "If checked, the extract will be searched for in the description using the " "exact form (capitals, accents)." @@ -605,19 +672,19 @@ msgstr "" "Si coché, l'extrait sera recherché dans la description en utilisant la forme " "exacte (majuscules, accents)" -#: agenda_culturel/models.py:1448 +#: agenda_culturel/models.py:1477 msgid "Contained in the location" msgstr "Contenu dans la localisation" -#: agenda_culturel/models.py:1449 +#: agenda_culturel/models.py:1478 msgid "Text contained in the event location" msgstr "Texte contenu dans la localisation de l'événement" -#: agenda_culturel/models.py:1455 +#: agenda_culturel/models.py:1484 msgid "Exact location extract" msgstr "Extrait exact de localisation" -#: agenda_culturel/models.py:1457 +#: agenda_culturel/models.py:1486 msgid "" "If checked, the extract will be searched for in the location using the exact " "form (capitals, accents)." @@ -625,112 +692,113 @@ msgstr "" "Si coché, l'extrait sera recherché dans la localisation en utilisant la " "forme exacte (majuscules, accents)" -#: agenda_culturel/models.py:1465 +#: agenda_culturel/models.py:1494 msgid "Location from place" msgstr "Localisation depuis le lieu" -#: agenda_culturel/models.py:1472 +#: agenda_culturel/models.py:1501 msgid "Categorisation rule" msgstr "Règle de catégorisation" -#: agenda_culturel/models.py:1473 +#: agenda_culturel/models.py:1502 msgid "Categorisation rules" msgstr "Règles de catégorisation" -#: agenda_culturel/models.py:1540 agenda_culturel/models.py:1572 +#: agenda_culturel/models.py:1569 agenda_culturel/models.py:1601 msgid "Question" msgstr "Question" -#: agenda_culturel/models.py:1541 agenda_culturel/models.py:1579 +#: agenda_culturel/models.py:1570 agenda_culturel/models.py:1608 msgid "Text that will be shown to moderators" msgstr "Text tel que présenté aux modérateurices" -#: agenda_culturel/models.py:1547 +#: agenda_culturel/models.py:1576 msgid "Moderation question" msgstr "Question de modération" -#: agenda_culturel/models.py:1548 +#: agenda_culturel/models.py:1577 msgid "Moderation questions" msgstr "Questions de modération" -#: agenda_culturel/models.py:1573 +#: agenda_culturel/models.py:1602 msgid "Associated question from moderation" msgstr "Question associée pour la modération" -#: agenda_culturel/models.py:1578 +#: agenda_culturel/models.py:1607 msgid "Answer" msgstr "Réponse" -#: agenda_culturel/models.py:1585 +#: agenda_culturel/models.py:1614 msgid "Adds tags" msgstr "Ajoute les étiquettes" -#: agenda_culturel/models.py:1586 +#: agenda_culturel/models.py:1615 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:1592 +#: agenda_culturel/models.py:1621 msgid "Removes tags" msgstr "Retire les étiquettes" -#: agenda_culturel/models.py:1593 +#: agenda_culturel/models.py:1622 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." -#: agenda_culturel/settings/base.py:148 +#: agenda_culturel/settings/base.py:149 msgid "English" msgstr "anglais" -#: agenda_culturel/settings/base.py:149 +#: agenda_culturel/settings/base.py:150 msgid "French" msgstr "français" -#: agenda_culturel/views.py:128 +#: agenda_culturel/views.py:132 msgid "Recurrent import name" msgstr "Nome de l'import récurrent" -#: agenda_culturel/views.py:129 +#: agenda_culturel/views.py:133 msgid "Add another" msgstr "Ajouter un autre" -#: agenda_culturel/views.py:130 +#: agenda_culturel/views.py:134 msgid "Browse..." msgstr "Naviguer..." -#: agenda_culturel/views.py:131 +#: agenda_culturel/views.py:135 msgid "No file selected." msgstr "Pas de fichier sélectionné." -#: agenda_culturel/views.py:442 +#: agenda_culturel/views.py:529 msgid "The static content has been successfully updated." msgstr "Le contenu statique a été modifié avec succès." -#: agenda_culturel/views.py:451 agenda_culturel/views.py:500 +#: agenda_culturel/views.py:538 agenda_culturel/views.py:586 msgid "The event has been successfully modified." msgstr "L'événement a été modifié avec succès." -#: agenda_culturel/views.py:457 +#: agenda_culturel/views.py:543 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 " "desynchronized with the source, and will need to be merged with each future " "automatic import." -msgstr "Attention, cet événement n'a pas été modifié depuis sa dernière mise " -"à jour par importation. Si vous modifiez une information issue de cet import, " +msgstr "" +"Attention, cet événement n'a pas été modifié depuis sa dernière mise à jour " +"par importation. Si vous modifiez une information issue de cet import, " "l'événement sera désynchronisé d'avec la source, et nécessitera une fusion à " "chaque import automatique futurs." -#: agenda_culturel/views.py:469 +#: agenda_culturel/views.py:555 msgid "The event has been successfully deleted." msgstr "L'événement a été supprimé avec succès" -#: agenda_culturel/views.py:525 +#: agenda_culturel/views.py:611 msgid "The status has been successfully modified." msgstr "Le status a été modifié avec succès." -#: agenda_culturel/views.py:547 agenda_culturel/views.py:562 +#: agenda_culturel/views.py:633 agenda_culturel/views.py:648 msgid "" "The event has been submitted and will be published as soon as it has been " "validated by the moderation team." @@ -738,77 +806,77 @@ 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:556 +#: agenda_culturel/views.py:642 msgid "The event is saved." msgstr "L'événement est enregistré." -#: agenda_culturel/views.py:650 agenda_culturel/views.py:703 +#: agenda_culturel/views.py:734 agenda_culturel/views.py:786 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:655 agenda_culturel/views.py:709 +#: agenda_culturel/views.py:739 agenda_culturel/views.py:792 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:666 +#: agenda_culturel/views.py:749 msgid "Integrating {} url(s) into our import process." msgstr "Intégration de {} url(s) dans notre processus d'import." -#: agenda_culturel/views.py:716 +#: agenda_culturel/views.py:799 msgid "Integrating {} into our import process." msgstr "Intégration de {} dans notre processus d'import." -#: agenda_culturel/views.py:779 +#: agenda_culturel/views.py:862 msgid "Your message has been sent successfully." msgstr "Votre message a été envoyé avec succès." -#: agenda_culturel/views.py:796 +#: agenda_culturel/views.py:879 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:812 +#: agenda_culturel/views.py:895 msgid "Open" msgstr "Ouvert" -#: agenda_culturel/views.py:869 +#: agenda_culturel/views.py:952 msgid "Search" msgstr "Rechercher" -#: agenda_culturel/views.py:1055 +#: agenda_culturel/views.py:1138 msgid "The import has been run successfully." msgstr "L'import a été lancé avec succès" -#: agenda_culturel/views.py:1074 +#: agenda_culturel/views.py:1157 msgid "The import has been canceled." msgstr "L'import a été annulé" -#: agenda_culturel/views.py:1123 +#: agenda_culturel/views.py:1231 msgid "The recurrent import has been successfully modified." msgstr "L'import récurrent a été modifié avec succès." -#: agenda_culturel/views.py:1132 +#: agenda_culturel/views.py:1240 msgid "The recurrent import has been successfully deleted." msgstr "L'import récurrent a été supprimé avec succès" -#: agenda_culturel/views.py:1172 +#: agenda_culturel/views.py:1280 msgid "The import has been launched." msgstr "L'import a été lancé" -#: agenda_culturel/views.py:1189 +#: agenda_culturel/views.py:1302 msgid "Imports has been launched." msgstr "Les imports ont été lancés" -#: agenda_culturel/views.py:1269 +#: agenda_culturel/views.py:1387 msgid "The merge has been successfully completed." msgstr "La fusion a été réalisée avec succès." -#: agenda_culturel/views.py:1303 +#: agenda_culturel/views.py:1421 msgid "Events have been marked as unduplicated." msgstr "Les événements ont été marqués comme non dupliqués." -#: agenda_culturel/views.py:1325 +#: agenda_culturel/views.py:1443 msgid "" "The selected event has been retained, while the other has been moved to the " "recycle bin." @@ -816,7 +884,7 @@ msgstr "" "L'événement sélectionné a été conservé, l'autre a été déplacé dans la " "corbeille." -#: agenda_culturel/views.py:1332 +#: agenda_culturel/views.py:1450 msgid "" "The selected event has been retained, while the others have been moved to " "the recycle bin." @@ -824,19 +892,19 @@ msgstr "" "L'événement sélectionné a été conservé, les autres ont été déplacés dans la " "corbeille." -#: agenda_culturel/views.py:1343 +#: agenda_culturel/views.py:1461 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:1376 +#: agenda_culturel/views.py:1494 msgid "Cleaning up duplicates: {} item(s) removed." msgstr "Nettoyage des dupliqués: {} élément(s) supprimés." -#: agenda_culturel/views.py:1420 +#: agenda_culturel/views.py:1538 msgid "The event was successfully duplicated." msgstr "L'événement a été marqué dupliqué avec succès." -#: agenda_culturel/views.py:1428 +#: agenda_culturel/views.py:1546 msgid "" "The event has been successfully flagged as a duplicate. The moderation team " "will deal with your suggestion shortly." @@ -844,62 +912,65 @@ 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:1481 +#: agenda_culturel/views.py:1599 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:1490 +#: agenda_culturel/views.py:1608 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:1513 agenda_culturel/views.py:1560 +#: agenda_culturel/views.py:1630 agenda_culturel/views.py:1677 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:1520 agenda_culturel/views.py:1567 +#: agenda_culturel/views.py:1637 agenda_culturel/views.py:1684 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:1527 agenda_culturel/views.py:1574 +#: agenda_culturel/views.py:1644 agenda_culturel/views.py:1691 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:1614 +#: agenda_culturel/views.py:1731 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:1726 agenda_culturel/views.py:1788 -#: agenda_culturel/views.py:1826 +#: agenda_culturel/views.py:1857 agenda_culturel/views.py:1919 +#: agenda_culturel/views.py:1957 msgid "{} events have been updated." msgstr "{} événements ont été mis à jour." -#: agenda_culturel/views.py:1729 agenda_culturel/views.py:1790 -#: agenda_culturel/views.py:1829 +#: agenda_culturel/views.py:1860 agenda_culturel/views.py:1921 +#: agenda_culturel/views.py:1960 msgid "1 event has been updated." msgstr "1 événement a été mis à jour" -#: agenda_culturel/views.py:1731 agenda_culturel/views.py:1792 -#: agenda_culturel/views.py:1831 +#: agenda_culturel/views.py:1862 agenda_culturel/views.py:1923 +#: agenda_culturel/views.py:1962 msgid "No events have been modified." msgstr "Aucun événement n'a été modifié." -#: agenda_culturel/views.py:1740 +#: agenda_culturel/views.py:1871 msgid "The place has been successfully updated." msgstr "Le lieu a été modifié avec succès." -#: agenda_culturel/views.py:1749 +#: agenda_culturel/views.py:1880 msgid "The place has been successfully created." msgstr "Le lieu a été créé avec succès." -#: agenda_culturel/views.py:1814 +#: agenda_culturel/views.py:1945 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:1818 +#: agenda_culturel/views.py:1949 msgid "A new alias has been added to the selected place." msgstr "Un nouvel alias a été créé pour le lieu sélectionné." + +#~ msgid "This" +#~ msgstr "Ce" diff --git a/src/agenda_culturel/static/style.scss b/src/agenda_culturel/static/style.scss index c5e87d3..48db75d 100644 --- a/src/agenda_culturel/static/style.scss +++ b/src/agenda_culturel/static/style.scss @@ -253,7 +253,7 @@ svg { .illustration { width: 100%; padding: 0.3em; - margin: 0; + margin: 0 0 0.5em 0; } @media only screen and (min-width: 550px) { @@ -526,6 +526,12 @@ article#filters { .slide-buttons { float: right; + margin-bottom: -2.8em; +} +@media only screen and (min-width: 992px) { + .slide-buttons { + margin-left: -3em; + } } .highlight { @@ -1170,6 +1176,7 @@ article { } #boutons-fixes { + z-index: 1000; li { list-style: none; @extend [role="button"], .secondary; @@ -1201,4 +1208,12 @@ article { display: inline-block; } +} + +.a-venir { + .day-interval>.sticky { + position: sticky; + top: 0; + z-index: 10; + } } \ No newline at end of file diff --git a/src/agenda_culturel/templates/agenda_culturel/page-upcoming.html b/src/agenda_culturel/templates/agenda_culturel/page-upcoming.html new file mode 100644 index 0000000..7f577f0 --- /dev/null +++ b/src/agenda_culturel/templates/agenda_culturel/page-upcoming.html @@ -0,0 +1,95 @@ +{% extends "agenda_culturel/page.html" %} + + +{% load i18n %} +{% load cache %} +{% load cat_extra %} +{% load event_extra %} +{% load utils_extra %} +{% load static %} +{% load i18n %} + +{% block entete_header %} + {% css_categories %} + + +{% endblock %} + +{% block title %}{% block og_title %}Événements à venir{% endblock %}{% endblock %} + +{% block body-class %}a-venir{% endblock %} + + {% block content %} + + {% get_current_language as LANGUAGE_CODE %} + {% with cache_timeout=user.is_authenticated|yesno:"30,600" %} + {% cache cache_timeout upcoming user.is_authenticated calendar.firstdate filter.to_str LANGUAGE_CODE %} + + + + +{% for ti in calendar.time_intervals_list %} +
+
+ {% picto_from_name "chevrons-up" %} +
+

{{ ti.name }}

+

{{ ti.date }}

+
+
+
+
+ {% if ti.events|length > 1 %} +

Résumé

+
    + {% for event in ti.events %} +
  • {{ event.category | circle_cat:event.has_recurrences }} + {% if event.start_time %} + {{ event.start_time }} + {% endif %} + {{ event|picto_status }} {{ event.title }} +
  • + {% endfor %} +
+ {% endif %} +
+
+ {% if ti.events|length > 1 %} +

Événements

+ {% endif %} + {% with indexti=ti.id %} + {% for event in ti.events %} + {% include "agenda_culturel/single-event/event-in-upcoming-inc.html" with event=event filter=filter day=day indexti=indexti %} + {% endfor %} + {% endwith %} +
+
+
+ + +{% endfor %} + + +{% endcache %} +{% endwith %} + +{% 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 c0d2a10..3274527 100644 --- a/src/agenda_culturel/templates/agenda_culturel/page.html +++ b/src/agenda_culturel/templates/agenda_culturel/page.html @@ -33,7 +33,7 @@ {% load utils_extra %} {% load duplicated_extra %} {% load rimports_extra %} - +