lpschedule-generator

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

lp-speakers.jinja2 (3916B)


      1 {# -*- mode: jinja2; -*- #}
      2 {#
      3     SPDX-License-Identifier: CC0-1.0
      4 
      5     This file is part of lpschedule-generator.
      6 #}
      7 
      8 
      9 {# make speakers header macro #}
     10 {% macro mk_speakers_header(speaker_type) %}
     11   <header class="{{ speaker_type }}-header">
     12     <hgroup>
     13       {% if speaker_type == 'keynote-speakers' %}
     14         <h2>Keynote speakers</h2>
     15       {% else %}
     16         <h2>Speakers</h2>
     17       {% endif %}
     18     </hgroup>
     19   </header>
     20 {% endmacro %}
     21 
     22 {# make keynote speaker header macro #}
     23 {% macro mk_keynote_speaker_header(speaker, id) %}
     24   <header id="{{ id }}" class="keynote-speaker-header">
     25     <hgroup>
     26       <h2>{{ speaker }}</h2>
     27     </hgroup>
     28   </header>
     29 {% endmacro %}
     30 
     31 {# make speaker header macro #}
     32 {% macro mk_speaker_header(speaker, id) %}
     33   <header id="{{ id }}" class="speaker-header">
     34     <hgroup>
     35       <h2>{{ speaker }}</h2>
     36     </hgroup>
     37   </header>
     38 {% endmacro %}
     39 
     40 {# make bio macro #}
     41 {% macro mk_bio(bio_list) %}
     42   {% for bio_p in bio_list %}
     43     <p>{{ bio_p }}</p>
     44   {% endfor %}
     45 {% endmacro %}
     46 
     47 {# populate keynote speakers macro #}
     48 {% macro populate_keynote_speakers(speakers) %}
     49   {% for speaker in speakers %}
     50     <section class="speaker-block" id="lp-keynote-speaker-{{ loop.index }}">
     51       <!-- keynote-speaker-{{ loop.index }} row start -->
     52       <div class="row">
     53         {% if speaker.img_url %}
     54           <!-- keynote-speaker-{{ loop.index }} img column start -->
     55           <div class="col-md-3 col-sm-4 col-xs-5">
     56             <img class="img-responsive" src="{{ speaker.img_url }}"
     57                  alt="[ {{ speaker.img_alt }} ]" />
     58           </div> <!-- keynote-speaker-{{ loop.index }} img column end -->
     59           <!-- keynote-speaker-{{ loop.index }} content column start -->
     60           <div class="col-md-9 col-sm-8 col-xs-7">
     61         {% else %}
     62           <!-- keynote-speaker-{{ loop.index }} content column start -->
     63           <div class="col-md-offset-3 col-sm-offset-4 col-xs-offset-5 col-md-9 col-sm-8 col-xs-7">
     64         {% endif %}
     65         {{ mk_keynote_speaker_header(speaker.speaker, speaker.id) }}
     66         {{ mk_bio(speaker.bio) }}
     67         </div> <!-- keynote-speaker-{{ loop.index }} content column end -->
     68       </div> <!-- keynote-speaker-{{ loop.index }} row end -->
     69     </section>
     70   {% endfor %}
     71 {% endmacro %}
     72 
     73 {# populate speakers macro #}
     74 {% macro populate_speakers(speakers) %}
     75   {% for speaker in speakers %}
     76     <section class="speaker-block" id="lp-speaker-{{ loop.index }}">
     77       <div class="row"> <!-- speaker-{{ loop.index }} row start -->
     78         {% if speaker.img_url %}
     79           <!-- speaker-{{ loop.index }} img column start -->
     80           <div class="col-md-2 col-sm-3 col-xs-4">
     81             <img class="img-responsive" src="{{ speaker.img_url }}"
     82                  alt="[ {{ speaker.img_alt }} ]" />
     83           </div> <!-- speaker-{{ loop.index }} img column end -->
     84           <!-- speaker-{{ loop.index }} content column start -->
     85           <div class="col-md-10 col-sm-9 col-xs-8">
     86         {% else %}
     87           <!-- speaker-{{ loop.index }} content column start -->
     88           <div class="col-md-offset-2 col-sm-offset-3 col-xs-offset-4 col-md-10 col-sm-9 col-xs-8">
     89         {% endif %}
     90         {{ mk_speaker_header(speaker.speaker, speaker.id) }}
     91         {{ mk_bio(speaker.bio) }}
     92         </div> <!-- speaker-{{ loop.index }} content column end -->
     93       </div> <!-- speaker-{{ loop.index }} row end -->
     94     </section>
     95   {% endfor %}
     96 {% endmacro %}
     97 
     98 {# lp speakers 2016 template start #}
     99 {% for speaker_type, speakers in lp_dict.items() %}
    100   <article class="speakers-block" id="lp-{{ speaker_type }}">
    101     {% if speaker_type == 'keynote-speakers' %}
    102       {{ mk_speakers_header(speaker_type) }}
    103       {{ populate_keynote_speakers(speakers) }}
    104     {% elif speaker_type == 'speakers' %}
    105       {{ mk_speakers_header(speaker_type) }}
    106       {{ populate_speakers(speakers) }}
    107     {% endif %}
    108   </article>
    109 {% endfor %}
    110 {# lp speakers 2016 template end #}