This repository has been archived by the owner on Nov 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtemplate.html
201 lines (180 loc) · 6.45 KB
/
template.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html lang="en">
{% macro section(name) %}
<h1 id="{{name|urlencode}}">{{name}}</h1>
{% endmacro %}
{% macro generate_list(list, list_type="ul") %}
{% if list %}
<{{list_type}}>
{% for element in list %}
<li>
{{ caller(element) }}
</li>
{% endfor %}
</{{list_type}}>
{% endif %}
{% endmacro %}
{% macro generate_table(rows, headers) %}
<table class="table hover responsive">
<thead>
<tr>
{% for header in headers %}
<th>{{header}}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in rows %}
{{ caller(row) }}
{% endfor %}
</tbody>
</table>
{% endmacro %}
{% macro print_person(obj) %}
<a href="#{{obj.id}}">{{ obj.name }}</a>
{% endmacro %}
<head>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, follow">
<title>Serlo Team Overview</title>
<link href="./favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="./styles.css">
<style type="text/css">
@media (min-width: 768px) {
.sidebar {
position: sticky;
top: 0;
height: 100vh;
box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}
}
.sidebar .nav-link {
font-weight: 500;
}
.legend {
position: absolute;
bottom: 70px;
padding: 0 14px;
font-size: smaller;
}
.legend ul {
margin-top: 1em;
list-style-type: none;
padding-left: 0;
}
table td {
min-width: 25ex;
}
</style>
<script type="text/javascript" src="./script.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('table').DataTable({
"language": {
"info": "Showing _TOTAL_ entries",
},
"reponsive": true,
"paging": false,
});
});
</script>
</head>
<body>
<header class="navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand" href="#">Serlo Team Overview</a>
</header>
<div class="container-fluid">
<div class="row">
<nav class="col-12 col-md-2 bg-light sidebar">
<ul class="nav nav-pills flex-column">
{% macro toc_item(name) %}
<li class="nav-item"><a class="nav-link" href="#{{name|urlencode}}">{{name}}</a></li>
{% endmacro %}
{{ toc_item("Projects") }}
{{ toc_item("Support-Units") }}
{{ toc_item("Team members") }}
</ul>
<aside class="legend">
<small>Last update: {{ timestamp }}</small>
</aside>
</nav>
<main role="main" class="col-12 col-md-10">
{% macro render_units(units, name) %}
{{ section(name) }}
{% call(project) generate_table(units|sort(attribute="title"),
["Name", "Lama", "Members", "Description"]) %}
<tr id="unit{{ project.id }}">
<td id="unit{{ project.id }}"{% if project.status %} class="status-{{ project.status }}" {% endif %}>
<strong> {{ project.title }} </strong><br>
{% if project.overview_document %}
<small><a href="{{ project.overview_document }}" target="_blank">[Overview]</a></small>
{% endif %}
{% if project.storage_url %}
<small><a href="{{ project.storage_url }}" target="_blank">[G Drive Folder]</a></small>
{% endif %}
{% if project.slack_url %}
<small><a href="{{ project.slack_url }}" target="_blank">[Slack Channel]</a></small>
{% endif %}
</td>
<td>{{ print_person(project.person_responsible) }}</td>
<td>
{% call(person) generate_list(project.members|sort(attribute="name")) %}
{{ print_person(person) }}
{% endcall %}
</td>
<td>{{ project.description }}</td>
</tr>
{% endcall %}
{% endmacro %}
{{ render_units(serlo.projects, "Projects") }}
{{ render_units(serlo.support_units, "Support-Units") }}
{{ section("Team members") }}
{% call(member) generate_table(serlo.persons,
["Name", "Contact", "Projects / Units", "Sherpa support"]) %}
<tr id="{{ member.id }}">
<td id="{{member.id}}"><strong>{{ member.name }}</strong></td>
<td>
{% call(email) generate_list(member.work_emails) %}
<a href="mailto:{{email.address}}">{{email.address}}</a>
{% endcall %}
{% call(phone_number) generate_list(member.work_phone_numbers) %}
<a href="tel:{{phone_number.number}}">{{phone_number.number}}</a>
{% endcall %}
</td>
<td>
{% if member.managing_units %}
<strong>Lama</strong><br>
{% endif %}
{% call(unit) generate_list(member.managing_units|sort(attribute="title")) %}
<a href="#unit{{ unit.id }}" {% if unit.status %} class="status-{{ unit.status }}" {% endif %} >
{{ unit.title }}
</a>
{% endcall %}
{% if member.participating_units %}
<strong>Member</strong><br>
{% endif %}
{% call(unit) generate_list(member.participating_units|sort(attribute="title")) %}
<a href="#unit{{ unit.id }}" {% if unit.status %} class="status-{{ unit.status }}" {% endif %} >
{{ unit.title }}
</a>
{% endcall %}
</td>
<td>
{% if member.mentor %}
<strong>Sherpa:</strong> <br>
<a href="#{{ member.mentor.id }}"> {{ member.mentor.name }} </a>
{% endif %}
{% if member.mentor and member.mentees %} <br> <br> {% endif %}
{% if member.mentees %} <strong>Sherpee:</strong> <br> {% endif %}
{% call(mentee) generate_list(member.mentees|sort(attribute="name")) %}
<a href="#{{ mentee.id }}">{{ mentee.name }}</a>
{% endcall %}
</td>
</tr>
{% endcall %}
</main>
</div>
</div>
</body>
</html>