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