Amélioration rendu à venir

This commit is contained in:
Jean-Marie Favreau 2024-10-05 18:57:07 +02:00
parent fbed65adcc
commit 13111b2a60
4 changed files with 44 additions and 18 deletions

View File

@ -123,8 +123,9 @@ 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)]
def build_time_intervals(self, all_day_name, all_day_short_name, interval_names, interval_short_names, interval_markers):
self.time_intervals = [IntervalInDay(self.date, i, n[0], n[1]) for i, n in
enumerate(zip([all_day_name] + interval_names, [all_day_short_name] + interval_short_names))]
nm2 = datetime.now() + timedelta(hours=-2)
for e in self.events:
@ -155,16 +156,19 @@ class DayInCalendar:
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]
all_day_short_name = _('All day')
interval_short_names = [_('Morning'), _('Noon'), _('Afternoon'), _('Evening')]
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)
self.build_time_intervals(all_day_name, all_day_short_name, interval_names, interval_short_names, interval_markers)
return self.time_intervals
class IntervalInDay(DayInCalendar):
def __init__(self, d, id, name):
def __init__(self, d, id, name, short_name):
self.name = name
self.short_name = short_name
super().__init__(d)
self.id = self.id + '-' + str(id)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: agenda_culturel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-05 15:12+0200\n"
"POT-Creation-Date: 2024-10-05 18:53+0200\n"
"PO-Revision-Date: 2023-10-29 14:16+0000\n"
"Last-Translator: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
"Language-Team: Jean-Marie Favreau <jeanmarie.favreau@free.fr>\n"
@ -17,59 +17,79 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: agenda_culturel/calendar.py:146
#: agenda_culturel/calendar.py:149
msgid "All day today"
msgstr "Aujourd'hui toute la journée"
#: agenda_culturel/calendar.py:147
#: agenda_culturel/calendar.py:150
msgid "This morning"
msgstr "Ce matin"
#: agenda_culturel/calendar.py:147
#: agenda_culturel/calendar.py:150
msgid "This noon"
msgstr "Ce midi"
#: agenda_culturel/calendar.py:147
#: agenda_culturel/calendar.py:150
msgid "This afternoon"
msgstr "Cet après-midi"
#: agenda_culturel/calendar.py:147
#: agenda_culturel/calendar.py:150
msgid "This evening"
msgstr "Ce soir"
#: agenda_culturel/calendar.py:149
#: agenda_culturel/calendar.py:152
msgid "Tomorrow"
msgstr "Demain"
#: agenda_culturel/calendar.py:150
#: agenda_culturel/calendar.py:153
msgid "All day tomorrow"
msgstr "Toute la journée de demain"
#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155
#: agenda_culturel/calendar.py:154 agenda_culturel/calendar.py:158
#, python-format
msgid "%s morning"
msgstr "%s matin"
#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155
#: agenda_culturel/calendar.py:154 agenda_culturel/calendar.py:158
#, python-format
msgid "%s noon"
msgstr "%s midi"
#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155
#: agenda_culturel/calendar.py:154 agenda_culturel/calendar.py:158
#, python-format
msgid "%s afternoon"
msgstr "%s après-midi"
#: agenda_culturel/calendar.py:151 agenda_culturel/calendar.py:155
#: agenda_culturel/calendar.py:154 agenda_culturel/calendar.py:158
#, python-format
msgid "%s evening"
msgstr "%s soir"
#: agenda_culturel/calendar.py:154
#: agenda_culturel/calendar.py:157
#, python-format
msgid "All day %s"
msgstr "Toute la journée de %s"
#: agenda_culturel/calendar.py:159
msgid "All day"
msgstr "Toute la journée"
#: agenda_culturel/calendar.py:160
msgid "Morning"
msgstr "Matin"
#: agenda_culturel/calendar.py:160
msgid "Noon"
msgstr "Midi"
#: agenda_culturel/calendar.py:160
msgid "Afternoon"
msgstr "Après-midi"
#: agenda_culturel/calendar.py:160
msgid "Evening"
msgstr "Soir"
#: 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

View File

@ -1223,6 +1223,8 @@ article {
.description {
float: left;
width: calc(70% - 16em);
max-width: 42em;
margin-bottom: 1em;
}
.illustration {
width: 14em;

View File

@ -56,7 +56,7 @@
<div class="resume">
{% for ti in cd.get_time_intervals %}
{% if ti.events|length > 0 %}
<h3>{{ ti.name }} <a class="badge simple" href="#{{ ti.id }}" data-placement="left" data-tooltip="Aller à {{ ti.name }}">{% picto_from_name "chevron-down" %}</a></h3>
<h3>{{ ti.short_name }} <a class="badge simple" href="#{{ ti.id }}" data-tooltip="Aller à {{ ti.name }}">{% picto_from_name "chevrons-down" %}</a></h3>
<ul>
{% for event in ti.events %}
<li>{{ event.category | circle_cat:event.has_recurrences }}