-
Notifications
You must be signed in to change notification settings - Fork 2
/
schedule.ejs
94 lines (85 loc) · 3.17 KB
/
schedule.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
```{=html}
<% items.sort(function(b,a){return new Date(b.date) - new Date(a.date)}) %>
<% var currentWeek = 0 %>
<% var displayWeek = 0 %>
<% const weekdayNames = ["Su","M","T","W","Th","F","Sa"]; %>
<% var currentModule = "NA" %>
<% for (var i = 0; i < items.length; i++) { %>
<% var currentItem = items[i] %>
<% var itemDate = new Date(currentItem.date) %>
<% var weekday = itemDate.toLocaleString('en-US', { weekday: 'narrow' }) %>
<% var displayMonth = itemDate.toLocaleString('en-US', { month: 'short' }) %>
<% var displayDay = itemDate.toLocaleString('en-US', { day: '2-digit' }) %>
<% if (weekday == "M") { %>
<% currentWeek = currentWeek + 1 %>
<% if (i > 0) { %>
</table>
<% } %>
<% if (currentItem.publish) { %>
<h2> Week <%= currentWeek %> </h2>
<table>
<% } %>
<% } %>
<% if (currentItem.publish) { %>
<tr>
<td rowspan="2" class="syllabus-date-pane">
<span class="syllabus-day-of-week"><%= weekday %></span>
<br>
<span class="syllabus-date"><%= displayMonth %>. <%= displayDay %></span></td>
<td colspan="2"> <%= currentItem.header %> </td>
</tr>
<tr>
<td colspan="4" class="smaller">
<%= currentItem.summary %>
</td>
</tr>
<tr>
<td></td>
<td class="smaller syllabus-item-objective">
<% if (currentItem.objectives) { %>
<b>Learning Objectives</b><br>
<% for (obj of currentItem.objectives) { %>
<%= obj %> <br>
<% } %>
<% } %>
</td>
<td class="smaller syllabus-item-readings">
<% if (currentItem.reading) { %>
<b>Reading</b><br>
<% for (read of currentItem.reading) { %>
<%= read %><br>
<% } %>
<% } %>
<% if (currentItem.optional) { %>
<% for (read of currentItem.optional) { %>
<i><%= read %></i><br>
<% } %>
<% } %>
</td>
<td class="smaller syllabus-item-readings">
<% if (currentItem.notes) { %>
<b>Notes</b><br>
<% for (read of currentItem.notes) { %>
<%= read %> <br>
<% } %>
<% } %>
</td>
<td class="smaller syllabus-item-assignment">
<% if (currentItem.warmup) { %>
<b>Warmup</b><br>
<%= currentItem.warmup %>
<% } %>
</td>
<td class="smaller syllabus-item-assignment">
<% if (currentItem.assignments) { %>
<b>Assignments</b><br>
<%= currentItem.assignments %>
<% } %>
</td>
</tr>
<% } %>
<% if (i == items.length-1) { %>
</table>
<% } %>
<% } %>
```