From d939dadedf6b9d8b431ae15a2fdfcf5b5ffd63d5 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 19 Dec 2015 23:44:57 -0500 Subject: Moved templates/ under lpschedule_generator module --- lpschedule_generator/__init__.py | 0 lpschedule_generator/templates/lp-sch-2016.jinja2 | 136 ++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 lpschedule_generator/__init__.py create mode 100644 lpschedule_generator/templates/lp-sch-2016.jinja2 (limited to 'lpschedule_generator') diff --git a/lpschedule_generator/__init__.py b/lpschedule_generator/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lpschedule_generator/templates/lp-sch-2016.jinja2 b/lpschedule_generator/templates/lp-sch-2016.jinja2 new file mode 100644 index 0000000..4ea99cc --- /dev/null +++ b/lpschedule_generator/templates/lp-sch-2016.jinja2 @@ -0,0 +1,136 @@ +{# -*- 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 + . +#} + +{# macros start #} + +{# make speakers macro #} +{% macro mk_speakers(speakers) %} + + {% for speaker in speakers %} + {% if loop.last %} + {{ speaker }} + {% else %} + {{ speaker }}, + {% endif %} + {% endfor %} + +{% endmacro %} + +{# make room macro #} +{% macro mk_room(room) %} +

{{ room }}

+{% endmacro %} + +{# make day header macro #} +{% macro mk_day_header(day, collapse_area) %} +
+
+

{{ day }} + +

+
+
+{% endmacro %} + +{# make timeslot header macro #} +{% macro mk_timeslot_header(timeslot, collapse, collapse_area='') %} +
+
+

{{ timeslot }} + {% if collapse %} + + {% endif %} +

+
+
+{% endmacro %} + +{# make session header macro #} +{% macro mk_session_header(session) %} +
+
+

{{ session }}

+
+
+{% endmacro %} + +{# desc macro #} +{% macro desc(disc_list) %} + {% for desc_p in disc_list %} +

{{ desc_p }}

+ {% endfor %} +{% endmacro %} + +{# populate sessions macro #} +{% macro populate_sessions(sessions, day_index, timeslot_index) %} + {% for session, session_info in sessions.iteritems() %} {# session start #} +
+ {{ mk_session_header(session) }} + {{ mk_speakers(session_info['speakers']) }} + +
+ {{ mk_room(session_info['room']) }} + {{ desc(session_info['desc']) }} +
+
+ {% endfor %} {# session end #} +{% endmacro %} + +{# populate timeslots macro #} +{% macro populate_timeslots(timeslots, day_index) %} + {% for timeslot, sessions in timeslots.iteritems() %} {# timeslot start #} +
+ {{ mk_timeslot_header(timeslot, sessions|length > 0, "day-%d-timeslot-%d-sessions"|format(day_index, loop.index)) }} + {% if sessions|length > 0 %} +
+ {{ populate_sessions(sessions, day_index, loop.index) }} +
+ {% endif %} +
+ {% endfor %} {# timeslot start #} +{% endmacro %} + +{# lp 2016 template start #} +{% for day, timeslots in schedule.iteritems() %} {# day start #} +
+ {{ mk_day_header(day, "day-%d-timeslots"|format(loop.index)) }} +
+ {{ populate_timeslots(timeslots, loop.index) }} +
+
+{% endfor %} {# day loop end #} -- cgit v1.2.3