Preparing for June 2016 release
[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             {{ episode.questions | join: '<br/>' }}
45           {% endif %}
46         {% endif %}
47       </td>
48     </tr>
49     {% assign current = current | plus: episode.teaching | plus: episode.exercises | plus: episode.break %}
50   {% endfor %}
51   {% assign hours = current | divided_by: 60 %}
52   {% assign minutes = current | modulo: 60 %}
53   <tr>
54     {% if multiday %}<td></td>{% endif %}
55     <td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
56     <td class="col-md-3">Finish</td>
57     <td class="col-md-7"></td>
58   </tr>
59   </table>
60 </div>