-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathminutes.html.jinja2
executable file
·77 lines (64 loc) · 2.48 KB
/
minutes.html.jinja2
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
{% extends "base.html.jinja2" %}
{% block title %}Minutes{% endblock title %}
{% block scripts %}
<script>
function minutes_lazy_load(ele) {
// <iframe loading="lazy"> not supported in enough browsers yet, especially mobile.
// https://caniuse.com/loading-lazy-attr
let iframe = ele.parentElement.querySelector("iframe[data-src]");
if (iframe !== null) {
iframe.src = iframe.getAttribute("data-src");
iframe.removeAttribute("data-src");
console.log("Loaded!");
}
}
</script>
{% endblock scripts %}
{% block body %}
<h2>Constitution</h2>
<p>
The society Constitution can be found <strong><a href="https://github.com/HackSoc/constitution/blob/main/Constitution.md">here</a></strong>, and appendices can be found <strong><a href="https://github.com/HackSoc/constitution/tree/main/appendices">here</a></strong>
</p>
<h2>Minutes</h2>
{% if listing %}
<p>
Click on the titles to expand a preview of minutes. Click [pdf] to download or open the full minutes in a new tab.
</p>
{% for committee, minutes in listing.items() %}
{% if loop.first %}
<details class="minutes" open>
{% else %}
<details class="minutes">
{% endif %}
<summary><h3>
{{committee}}
{% if loop.first %}(current){% endif %}
</h3></summary>
<ul>
{% for item in minutes %}
<li>
<details>
<summary onclick="minutes_lazy_load(this)">
<span>
<span class="minutes-name">{{item.meeting}}</span>
<span class="minutes-date">{{item.date|format_date}}</span>
</span>
[<a href="{{item.url}}" target="#">pdf</a>]
</summary>
<iframe src="" data-src="{{item.url}}"></iframe>
{#-
There's a Chrome bug (Linux v92) that affects iframes
that get hidden and shown (like <details> but not limited to)
with src loaded from localhost;
it doesn't seem to affect src from non-localhost domains
-#}
</details>
</li>
{% endfor %}
</ul>
</details>
{% endfor %}
{% else %}
<p class="minutes-help">No minutes to display</p>
{% endif %}
{% endblock body %}