198341d4 |
1 | {# -*- mode: jinja2; -*- #} |
2 | {# |
3 | Copyright © 2017 lpschedule-generator contributors. See CONTRIBUTORS. |
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) %} |
26 | {% if speakers[0]|lower != 'speakertba' %} |
41e432fa |
27 | <div class="program-session-speaker"> |
198341d4 |
28 | {% for speaker in speakers %} |
29 | {% if loop.last %} |
30 | {{ speaker }} |
31 | {% else %} |
32 | {{ speaker }}, |
33 | {% endif %} |
34 | {% endfor %} |
41e432fa |
35 | </div> |
198341d4 |
36 | {% endif %} |
37 | {% endmacro %} |
38 | |
39 | {# make room macro #} |
40 | {% macro mk_room(room) %} |
41 | {% if room|lower != 'roomtba' %} |
41e432fa |
42 | <div class="program-session-room-details"> |
43 | <span class="room label label-default">{{ room }}</span> |
44 | </div> |
45 | {% endif %} |
46 | {% endmacro %} |
47 | |
48 | {# make video macro #} |
49 | {% macro mk_video(video) %} |
50 | {% if video|lower != 'videotba' %} |
51 | <a class="btn btn-default btn-xs" href="{{ video }}"> |
52 | <span class="glyphicon glyphicon-facetime-video"></span> |
53 | </a> |
54 | {% endif %} |
55 | {% endmacro %} |
56 | |
57 | {# make desc details button macro #} |
58 | {% macro mk_desc_details_btn(disc_list) %} |
59 | {% if disc_list[0]|lower != 'desctba' %} |
60 | <button class="btn btn-default btn-xs" |
61 | data-toggle="collapse" aria-expanded="false" |
62 | aria-controls="{{ caller()|trim }}" |
63 | data-target="#{{ caller()|trim }}"> |
64 | Show details |
65 | <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span> |
66 | </button> |
67 | {% endif %} |
68 | {% endmacro %} |
69 | |
70 | {% macro mk_desc(disc_list) %} |
71 | {% if disc_list[0]|lower != 'desctba' %} |
72 | <div class="session-desc collapse in" |
73 | id="{{ caller()|trim }}"> |
74 | {{ desc(disc_list) }} |
75 | </div> <!-- {{ caller()|trim }} end --> |
198341d4 |
76 | {% endif %} |
77 | {% endmacro %} |
78 | |
79 | {# make day header macro #} |
80 | {% macro mk_day_header(day, collapse_area) %} |
81 | {% if day|trim != '' %} |
82 | <header class="program-day-header"> |
83 | <hgroup> |
84 | <h2>{{ day }}</h2> |
85 | </hgroup> |
86 | </header> |
87 | {% endif %} |
88 | {% endmacro %} |
89 | |
90 | {# make timeslot header macro #} |
91 | {% macro mk_timeslot_header(timeslot, collapse, collapse_area='') %} |
92 | {% if timeslot|trim != '' %} |
93 | <header class="program-timeslot-header"> |
94 | <hgroup> |
95 | <h2>{{ timeslot }}</h2> |
96 | </hgroup> |
97 | </header> |
98 | {% endif %} |
99 | {% endmacro %} |
100 | |
101 | {# make session header macro #} |
102 | {% macro mk_session_header(session) %} |
103 | {% if session|trim not in ['', 'st-from-ts'] %} |
104 | <header class="program-session-header"> |
105 | <hgroup> |
106 | <h2>{{ session }}</h2> |
107 | </hgroup> |
108 | </header> |
109 | {% endif %} |
110 | {% endmacro %} |
111 | |
112 | {# desc macro #} |
113 | {% macro desc(disc_list) %} |
114 | {% for desc_p in disc_list %} |
115 | <p>{{ desc_p }}</p> |
116 | {% endfor %} |
117 | {% endmacro %} |
118 | |
119 | {# populate sessions macro #} |
120 | {% macro populate_sessions(sessions, day_index, timeslot_index) %} |
121 | {% for session, session_info in sessions.iteritems() %} {# session start #} |
122 | <section id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}" class="program-session"> |
123 | {{ mk_session_header(session) }} |
124 | {{ mk_speakers(session_info['speakers']) }} |
41e432fa |
125 | <div class="program-session-shelf"> |
198341d4 |
126 | {{ mk_room(session_info['room']) }} |
41e432fa |
127 | {{ mk_video(session_info['video']) }} |
128 | {% call mk_desc_details_btn(session_info['desc']) %} |
129 | day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse |
130 | {% endcall %} |
131 | </div> |
132 | |
133 | <div class="program-session-desc-block"> |
134 | {% call mk_desc(session_info['desc']) %} |
135 | day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse |
136 | {% endcall %} |
137 | </div> |
198341d4 |
138 | </section> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} end --> |
139 | {% endfor %} {# session end #} |
140 | {% endmacro %} |
141 | |
142 | {# populate timeslots macro #} |
143 | {% macro populate_timeslots(timeslots, day_index) %} |
144 | {% for timeslot, sessions in timeslots.iteritems() %} {# timeslot start #} |
145 | <article id="day-{{ day_index }}-timeslot-{{ loop.index }}" class="program-timeslot"> |
146 | {{ mk_timeslot_header(timeslot) }} |
147 | {% if sessions|length > 0 %} |
148 | {{ populate_sessions(sessions, day_index, loop.index) }} |
149 | {% endif %} |
150 | </article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} end --> |
151 | {% endfor %} {# timeslot start #} |
152 | {% endmacro %} |
153 | |
154 | {# lp schedule 2016 template start #} |
155 | {% for day, timeslots in lp_dict.iteritems() %} {# day start #} |
156 | <article id="day-{{ loop.index }}-program" class="program-day"> |
157 | {{ mk_day_header(day) }} |
158 | {{ populate_timeslots(timeslots, loop.index) }} |
159 | </article> <!-- day-{{ loop.index }} end --> |
160 | {% endfor %} {# day loop end #} |