fcf95e6d |
1 | {# -*- mode: jinja2; -*- #} |
2 | {# |
3 | Copyright (C) 2015 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 | <span class="program-session-speaker"> |
27 | {% for speaker in speakers %} |
28 | {% if loop.last %} |
29 | {{ speaker }} |
30 | {% else %} |
31 | {{ speaker }}, |
32 | {% endif %} |
33 | {% endfor %} |
34 | </span> |
35 | {% endmacro %} |
36 | |
37 | {# make room macro #} |
38 | {% macro mk_room(room) %} |
39 | {% if room|lower != 'roomtba' %} |
40 | <span class="label label-default">{{ room }}</span> |
41 | {% endif %} |
42 | {% endmacro %} |
43 | |
44 | {# make day header macro #} |
45 | {% macro mk_day_header(day, collapse_area) %} |
46 | {% if day|trim != '' %} |
47 | <header class="program-day-header"> |
48 | <hgroup> |
49 | <h2>{{ day }}</h2> |
50 | </hgroup> |
51 | </header> |
52 | {% endif %} |
53 | {% endmacro %} |
54 | |
55 | {# make timeslot header macro #} |
56 | {% macro mk_timeslot_header(timeslot, collapse, collapse_area='') %} |
57 | {% if timeslot|trim != '' %} |
58 | <header class="program-timeslot-header"> |
59 | <hgroup> |
60 | <h2>{{ timeslot }}</h2> |
61 | </hgroup> |
62 | </header> |
63 | {% endif %} |
64 | {% endmacro %} |
65 | |
66 | {# make session header macro #} |
67 | {% macro mk_session_header(session) %} |
68 | <header class="program-session-header"> |
69 | <hgroup> |
70 | <h2>{{ session }}</h2> |
71 | </hgroup> |
72 | </header> |
73 | {% endmacro %} |
74 | |
75 | {# desc macro #} |
76 | {% macro desc(disc_list) %} |
77 | {% for desc_p in disc_list %} |
78 | <p>{{ desc_p }}</p> |
79 | {% endfor %} |
80 | {% endmacro %} |
81 | |
82 | {# populate sessions macro #} |
83 | {% macro populate_sessions(sessions, day_index, timeslot_index) %} |
84 | {% for session, session_info in sessions.iteritems() %} {# session start #} |
85 | <section id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}" class="program-session"> |
86 | {{ mk_session_header(session) }} |
87 | {{ mk_speakers(session_info['speakers']) }} |
88 | <p class="program-session-room-details"> |
89 | {{ mk_room(session_info['room']) }} |
90 | <button class="btn btn-default btn-xs" |
91 | data-toggle="collapse" aria-expanded="false" |
92 | aria-controls="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse" |
93 | data-target="#day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse"> |
94 | Details |
95 | </button> |
96 | </p> |
97 | <div class="collapse in" |
98 | id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse"> |
99 | {{ desc(session_info['desc']) }} |
100 | </div> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse end --> |
101 | </section> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} end --> |
102 | {% endfor %} {# session end #} |
103 | {% endmacro %} |
104 | |
105 | {# populate timeslots macro #} |
106 | {% macro populate_timeslots(timeslots, day_index) %} |
107 | {% for timeslot, sessions in timeslots.iteritems() %} {# timeslot start #} |
108 | <article id="day-{{ day_index }}-timeslot-{{ loop.index }}" class="program-timeslot"> |
109 | {{ mk_timeslot_header(timeslot) }} |
110 | {% if sessions|length > 0 %} |
111 | {{ populate_sessions(sessions, day_index, loop.index) }} |
112 | {% endif %} |
113 | </article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} end --> |
114 | {% endfor %} {# timeslot start #} |
115 | {% endmacro %} |
116 | |
117 | {# lp schedule 2016 template start #} |
118 | {% for day, timeslots in lp_dict.iteritems() %} {# day start #} |
119 | <article id="day-{{ loop.index }}-program" class="program-day"> |
120 | {{ mk_day_header(day) }} |
121 | {{ populate_timeslots(timeslots, loop.index) }} |
122 | </article> <!-- day-{{ loop.index }} end --> |
123 | {% endfor %} {# day loop end #} |