summaryrefslogtreecommitdiffstats
path: root/templates/lp-sch-2016.jinja2
blob: ce31deeffbcd473278523d3f41bd8ee5cf6bfc59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{# -*- mode: jinja2; -*- #}
{#
   Copyright (C) 2015  lpschedule-generator contributors. See CONTRIBUTORS.

    This file is part of lpschedule-generator.

   lpschedule-generator is free software: you can redistribute it
   and/or modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation, either version 3 of
   the License, or (at your option) any later version.

   lpschedule-generator is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with lpschedule-generator (see COPYING).  If not, see
   <http://www.gnu.org/licenses/>.
#}

{# macros start #}

{# make day header macro #}
{% macro mk_day_header(day) %}
  <header>
    <hgroup>
      <h2>{{ day }}</h2>
    </hgroup>
  </header>
{% endmacro %}

{# make timeslot header macro #}
{% macro mk_timeslot_header(timeslot) %}
  <header>
    <hgroup>
      <h2>{{ timeslot }}</h2>
    </hgroup>
  </header>
{% endmacro %}

{# make session header macro #}
{% macro mk_session_header(session) %}
  <header>
    <hgroup>
      <h2>{{ session }}</h2>
    </hgroup>
  </header>
{% endmacro %}

{# desc macro #}
{% macro desc(disc_list) %}
  {% for desc_p in disc_list %}
    <p>{{ desc_p }}</p>
  {% endfor %}
{% endmacro %}

{# populate sessions macro #}
{% macro populate_sessions(sessions, day_index, timeslot_index) %}
  {% for session, session_info in sessions.iteritems() %} {# session start #}
    <section> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} start -->
      {{ mk_session_header(session) }}
      <p>{{ session_info['speaker'] }}</p>
      <p>{{ session_info['room'] }}</p>
      {{ desc(session_info['desc']) }}
    </section> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} end -->
  {% endfor %} {# session end #}
{% endmacro %}

{# populate timeslots macro #}
{% macro populate_timeslots(timeslots, day_index) %}
  {% for timeslot, sessions in timeslots.iteritems() %}  {# timeslot start #}
    <article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} start -->
      {{ mk_timeslot_header(timeslot) }}
      {{ populate_sessions(sessions, day_index, loop.index) }}
    </article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} end -->
  {% endfor %} {# timeslot start #}
{% endmacro %}

{# lp 2016 template start #}
{% for day, timeslots in schedule.iteritems() %} {# day start #}
  <article> <!-- day-{{ loop.index }} start -->
    {{ mk_day_header(day) }}
    {{ populate_timeslots(timeslots, loop.index) }}
  </article> <!-- day-{{ loop.index }} end -->
{% endfor %} {# day loop end #}