-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from AsteriosP/timetables
Προσθήκη του ωρολογίου προγράμματος
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
layout: single | ||
days: | ||
- "Δευτέρα" | ||
- "Τρίτη" | ||
- "Τετάρτη" | ||
- "Πέμπτη" | ||
- "Παρασκευή" | ||
--- | ||
|
||
{% capture days %}Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή{% endcapture %} | ||
{% assign days = days | split: ';'%} | ||
|
||
<div class="" style="margin-top: 2em;"> | ||
<table style="width:100%; text-align: center;"> | ||
<tr> | ||
<th></th> | ||
{% for day in days %} | ||
{% if day %} | ||
<th> {{ day }} </th> | ||
{% endif %} | ||
{% endfor %} | ||
</tr> | ||
{% for time in (9..20) %} | ||
<tr> | ||
<td> {{time}}:00-{{ time | plus: 1 }}:00</td> | ||
{% for day in days %} | ||
{% if day %} | ||
{% assign s = time | downcase %} | ||
{% assign lectures = page.timetable | where: "day", day%} | ||
{% assign has_lecture = false %} | ||
{% for lect in lectures%} | ||
{% if lect.time == time %} | ||
{% assign course = site.courses | where: "ref", lect.course | first %} | ||
<td rowspan="2"> <b> | ||
{% if course %} | ||
<a href="{{ course.url | absolute_url }}">{{ course.title }}</a> | ||
{% else %} | ||
{{lect.course}} | ||
{% endif %} | ||
</b> <br> <i> | ||
{% assign author = site.people | where: "ref", lect.author | first %} | ||
{% if author %} | ||
<a href="{{ author.url | absolute_url }}">{{ author.title }}</a> | ||
{% else %} | ||
{{lect.author}} | ||
{% endif %} | ||
</i> <br> {{lect.location}} </td> | ||
{% assign has_lecture = true %} | ||
{% endif %} | ||
{% endfor %} | ||
{% assign ptime = time | plus: -1 %} | ||
{% assign previous_lect = false %} | ||
{% for lecture in lectures %} | ||
{% if lecture.time == ptime %} | ||
{% assign previous_lect = true %} | ||
{% endif %} | ||
{% endfor %} | ||
{% if previous_lect == true %} | ||
{% else %} | ||
{% if has_lecture == false %} | ||
<td></td> | ||
{% else %} | ||
<!-- <td></td> --> | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> |