schedule.jinja2 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {# -*- mode: jinja2; -*- #}
  2. {#
  3. SPDX-License-Identifier: CC0-1.0
  4. This file is part of lpschedule-generator.
  5. #}
  6. {# macros start #}
  7. {# make speakers macro #}
  8. {% macro mk_speakers(speakers) %}
  9. {% if speakers[0]|lower != 'speakertba' %}
  10. <div class="program-session-speaker">
  11. {% for speaker in speakers %}
  12. {% if loop.last %}
  13. {{ speaker }}
  14. {% else %}
  15. {{ speaker }},
  16. {% endif %}
  17. {% endfor %}
  18. </div>
  19. {% endif %}
  20. {% endmacro %}
  21. {# make room macro #}
  22. {% macro mk_room(room) %}
  23. {% if room|lower != 'roomtba' %}
  24. <div class="program-session-room-details">
  25. <span class="room label label-default">{{ room }}</span>
  26. </div>
  27. {% endif %}
  28. {% endmacro %}
  29. {# make video macro #}
  30. {% macro mk_video(video) %}
  31. {% if video|lower != 'videotba' %}
  32. <a class="btn btn-default btn-xs" href="{{ video }}">
  33. <span class="glyphicon glyphicon-facetime-video"></span>
  34. </a>
  35. {% endif %}
  36. {% endmacro %}
  37. {# make desc details button macro #}
  38. {% macro mk_desc_details_btn(disc_list) %}
  39. {% if disc_list[0]|lower != 'desctba' %}
  40. <button class="btn btn-default btn-xs"
  41. data-toggle="collapse" aria-expanded="false"
  42. aria-controls="{{ caller()|trim }}"
  43. data-target="#{{ caller()|trim }}">
  44. Show details
  45. <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span>
  46. </button>
  47. {% endif %}
  48. {% endmacro %}
  49. {% macro mk_desc(disc_list) %}
  50. {% if disc_list[0]|lower != 'desctba' %}
  51. <div class="session-desc collapse in"
  52. id="{{ caller()|trim }}">
  53. {{ desc(disc_list) }}
  54. </div> <!-- {{ caller()|trim }} end -->
  55. {% endif %}
  56. {% endmacro %}
  57. {# make day header macro #}
  58. {% macro mk_day_header(day, collapse_area) %}
  59. {% if day|trim != '' %}
  60. <header class="program-day-header">
  61. <hgroup>
  62. <h2>{{ day }}</h2>
  63. </hgroup>
  64. </header>
  65. {% endif %}
  66. {% endmacro %}
  67. {# make timeslot header macro #}
  68. {% macro mk_timeslot_header(timeslot, collapse, collapse_area='') %}
  69. {% if timeslot|trim != '' %}
  70. <header class="program-timeslot-header">
  71. <hgroup>
  72. <h2>{{ timeslot }}</h2>
  73. </hgroup>
  74. </header>
  75. {% endif %}
  76. {% endmacro %}
  77. {# make session header macro #}
  78. {% macro mk_session_header(session) %}
  79. {% if session|trim not in ['', 'st-from-ts'] %}
  80. <header class="program-session-header">
  81. <hgroup>
  82. <h2>{{ session }}</h2>
  83. </hgroup>
  84. </header>
  85. {% endif %}
  86. {% endmacro %}
  87. {# desc macro #}
  88. {% macro desc(disc_list) %}
  89. {% for desc_p in disc_list %}
  90. <p>{{ desc_p }}</p>
  91. {% endfor %}
  92. {% endmacro %}
  93. {# populate sessions macro #}
  94. {% macro populate_sessions(sessions, day_index, timeslot_index) %}
  95. {% for session, session_info in sessions.items() %} {# session start #}
  96. <section id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}" class="program-session">
  97. {{ mk_session_header(session) }}
  98. {{ mk_speakers(session_info['speakers']) }}
  99. <div class="program-session-shelf">
  100. {{ mk_room(session_info['room']) }}
  101. {{ mk_video(session_info['video']) }}
  102. {% call mk_desc_details_btn(session_info['desc']) %}
  103. day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse
  104. {% endcall %}
  105. </div>
  106. <div class="program-session-desc-block">
  107. {% call mk_desc(session_info['desc']) %}
  108. day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}-collapse
  109. {% endcall %}
  110. </div>
  111. </section> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} end -->
  112. {% endfor %} {# session end #}
  113. {% endmacro %}
  114. {# populate timeslots macro #}
  115. {% macro populate_timeslots(timeslots, day_index) %}
  116. {% for timeslot, sessions in timeslots.items() %} {# timeslot start #}
  117. <article id="day-{{ day_index }}-timeslot-{{ loop.index }}" class="program-timeslot">
  118. {{ mk_timeslot_header(timeslot) }}
  119. {% if sessions|length > 0 %}
  120. {{ populate_sessions(sessions, day_index, loop.index) }}
  121. {% endif %}
  122. </article> <!-- day-{{ day_index }}-timeslot-{{ loop.index }} end -->
  123. {% endfor %} {# timeslot start #}
  124. {% endmacro %}
  125. {# lp schedule 2019 template start #}
  126. {% for day, timeslots in lp_dict.items() %} {# day start #}
  127. <article id="day-{{ loop.index }}-program" class="program-day">
  128. {{ mk_day_header(day) }}
  129. {{ populate_timeslots(timeslots, loop.index) }}
  130. </article> <!-- day-{{ loop.index }} end -->
  131. {% endfor %} {# day loop end #}