-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprogram.html
90 lines (84 loc) · 2.77 KB
/
program.html
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
---
layout: basic
---
{% assign rootResource = site.rootResource | rdf_get %}
{% include sections/header_program.html %}
{% capture dayQuery %}
SELECT DISTINCT ?day
WHERE {
?resourceUri ?cmprop ?day .
?day dct:date ?date .
?cmprop a rdfs:ContainerMembershipProperty .
}
GROUP BY ?day
{% endcapture %}
{% capture subEventQuery %}
SELECT DISTINCT ?subEvent (MIN(?sortDates) as ?sortDate)
WHERE {
?resourceUri dct:date ?date .
<{{rootResource}}> schema:subEvent ?subEvent .
?subEvent dct:date ?date , ?sortDates .
}
GROUP BY ?subEvent
ORDER BY ?sortDate
{% endcapture %}
{% assign days = page.rdf | sparql_query: dayQuery %}
<section class="timetable">
<header>
<p class="calendar">
<a href="index.ics">{{str_subscribe_ical_program}} <svg role="img" focusable="false" aria-hidden="true" height="28" width="28">
<use xlink:href="{% relative_link /resources/images/icons.svg %}#calendar-add"></use></svg></a>
</p>
</header>
<div class="card-list">
<ul>
{% for row in days %}
{% assign description = row.day | rdf_property: "dct:description", site.language %}
{% assign abstract = row.day | rdf_property: "schema:abstract", site.language %}
<li>
<div class="card">
<h2>
<a href="{{ row.day.render_path | relativize_url }}">
<span class="xl hideunderline">{{ row.day | rdf_property: "rdfs:label", site.language }}</span>
</a>
</h2>
{%- assign title =row.day | rdf_property: "dct:title", site.language -%}
{%- if title -%}
<p>{{ row.day | rdf_property: "dct:title", site.language }}</p>
{%- endif -%}
{% assign subject = row.day | rdf_property: "dct:subject" %}
{%- if subject -%}
<p class="dates">
<time ev="">
<strong class="highlighted x1">{{ row.day | rdf_property: "dct:subject" }}</strong><br/>
</time>
</p>
{%- endif -%}
{% if abstract %}
<p class="justify"><small>{{ abstract }}</small></p>
{% else %}
{% if description %}
{% assign sentences = description | split: ". " %}
{% if sentences.size > 2 %}
<p class="justify">
<small>{{ sentences | slice: 0, 1 | join: ". " }}. </small>
</p>
<details>
<summary>
<small>Show more</small>
</summary>
<p class="justify">
<small>{{ sentences | slice: 1, sentences.size | join: ". " }}</small>
</p>
</details>
{% else %}
<p class="justify"><small>{{ description }}</small></p>
{% endif %}
{% endif %}
{% endif %}
</div>
</li>
{% endfor %}
</ul>
</div>
</section>