Added 2016/assets/templates/lp-sch-2016.jinja2
[libreplanet-static.git] / 2016 / assets / templates / lp-sch-2016.jinja2
CommitLineData
53b287d1 1{# -*- mode: jinja2; -*- #}
2{#
3 Copyright (C) 2016 Free Software Foundation, Inc
4
5 This template is free software: you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation, either version 3 of the
8 License, or (at your option) any later version.
9
10 This template is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this template. If not, see
17 <http://www.gnu.org/licenses/>.
18#}
19
20{# macros start #}
21
22{# make speakers macro #}
23{% macro mk_speakers(speakers) %}
24 <span class="program-session-speaker">
25 {% for speaker in speakers %}
26 {% if loop.last %}
27 {{ speaker }}
28 {% else %}
29 {{ speaker }},
30 {% endif %}
31 {% endfor %}
32 </span>
33{% endmacro %}
34
35{# make room macro #}
36{% macro mk_room(room) %}
37 {% if room|lower != 'roomtba' %}
38 <span class="label label-default">{{ room }}</span>
39 {% endif %}
40{% endmacro %}
41
42{# make day header macro #}
43{% macro mk_day_header(day, collapse_area) %}
44 {% if day|trim != '' %}
45 <header class="program-day-header">
46 <hgroup>
47 <h2>{{ day }}</h2>
48 </hgroup>
49 </header>
50 {% endif %}
51{% endmacro %}
52
53{# make timeslot header macro #}
54{% macro mk_timeslot_header(timeslot, collapse, collapse_area='') %}
55 {% if timeslot|trim != '' %}
56 <header class="program-timeslot-header">
57 <hgroup>
58 <h2>{{ timeslot }}</h2>
59 </hgroup>
60 </header>
61 {% endif %}
62{% endmacro %}
63
64{# make session header macro #}
65{% macro mk_session_header(session) %}
66 <header class="program-session-header">
67 <hgroup>
68 <h2>{{ session }}</h2>
69 </hgroup>
70 </header>
71{% endmacro %}
72
73{# desc macro #}
74{% macro desc(disc_list) %}
75 {% for desc_p in disc_list %}
76 <p>{{ desc_p }}</p>
77 {% endfor %}
78{% endmacro %}
79
80{# populate sessions macro #}
81{% macro populate_sessions(sessions, day_index, timeslot_index) %}
82 {% for session, session_info in sessions.iteritems() %} {# session start #}
83 <section id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}" class="program-session">
84 {{ mk_session_header(session) }}
85 {{ mk_speakers(session_info['speakers']) }}
86 <p class="program-session-room-details">
87 {{ mk_room(session_info['room']) }}
88 <button class="btn btn-default btn-xs"
89 data-toggle="collapse" aria-expanded="false"
90 aria-controls="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse"
91 data-target="#day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse">
92 Details
93 </button>
94 </p>
95 <div class="collapse in"
96 id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse">
97 {{ desc(session_info['desc']) }}
98 </div> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse end -->
99 </section> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} end -->
100 {% endfor %} {# session end #}
101{% endmacro %}
102
103{# populate timeslots macro #}
104{% macro populate_timeslots(timeslots, day_index) %}
105 {% for timeslot, sessions in timeslots.iteritems() %} {# timeslot start #}
106 <article id="day-{{ day_index }}-timeslot-{{ loop.index }}" class="program-timeslot">
107 {{ mk_timeslot_header(timeslot) }}
108 {% if sessions|length > 0 %}
109 {{ populate_sessions(sessions, day_index, loop.index) }}
110 {% endif %}
111 </article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} end -->
112 {% endfor %} {# timeslot start #}
113{% endmacro %}
114
115{# lp 2016 template start #}
116{% for day, timeslots in schedule.iteritems() %} {# day start #}
117 <article id="day-{{ loop.index }}-program" class="program-day">
118 {{ mk_day_header(day) }}
119 {{ populate_timeslots(timeslots, loop.index) }}
120 </article> <!-- day-{{ loop.index }} end -->
121{% endfor %} {# day loop end #}