Merge pull request #345 from maxim-belkin/margin0
[rnaseq-cwl-training.git] / _includes / syllabus.html
1 {% include base_path.html %}
2
3 {% comment %}
4   Display syllabus in tabular form.
5   Days are displayed if at least one episode has 'start = true'.
6 {% endcomment %}
7 <div class="syllabus">
8   <h2 id="schedule">Schedule</h2>
9
10   {% assign lesson_number = 0 %}
11   {% assign day = 0 %}
12   {% assign multiday = false %}
13   {% for episode in site.episodes %}
14     {% if episode.start %}{% assign multiday = true %}{% break %}{% endif %}
15   {% endfor %}
16   {% assign current = site.start_time %}
17
18   <table class="table table-striped">
19   <tr>
20     {% if multiday %}<td class="col-md-1"></td>{% endif %}
21     <td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}"></td>
22     <td class="col-md-3"><a href="{{ relative_root_path }}{% link setup.md %}">Setup</a></td>
23     <td class="col-md-7">Download files required for the lesson</td>
24   </tr>
25   {% for episode in site.episodes %}
26     {% if episode.start %} {% comment %} Starting a new day? {% endcomment %}
27       {% assign day = day | plus: 1 %}
28       {% if day > 1 %} {% comment %} If about to start day 2 or later, show finishing time for previous day {% endcomment %}
29         {% assign hours = current | divided_by: 60 %}
30         {% assign minutes = current | modulo: 60 %}
31         <tr>
32           {% if multiday %}<td class="col-md-1"></td>{% endif %}
33           <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>
34           <td class="col-md-3">Finish</td>
35           <td class="col-md-7"></td>
36         </tr>
37       {% endif %}
38       {% assign current = site.start_time %} {% comment %}Re-set start time of this episode to general daily start time {% endcomment %}
39     {% endif %}
40     {% assign hours = current | divided_by: 60 %}
41     {% assign minutes = current | modulo: 60 %}
42     <tr>
43       {% if multiday %}<td class="col-md-1">{% if episode.start %}Day {{ day }}{% endif %}</td>{% endif %}
44       <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>
45       <td class="col-md-3">
46         {% assign lesson_number = lesson_number | plus: 1 %}
47         {{ lesson_number }}. <a href="{{ relative_root_path }}{{ episode.url }}">{{ episode.title }}</a>
48       </td>
49       <td class="col-md-7">
50         {% if episode.break %}
51           Break
52         {% else %}
53           {% if episode.questions %}
54             {% for question in episode.questions %}
55               {{question|markdownify|strip_html}}
56               {% unless forloop.last %}
57               <br/>
58               {% endunless %}
59             {% endfor %}
60           {% endif %}
61         {% endif %}
62       </td>
63     </tr>
64     {% assign current = current | plus: episode.teaching | plus: episode.exercises | plus: episode.break %}
65   {% endfor %}
66   {% assign hours = current | divided_by: 60 %}
67   {% assign minutes = current | modulo: 60 %}
68   <tr>
69     {% if multiday %}<td class="col-md-1"></td>{% endif %}
70     <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>
71     <td class="col-md-3">Finish</td>
72     <td class="col-md-7"></td>
73   </tr>
74   </table>
75
76   <p>
77     The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
78   </p>
79
80 </div>