lpschedule-generator

libreplanet schedule generator - ricketyspace.net/lpschedule-generator
git clone git://git.ricketyspace.net/lpschedule-generator.git
Log | Files | Refs

commit e6161cf8dcdd6c0677d0f72c5b14da0312b26906
parent dc94a41802df53806821da65d0443566a5727781
Author: rsiddharth <rsd@gnu.org>
Date:   Sat, 13 Jul 2019 16:59:08 -0400

libreplanet-templates/2019/lp-schedule.jinja2 -> lpschedule_generator/data/schedule.jinja2

Diffstat:
libreplanet-templates/2019/lp-schedule.jinja2 | 146-------------------------------------------------------------------------------
lpschedule_generator/data/schedule.jinja2 | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 146 insertions(+), 146 deletions(-)

diff --git a/libreplanet-templates/2019/lp-schedule.jinja2 b/libreplanet-templates/2019/lp-schedule.jinja2 @@ -1,146 +0,0 @@ -{# -*- mode: jinja2; -*- #} -{# - SPDX-License-Identifier: CC0-1.0 - - This file is part of lpschedule-generator. -#} - -{# macros start #} - -{# make speakers macro #} -{% macro mk_speakers(speakers) %} - {% if speakers[0]|lower != 'speakertba' %} - <div class="program-session-speaker"> - {% for speaker in speakers %} - {% if loop.last %} - {{ speaker }} - {% else %} - {{ speaker }}, - {% endif %} - {% endfor %} - </div> - {% endif %} -{% endmacro %} - -{# make room macro #} -{% macro mk_room(room) %} - {% if room|lower != 'roomtba' %} - <div class="program-session-room-details"> - <span class="room label label-default">{{ room }}</span> - </div> - {% endif %} -{% endmacro %} - -{# make video macro #} -{% macro mk_video(video) %} - {% if video|lower != 'videotba' %} - <a class="btn btn-default btn-xs" href="{{ video }}"> - <span class="glyphicon glyphicon-facetime-video"></span> - </a> - {% endif %} -{% endmacro %} - -{# make desc details button macro #} -{% macro mk_desc_details_btn(disc_list) %} - {% if disc_list[0]|lower != 'desctba' %} - <button class="btn btn-default btn-xs" - data-toggle="collapse" aria-expanded="false" - aria-controls="{{ caller()|trim }}" - data-target="#{{ caller()|trim }}"> - Show details - <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span> - </button> - {% endif %} -{% endmacro %} - -{% macro mk_desc(disc_list) %} - {% if disc_list[0]|lower != 'desctba' %} - <div class="session-desc collapse in" - id="{{ caller()|trim }}"> - {{ desc(disc_list) }} - </div> <!-- {{ caller()|trim }} end --> - {% endif %} -{% endmacro %} - -{# make day header macro #} -{% macro mk_day_header(day, collapse_area) %} - {% if day|trim != '' %} - <header class="program-day-header"> - <hgroup> - <h2>{{ day }}</h2> - </hgroup> - </header> - {% endif %} -{% endmacro %} - -{# make timeslot header macro #} -{% macro mk_timeslot_header(timeslot, collapse, collapse_area='') %} - {% if timeslot|trim != '' %} - <header class="program-timeslot-header"> - <hgroup> - <h2>{{ timeslot }}</h2> - </hgroup> - </header> - {% endif %} -{% endmacro %} - -{# make session header macro #} -{% macro mk_session_header(session) %} - {% if session|trim not in ['', 'st-from-ts'] %} - <header class="program-session-header"> - <hgroup> - <h2>{{ session }}</h2> - </hgroup> - </header> - {% endif %} -{% 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.items() %} {# session start #} - <section id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}" class="program-session"> - {{ mk_session_header(session) }} - {{ mk_speakers(session_info['speakers']) }} - <div class="program-session-shelf"> - {{ mk_room(session_info['room']) }} - {{ mk_video(session_info['video']) }} - {% call mk_desc_details_btn(session_info['desc']) %} - day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse - {% endcall %} - </div> - - <div class="program-session-desc-block"> - {% call mk_desc(session_info['desc']) %} - day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse - {% endcall %} - </div> - </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.items() %} {# timeslot start #} - <article id="day-{{ day_index }}-timeslot-{{ loop.index }}" class="program-timeslot"> - {{ mk_timeslot_header(timeslot) }} - {% if sessions|length > 0 %} - {{ populate_sessions(sessions, day_index, loop.index) }} - {% endif %} - </article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} end --> - {% endfor %} {# timeslot start #} -{% endmacro %} - -{# lp schedule 2019 template start #} -{% for day, timeslots in lp_dict.items() %} {# day start #} - <article id="day-{{ loop.index }}-program" class="program-day"> - {{ mk_day_header(day) }} - {{ populate_timeslots(timeslots, loop.index) }} - </article> <!-- day-{{ loop.index }} end --> -{% endfor %} {# day loop end #} diff --git a/lpschedule_generator/data/schedule.jinja2 b/lpschedule_generator/data/schedule.jinja2 @@ -0,0 +1,146 @@ +{# -*- mode: jinja2; -*- #} +{# + SPDX-License-Identifier: CC0-1.0 + + This file is part of lpschedule-generator. +#} + +{# macros start #} + +{# make speakers macro #} +{% macro mk_speakers(speakers) %} + {% if speakers[0]|lower != 'speakertba' %} + <div class="program-session-speaker"> + {% for speaker in speakers %} + {% if loop.last %} + {{ speaker }} + {% else %} + {{ speaker }}, + {% endif %} + {% endfor %} + </div> + {% endif %} +{% endmacro %} + +{# make room macro #} +{% macro mk_room(room) %} + {% if room|lower != 'roomtba' %} + <div class="program-session-room-details"> + <span class="room label label-default">{{ room }}</span> + </div> + {% endif %} +{% endmacro %} + +{# make video macro #} +{% macro mk_video(video) %} + {% if video|lower != 'videotba' %} + <a class="btn btn-default btn-xs" href="{{ video }}"> + <span class="glyphicon glyphicon-facetime-video"></span> + </a> + {% endif %} +{% endmacro %} + +{# make desc details button macro #} +{% macro mk_desc_details_btn(disc_list) %} + {% if disc_list[0]|lower != 'desctba' %} + <button class="btn btn-default btn-xs" + data-toggle="collapse" aria-expanded="false" + aria-controls="{{ caller()|trim }}" + data-target="#{{ caller()|trim }}"> + Show details + <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span> + </button> + {% endif %} +{% endmacro %} + +{% macro mk_desc(disc_list) %} + {% if disc_list[0]|lower != 'desctba' %} + <div class="session-desc collapse in" + id="{{ caller()|trim }}"> + {{ desc(disc_list) }} + </div> <!-- {{ caller()|trim }} end --> + {% endif %} +{% endmacro %} + +{# make day header macro #} +{% macro mk_day_header(day, collapse_area) %} + {% if day|trim != '' %} + <header class="program-day-header"> + <hgroup> + <h2>{{ day }}</h2> + </hgroup> + </header> + {% endif %} +{% endmacro %} + +{# make timeslot header macro #} +{% macro mk_timeslot_header(timeslot, collapse, collapse_area='') %} + {% if timeslot|trim != '' %} + <header class="program-timeslot-header"> + <hgroup> + <h2>{{ timeslot }}</h2> + </hgroup> + </header> + {% endif %} +{% endmacro %} + +{# make session header macro #} +{% macro mk_session_header(session) %} + {% if session|trim not in ['', 'st-from-ts'] %} + <header class="program-session-header"> + <hgroup> + <h2>{{ session }}</h2> + </hgroup> + </header> + {% endif %} +{% 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.items() %} {# session start #} + <section id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}" class="program-session"> + {{ mk_session_header(session) }} + {{ mk_speakers(session_info['speakers']) }} + <div class="program-session-shelf"> + {{ mk_room(session_info['room']) }} + {{ mk_video(session_info['video']) }} + {% call mk_desc_details_btn(session_info['desc']) %} + day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse + {% endcall %} + </div> + + <div class="program-session-desc-block"> + {% call mk_desc(session_info['desc']) %} + day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse + {% endcall %} + </div> + </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.items() %} {# timeslot start #} + <article id="day-{{ day_index }}-timeslot-{{ loop.index }}" class="program-timeslot"> + {{ mk_timeslot_header(timeslot) }} + {% if sessions|length > 0 %} + {{ populate_sessions(sessions, day_index, loop.index) }} + {% endif %} + </article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} end --> + {% endfor %} {# timeslot start #} +{% endmacro %} + +{# lp schedule 2019 template start #} +{% for day, timeslots in lp_dict.items() %} {# day start #} + <article id="day-{{ loop.index }}-program" class="program-day"> + {{ mk_day_header(day) }} + {{ populate_timeslots(timeslots, loop.index) }} + </article> <!-- day-{{ loop.index }} end --> +{% endfor %} {# day loop end #}