fcf95e6d |
1 | {# -*- mode: jinja2; -*- #} |
2 | {# |
3 | Copyright (C) 2016 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 | |
23 | {# make speakers header macro #} |
24 | {% macro mk_speakers_header(speaker_type) %} |
25 | <header class="{{ speaker_type }}-header"> |
26 | <hgroup> |
27 | {% if speaker_type == 'keynote-speakers' %} |
28 | <h2>Keynote speakers</h2> |
29 | {% else %} |
30 | <h2>Speakers</h2> |
31 | {% endif %} |
32 | </hgroup> |
33 | </header> |
34 | {% endmacro %} |
35 | |
36 | {# make keynote speaker header macro #} |
37 | {% macro mk_keynote_speaker_header(speaker, id) %} |
38 | <header id="{{ id }}" class="keynote-speaker-header"> |
39 | <hgroup> |
40 | <h2>{{ speaker }}</h2> |
41 | </hgroup> |
42 | </header> |
43 | {% endmacro %} |
44 | |
45 | {# make speaker header macro #} |
46 | {% macro mk_speaker_header(speaker, id) %} |
47 | <header id="{{ id }}" class="speaker-header"> |
48 | <hgroup> |
49 | <h2>{{ speaker }}</h2> |
50 | </hgroup> |
51 | </header> |
52 | {% endmacro %} |
53 | |
54 | {# make bio macro #} |
55 | {% macro mk_bio(bio_list) %} |
56 | {% for bio_p in bio_list %} |
57 | <p>{{ bio_p }}</p> |
58 | {% endfor %} |
59 | {% endmacro %} |
60 | |
61 | {# populate keynote speakers macro #} |
62 | {% macro populate_keynote_speakers(speakers) %} |
63 | {% for speaker in speakers %} |
64 | <section class="speaker-block" id="lp-keynote-speaker-{{ loop.index }}"> |
65 | <!-- keynote-speaker-{{ loop.index }} row start --> |
66 | <div class="row"> |
67 | {% if speaker.img_url %} |
68 | <!-- keynote-speaker-{{ loop.index }} img column start --> |
69 | <div class="col-md-3 col-sm-4 col-xs-5"> |
70 | <img class="img-responsive" src="{{ speaker.img_url }}" |
71 | alt="[ {{ speaker.img_alt }} ]" /> |
72 | </div> <!-- keynote-speaker-{{ loop.index }} img column end --> |
73 | <!-- keynote-speaker-{{ loop.index }} content column start --> |
74 | <div class="col-md-9 col-sm-8 col-xs-7"> |
75 | {% else %} |
76 | <!-- keynote-speaker-{{ loop.index }} content column start --> |
77 | <div class="col-md-offset-3 col-sm-offset-4 col-xs-offset-5 col-md-9 col-sm-8 col-xs-7"> |
78 | {% endif %} |
79 | {{ mk_keynote_speaker_header(speaker.speaker, speaker.id) }} |
80 | {{ mk_bio(speaker.bio) }} |
81 | </div> <!-- keynote-speaker-{{ loop.index }} content column end --> |
82 | </div> <!-- keynote-speaker-{{ loop.index }} row end --> |
83 | </section> |
84 | {% endfor %} |
85 | {% endmacro %} |
86 | |
87 | {# populate speakers macro #} |
88 | {% macro populate_speakers(speakers) %} |
89 | {% for speaker in speakers %} |
90 | <section class="speaker-block" id="lp-speaker-{{ loop.index }}"> |
91 | <div class="row"> <!-- speaker-{{ loop.index }} row start --> |
92 | {% if speaker.img_url %} |
93 | <!-- speaker-{{ loop.index }} img column start --> |
94 | <div class="col-md-2 col-sm-3 col-xs-4"> |
95 | <img class="img-responsive" src="{{ speaker.img_url }}" |
96 | alt="[ {{ speaker.img_alt }} ]" /> |
97 | </div> <!-- speaker-{{ loop.index }} img column end --> |
98 | <!-- speaker-{{ loop.index }} content column start --> |
99 | <div class="col-md-10 col-sm-9 col-xs-8"> |
100 | {% else %} |
101 | <!-- speaker-{{ loop.index }} content column start --> |
102 | <div class="col-md-offset-2 col-sm-offset-3 col-xs-offset-4 col-md-10 col-sm-9 col-xs-8"> |
103 | {% endif %} |
104 | {{ mk_speaker_header(speaker.speaker, speaker.id) }} |
105 | {{ mk_bio(speaker.bio) }} |
106 | </div> <!-- speaker-{{ loop.index }} content column end --> |
107 | </div> <!-- speaker-{{ loop.index }} row end --> |
108 | </section> |
109 | {% endfor %} |
110 | {% endmacro %} |
111 | |
112 | {# lp speakers 2016 template start #} |
113 | {% for speaker_type, speakers in lp_dict.iteritems() %} |
114 | <article class="speakers-block" id="lp-{{ speaker_type }}"> |
115 | {% if speaker_type == 'keynote-speakers' %} |
116 | {{ mk_speakers_header(speaker_type) }} |
117 | {{ populate_keynote_speakers(speakers) }} |
118 | {% elif speaker_type == 'speakers' %} |
119 | {{ mk_speakers_header(speaker_type) }} |
120 | {{ populate_speakers(speakers) }} |
121 | {% endif %} |
122 | </article> |
123 | {% endfor %} |
124 | {# lp speakers 2016 template end #} |