lp-speakers.jinja2 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {# -*- mode: jinja2; -*- #}
  2. {#
  3. Copyright (C) 2016 lpschedule-generator contributors. See CONTRIBUTORS.
  4. This file is part of lpschedule-generator.
  5. lpschedule-generator is free software: you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation, either version 3 of
  8. the License, or (at your option) any later version.
  9. lpschedule-generator is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with lpschedule-generator (see COPYING). If not, see
  15. <http://www.gnu.org/licenses/>.
  16. #}
  17. {# make speakers header macro #}
  18. {% macro mk_speakers_header(speaker_type) %}
  19. <header class="{{ speaker_type }}-header">
  20. <hgroup>
  21. {% if speaker_type == 'keynote-speakers' %}
  22. <h2>Keynote speakers</h2>
  23. {% else %}
  24. <h2>Speakers</h2>
  25. {% endif %}
  26. </hgroup>
  27. </header>
  28. {% endmacro %}
  29. {# make keynote speaker header macro #}
  30. {% macro mk_keynote_speaker_header(speaker, id) %}
  31. <header id="{{ id }}" class="keynote-speaker-header">
  32. <hgroup>
  33. <h2>{{ speaker }}</h2>
  34. </hgroup>
  35. </header>
  36. {% endmacro %}
  37. {# make speaker header macro #}
  38. {% macro mk_speaker_header(speaker, id) %}
  39. <header id="{{ id }}" class="speaker-header">
  40. <hgroup>
  41. <h2>{{ speaker }}</h2>
  42. </hgroup>
  43. </header>
  44. {% endmacro %}
  45. {# make bio macro #}
  46. {% macro mk_bio(bio_list) %}
  47. {% for bio_p in bio_list %}
  48. <p>{{ bio_p }}</p>
  49. {% endfor %}
  50. {% endmacro %}
  51. {# populate keynote speakers macro #}
  52. {% macro populate_keynote_speakers(speakers) %}
  53. {% for speaker in speakers %}
  54. <section class="speaker-block" id="lp-keynote-speaker-{{ loop.index }}">
  55. <!-- keynote-speaker-{{ loop.index }} row start -->
  56. <div class="row">
  57. {% if speaker.img_url %}
  58. <!-- keynote-speaker-{{ loop.index }} img column start -->
  59. <div class="col-md-3 col-sm-4 col-xs-5">
  60. <img class="img-responsive" src="{{ speaker.img_url }}"
  61. alt="[ {{ speaker.img_alt }} ]" />
  62. </div> <!-- keynote-speaker-{{ loop.index }} img column end -->
  63. <!-- keynote-speaker-{{ loop.index }} content column start -->
  64. <div class="col-md-9 col-sm-8 col-xs-7">
  65. {% else %}
  66. <!-- keynote-speaker-{{ loop.index }} content column start -->
  67. <div class="col-md-offset-3 col-sm-offset-4 col-xs-offset-5 col-md-9 col-sm-8 col-xs-7">
  68. {% endif %}
  69. {{ mk_keynote_speaker_header(speaker.speaker, speaker.id) }}
  70. {{ mk_bio(speaker.bio) }}
  71. </div> <!-- keynote-speaker-{{ loop.index }} content column end -->
  72. </div> <!-- keynote-speaker-{{ loop.index }} row end -->
  73. </section>
  74. {% endfor %}
  75. {% endmacro %}
  76. {# populate speakers macro #}
  77. {% macro populate_speakers(speakers) %}
  78. {% for speaker in speakers %}
  79. <section class="speaker-block" id="lp-speaker-{{ loop.index }}">
  80. <div class="row"> <!-- speaker-{{ loop.index }} row start -->
  81. {% if speaker.img_url %}
  82. <!-- speaker-{{ loop.index }} img column start -->
  83. <div class="col-md-2 col-sm-3 col-xs-4">
  84. <img class="img-responsive" src="{{ speaker.img_url }}"
  85. alt="[ {{ speaker.img_alt }} ]" />
  86. </div> <!-- speaker-{{ loop.index }} img column end -->
  87. <!-- speaker-{{ loop.index }} content column start -->
  88. <div class="col-md-10 col-sm-9 col-xs-8">
  89. {% else %}
  90. <!-- speaker-{{ loop.index }} content column start -->
  91. <div class="col-md-offset-2 col-sm-offset-3 col-xs-offset-4 col-md-10 col-sm-9 col-xs-8">
  92. {% endif %}
  93. {{ mk_speaker_header(speaker.speaker, speaker.id) }}
  94. {{ mk_bio(speaker.bio) }}
  95. </div> <!-- speaker-{{ loop.index }} content column end -->
  96. </div> <!-- speaker-{{ loop.index }} row end -->
  97. </section>
  98. {% endfor %}
  99. {% endmacro %}
  100. {# lp speakers 2016 template start #}
  101. {% for speaker_type, speakers in lp_dict.iteritems() %}
  102. <article class="speakers-block" id="lp-{{ speaker_type }}">
  103. {% if speaker_type == 'keynote-speakers' %}
  104. {{ mk_speakers_header(speaker_type) }}
  105. {{ populate_keynote_speakers(speakers) }}
  106. {% elif speaker_type == 'speakers' %}
  107. {{ mk_speakers_header(speaker_type) }}
  108. {{ populate_speakers(speakers) }}
  109. {% endif %}
  110. </article>
  111. {% endfor %}
  112. {# lp speakers 2016 template end #}