talk.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {% macro durata_human(d) %}
  2. {%- if d >= 60 -%}{{d//60}}h{%- endif -%}
  3. {%- if d % 60 != 0 -%}{{d%60}}m {%- endif -%}
  4. {% endmacro %}
  5. <div id="talk-{{id}}"
  6. class="{% for t in tags -%} tag-{{t|replace(' ', '_')}} {% endfor -%}">
  7. <h3 class="talk-title"><a href="#t-cell-{{id}}">{{title.strip()}}</a></h3>
  8. <div class="talk-info">
  9. <p>
  10. {% if time is defined and day is defined %}
  11. {# Vedi http://babel.pocoo.org/en/latest/dates.html #}
  12. <span>
  13. {{day|dateformat(format='EEEE', locale=lang)}}
  14. -
  15. {{time.time()|timeformat(format='short', locale=lang)}}
  16. {% if duration %} ({{durata_human(duration)}}) {% endif %}
  17. </span>
  18. {% else %}
  19. <i>L'orario non è ancora stato fissato</i>
  20. {% if duration %} <p>Durata: {{durata_human(duration)}}</p> {% endif %}
  21. {% endif %} {# date-time #}
  22. {% if room is defined %}
  23. <span>Stanza {{ room }}</span>
  24. {% endif %}
  25. </p>
  26. {% if needs: %}
  27. <div class="talk-needs">
  28. <strong>Materiale necessario:</strong>
  29. {{needs|join(", ")}}
  30. </div>
  31. {% endif %}
  32. </div>
  33. <div class="talk-description">{{text | markdown}}
  34. {% if contacts: %}
  35. <p class="contacts">A cura di {{contacts|join(', ')}}</p>
  36. {% endif %}
  37. </div>
  38. {% if links or resources or mail: %}
  39. <div class="talk-resources">
  40. <h4>Link utili:</h4>
  41. <ul>
  42. {% if links is defined: %}
  43. {% for link in links %}
  44. <li>{{link|urlize}}</li>
  45. {% endfor %}
  46. {% endif %}
  47. {% if resources is defined: %}
  48. <li><a href="{{resources}}/">Materiali</a></li>
  49. {% endif %}
  50. {% if mail is defined and mail: %}
  51. <li><a href="{{mail}}">Mail</a></li>
  52. {% endif %}
  53. </ul>
  54. </div>
  55. {% endif %}
  56. </div>
  57. {# vim: set ft=jinja: #}