forked from serlo/overview.serlo.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.html
161 lines (150 loc) · 4.51 KB
/
report.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
<!DOCTYPE html>
<html lang="de">
{% 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">
<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 Portal</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;
color: #333;
}
.sidebar .nav-link.active {
color: #007bff;
}
table td {
min-width: 25ex;
}
table.dataTable tr.status-perfect { background-color: #d9ffb3; }
table.dataTable tr.status-ok { background-color: #ffffb3; }
table.dataTable tr.status-problems { background-color: #ffb3b3; }
table.dataTable.hover tr.status-perfect:hover { background-color: #b3ff66; }
table.dataTable.hover tr.status-ok:hover { background-color: #ffff66; }
table.dataTable.hover tr.status-problems:hover { background-color: #ff6666; }
</style>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript">
$(document).ready( function () {
$('table').DataTable({
"paging": false,
"language": {
"info": "Showing _TOTAL_ entries",
},
});
} );
</script>
</head>
<body>
<header class="navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand" href="#">Serlo-Team Portal</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("Projekte") }}
{{ toc_item("Support-Units") }}
{{ toc_item("Teammitglieder") }}
</ul>
</nav>
<main role="main" class="col-12 col-md-10">
{% macro render_units(units, name) %}
{{ section(name) }}
{% call(project) generate_table(units,
["Name", "Lama", "Mitglieder", "Beschreibung"]) %}
<tr id="unit{{ project.id }}" {% if project.status %} class="status-{{ project.status }}" {% endif %}>
<td id="unit{{ project.id }}">
{{ project.name }}
{% if project.overview_document %}
<small><a href="{{ project.overview_document }}">(Overview)</a></small>
{% endif %}
</td>
<td>{{ print_person(project.person_responsible) }}</td>
<td>
{% call(person) generate_list(project.members) %}
{{ print_person(person) }}
{% endcall %}
</td>
<td>{{ project.description }}</td>
</tr>
{% endcall %}
{% endmacro %}
{{ render_units(serlo.projects, "Projekte") }}
{{ render_units(serlo.support_units, "Support-Units") }}
{{ section("Teammitglieder") }}
{% call(member) generate_table(serlo.persons,
["Name", "E-Mail", "Nummer", "Projekte / Units"]) %}
<tr id="{{ member.id }}">
<td id="{{member.id}}">{{ member.name }}</td>
<td>
{% call(email) generate_list(member.emails) %}
<a href="mailto:{{email.address}}">{{email.address}}</a>
{% endcall %}
</td>
<td>
{% call(phone_number) generate_list(member.phone_numbers) %}
<a href="tel:{{phone_number.number}}">{{phone_number.number}}</a>
{% endcall %}
</td>
<td>
{% call(unit) generate_list(member.managing_units) %}
<a href="#unit{{ unit.id }}"><i>{{ unit.name }} (Lama)</i></a>
{% endcall %}
{% call(unit) generate_list(member.participating_units) %}
<a href="#unit{{ unit.id }}">{{ unit.name }}</a>
{% endcall %}
</td>
</tr>
{% endcall %}
</main>
</div>
</div>
</body>
</html>