From 17b88bc3b138661e80a0aaec6344df95b45c2d76 Mon Sep 17 00:00:00 2001 From: boyska Date: Sat, 16 Jun 2018 14:41:44 +0200 Subject: [PATCH] durata talk senza orario --- talks/_templates/talk.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/talks/_templates/talk.html b/talks/_templates/talk.html index 5b03f85..0d619de 100644 --- a/talks/_templates/talk.html +++ b/talks/_templates/talk.html @@ -1,3 +1,7 @@ +{% macro durata_human(d) %} +{%- if d >= 60 -%}{{d//60}}h{%- endif -%} +{%- if d % 60 != 0 -%}{{d%60}}m {%- endif -%} +{% endmacro %}

{{title.strip()}}

@@ -9,13 +13,11 @@ {{day|dateformat(format='EEEE', locale=lang)}} - {{time.time()|timeformat(format='short', locale=lang)}} - {% if duration %} ( - {%- if duration >= 60 -%}{{duration//60}}h{%- endif -%} - {%- if duration % 60 != 0 -%}{{duration%60}}m {%- endif -%}) - {% endif %} + {% if duration %} ({{durata_human(duration)}}) {% endif %} {% else %} L'orario non รจ ancora stato fissato + {% if duration %}

Durata: {{durata_human(duration)}}

{% endif %} {% endif %} {# date-time #} {% if room is defined %} Stanza {{ room }}