summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorrsiddharth <rsd@gnu.org>2015-12-15 20:50:39 -0500
committerrsiddharth <rsd@gnu.org>2015-12-15 20:50:39 -0500
commitaac9e52d138fef142b67a85921bff643060cf277 (patch)
treec3eabbdff964429c91228997b46f46284cacb548 /templates
parenta28e07096198b52da4e1e1411d1f761d411e0db1 (diff)
HTMLRender -> RenderHTML + changes to it.
`RenderHTML` (was `HTMLRender`) now uses `PackagLoader` instead of FileSystemLoader and the template are loaded from the templates/ directory.
Diffstat (limited to 'templates')
-rw-r--r--templates/lp-sch-2016.jinja267
1 files changed, 67 insertions, 0 deletions
diff --git a/templates/lp-sch-2016.jinja2 b/templates/lp-sch-2016.jinja2
new file mode 100644
index 0000000..fbffc0a
--- /dev/null
+++ b/templates/lp-sch-2016.jinja2
@@ -0,0 +1,67 @@
+{# -*- mode: jinja2; -*- #}
+
+{# 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 #}