Switching to GitHub-defined variables
[rnaseq-cwl-training.git] / _includes / syllabus.html
1 {% comment %}
2   Display syllabus in tabular form.
3   Days are displayed if at least one episode has 'start = true'.
4 {% endcomment %}
5 <div class="syllabus">
6   <h2>Schedule</h2>
7
8   {% assign day = 0 %}
9   {% assign multiday = false %}
10   {% for episode in site.episodes %}
11     {% if episode.start %}{% assign multiday = true %}{% break %}{% endif %}
12   {% endfor %}
13   {% assign current = site.start_time %}
14
15   <table class="table table-striped">
16   {% for episode in site.episodes %}
17     {% if episode.start %} {% comment %} Starting a new day? {% endcomment %}
18       {% assign day = day | plus: 1 %}
19       {% if day > 1 %} {% comment %} If about to start day 2 or later, show finishing time for previous day {% endcomment %}
20         {% assign hours = current | divided_by: 60 %}
21         {% assign minutes = current | modulo: 60 %}
22         <tr>
23           {% if multiday %}<td></td>{% endif %}
24           <td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
25           <td class="col-md-3">Finish</td>
26           <td class="col-md-7"></td>
27         </tr>
28       {% endif %}
29       {% assign current = site.start_time %} {% comment %}Re-set start time of this episode to general daily start time {% endcomment %}
30     {% endif %}
31     {% assign hours = current | divided_by: 60 %}
32     {% assign minutes = current | modulo: 60 %}
33     <tr>
34       {% if multiday %}<td class="col-md-1">{% if episode.start %}Day {{ day }}{% endif %}</td>{% endif %}
35       <td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
36       <td class="col-md-3">
37         <a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
38       </td>
39       <td class="col-md-7">
40         {% if episode.break %}
41           Break
42         {% else %}
43           {% if episode.questions %}
44             {% for question in episode.questions %}
45               {{question|markdownify|strip_html}}
46               {% unless forloop.last %}
47               <br/>
48               {% endunless %}
49             {% endfor %}
50           {% endif %}
51         {% endif %}
52       </td>
53     </tr>
54     {% assign current = current | plus: episode.teaching | plus: episode.exercises | plus: episode.break %}
55   {% endfor %}
56   {% assign hours = current | divided_by: 60 %}
57   {% assign minutes = current | modulo: 60 %}
58   <tr>
59     {% if multiday %}<td></td>{% endif %}
60     <td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
61     <td class="col-md-3">Finish</td>
62     <td class="col-md-7"></td>
63   </tr>
64   </table>
65 </div>