From: Jérémy Fabre Date: Wed, 19 Oct 2016 09:54:52 +0000 (+0200) Subject: Event details fixes X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=1567a596f31a6cfe6af44baa241e9b80f749c3b6;p=mezzo.git Event details fixes --- diff --git a/app/templates/agenda/includes/event_date.html b/app/templates/agenda/includes/event_date.html index 5c1a5334..6e5d159f 100644 --- a/app/templates/agenda/includes/event_date.html +++ b/app/templates/agenda/includes/event_date.html @@ -1,72 +1,74 @@ {% load i18n %} {% load event_tags %} - -{% if event.start and not event.end %} - {{ event.start|date:event.date_format }} - - {% if event.start and event.start|date:"H:i" != "23:59" %} - , {{ event.start|date:"H\hi" }} - {% endif %} +{% spaceless %} + + {% if event.start and not event.end %} + {{ event.start|date:event.date_format }} + + {% if event.start and event.start|date:"H:i" != "23:59" %} + , {{ event.start|date:"H\hi" }} + {% endif %} - -{% else %} - - {% if event.start|date:"d.m.y" == event.end|date:"d.m.y" %} - {% if not event.periods.all %} - {{ event.start|date:event.date_format }} - - {% if event.end and event.end|date:"H:i" != "23:59" %} - - {{ event.start|date:" H\hi" }} - {{ event.end|date:"H\hi" }} + + {% else %} + + {% if event.start|date:"d.m.y" == event.end|date:"d.m.y" %} + {% if not event.periods.all %} + {{ event.start|date:event.date_format }} + + {% if event.end and event.end|date:"H:i" != "23:59" %} + , {{ event.start|date:" H\hi" }} - {{ event.end|date:"H\hi" }} + {% else %} + , {{ event.start|date:" H\hi" }} + {% endif %} {% else %} - - {{ event.start|date:" H\hi" }} + {{ event.start|date:event.date_format }} + {% for period in event.periods.all %} + {% if period.date_to and period.date_to|date:"H:i" != "23:59" %} + ,{{ period.date_from|date:"H\hi" }} - {{ period.date_to|date:"H\hi" }} + {% else %} + {% if forloop.last or event.periods.all|length == 2 %} {% trans "and"%} {% elif not forloop.first %}, {% endif %} + {{ period.date_from|date:"H\hi" }} + {% endif %} + {% endfor %} {% endif %} - {% else %} - {{ event.start|date:event.date_format }} + + + {% elif event.start|date:"m.y" == event.end|date:"m.y" %} + {% if event.periods.all %} + {% with event.periods.all|same_time_in_periods as same_time_in_periods %} {% for period in event.periods.all %} {% if period.date_to and period.date_to|date:"H:i" != "23:59" %} - - {{ period.date_from|date:"H\hi" }} - {{ period.date_to|date:"H\hi" }} + {{ period.date_from|date:event.date_format }} + {% if period|period_is_more_than_hours:4 %} + , {{ period.date_from|date:"H\hi" }} {% trans "to" %} {{ period.date_to|date:"H\hi" }} + {% else %} + , {{ period.date_from|date:"H\hi" }} + {% endif %} {% else %} - {% if forloop.last or event.periods.all|length == 2 %} {% trans "and"%} {% elif not forloop.first %}- {% endif %} + {% if event.periods.all|length > 1 and not forloop.last %} + {{ period.date_from|date:event.date_format }}{% if event.periods.all|length == 2 %} {% trans "and" %} {% else %}{% endif %} + {% else %} + {{ period.date_from|date:event.date_format }} + {% if event.periods.all|length > 1 and forloop.first %} {% trans "and" %}{% endif %} + {% endif %} + {% if same_time_in_periods and forloop.last %} {{ period.date_from|date:"H\hi" }} + {% elif not same_time_in_periods %} + , {{ period.date_from|date:"H\hi" }} + {% endif %} {% endif %} +
{% endfor %} + {% endwith %} + {% else %} + {{ event.start|date:event.date_format }} {% trans "to" %} {{ event.end|date:event.date_format }} - {{ event.start|date:"H\hi" }} - {{ event.end|date:"H\hi" }} + {% endif %} + + {% else %} + {{ event.start|date:"j F" }} {% trans "to" %} {{ event.end|date:"j F" }} {% endif %} - - {% elif event.start|date:"m.y" == event.end|date:"m.y" %} - {% if event.periods.all %} - {% with event.periods.all|same_time_in_periods as same_time_in_periods %} - {% for period in event.periods.all %} - {% if period.date_to and period.date_to|date:"H:i" != "23:59" %} - {{ period.date_from|date:event.date_format }} - {% if period|period_is_more_than_hours:4 %} - - {{ period.date_from|date:"H\hi" }} {% trans "to" %} {{ period.date_to|date:"H\hi" }} - {% else %} - - {{ period.date_from|date:"H\hi" }} - {% endif %} - {% else %} - {% if event.periods.all|length > 1 and not forloop.last %} - {{ period.date_from|date:event.date_format }}{% if event.periods.all|length == 2 %} {% trans "and" %} {% else %}{% endif %} - {% else %} - {{ period.date_from|date:event.date_format }} - {% if event.periods.all|length > 1 and forloop.first %} {% trans "and" %}{% endif %} - {% endif %} - {% if same_time_in_periods and forloop.last %} - {{ period.date_from|date:"H\hi" }} - {% elif not same_time_in_periods %} - - {{ period.date_from|date:"H\hi" }} - {% endif %} - {% endif %} -
- {% endfor %} - {% endwith %} - {% else %} - {{ event.start|date:event.date_format }} {% trans "to" %} {{ event.end|date:event.date_format }} - {{ event.start|date:"H\hi" }} - {{ event.end|date:"H\hi" }} - {% endif %} - - {% else %} - {{ event.start|date:"j F" }} {% trans "to" %} {{ event.end|date:"j F" }} {% endif %} - -{% endif %} +{% endspaceless %} diff --git a/app/templates/agenda/includes/event_metainfo.html b/app/templates/agenda/includes/event_metainfo.html index 5bab7f44..741b837e 100644 --- a/app/templates/agenda/includes/event_metainfo.html +++ b/app/templates/agenda/includes/event_metainfo.html @@ -32,10 +32,10 @@ {% endwith %} {% if event.brochure %} -
{% trans "Room program" %}
+
{% trans "Downloads" %}

- {% trans "Download" %} + {{ event.brochure.filename }}

{% endif %}