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