Enforce Bootstrap's 12 column layout
[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 id="schedule">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   <tr>
17     {% if multiday %}<td class="col-md-1"></td>{% endif %}
18     <td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}"></td>
19     <td class="col-md-3"><a href="{{ page.root }}/setup">Setup</a></td>
20     <td class="col-md-7">Dowload files used on the lesson.</td>
21   </tr>
22   {% for episode in site.episodes %}
23     {% if episode.start %} {% comment %} Starting a new day? {% endcomment %}
24       {% assign day = day | plus: 1 %}
25       {% if day > 1 %} {% comment %} If about to start day 2 or later, show finishing time for previous day {% endcomment %}
26         {% assign hours = current | divided_by: 60 %}
27         {% assign minutes = current | modulo: 60 %}
28         <tr>
29           {% if multiday %}<td class="col-md-1"></td>{% endif %}
30           <td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
31           <td class="col-md-3">Finish</td>
32           <td class="col-md-7"></td>
33         </tr>
34       {% endif %}
35       {% assign current = site.start_time %} {% comment %}Re-set start time of this episode to general daily start time {% endcomment %}
36     {% endif %}
37     {% assign hours = current | divided_by: 60 %}
38     {% assign minutes = current | modulo: 60 %}
39     <tr>
40       {% if multiday %}<td class="col-md-1">{% if episode.start %}Day {{ day }}{% endif %}</td>{% endif %}
41       <td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
42       <td class="col-md-3">
43         <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
44       </td>
45       <td class="col-md-7">
46         {% if episode.break %}
47           Break
48         {% else %}
49           {% if episode.questions %}
50             {% for question in episode.questions %}
51               {{question|markdownify|strip_html}}
52               {% unless forloop.last %}
53               <br/>
54               {% endunless %}
55             {% endfor %}
56           {% endif %}
57         {% endif %}
58       </td>
59     </tr>
60     {% assign current = current | plus: episode.teaching | plus: episode.exercises | plus: episode.break %}
61   {% endfor %}
62   {% assign hours = current | divided_by: 60 %}
63   {% assign minutes = current | modulo: 60 %}
64   <tr>
65     {% if multiday %}<td class="col-md-1"></td>{% endif %}
66     <td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
67     <td class="col-md-3">Finish</td>
68     <td class="col-md-7"></td>
69   </tr>
70   </table>
71
72   <p>
73     The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
74   </p>
75
76 </div>