Commit 5c3ed4ad authored by Lysander Trischler's avatar Lysander Trischler

Make awesome progress bars in hourly stats

parent b01e4df4
......@@ -74,7 +74,7 @@ body {
}
> a {
margin-left: 1.5em;
margin-left: 1.5em;
}
}
}
......@@ -129,6 +129,12 @@ body {
> tr.now {
font-weight: bold;
}
td.progress {
background-image: -moz-linear-gradient(to bottom, teal, aqua);
background-image: linear-gradient(to bottom, teal, aqua);
background-repeat: no-repeat;
}
}
}
......
......@@ -100,6 +100,10 @@
</tr>
</thead>
<tbody>
{% set maximum = {} %}
{% for discipline in disciplines %}
{% set maximum[discipline] = max(i[discipline] for hour, i in hourly.items() if discipline in i) %}
{% end %}
{% for hour in range(3, 24) + range(0, 3) %}
<tr{% if hour == handler.now.hour %} class=now{% end %}>
<td style="text-align:right">{{ "%02d" % hour }}</td>
......@@ -107,7 +111,7 @@
<td colspan={{ len(disciplines) }} style="text-align:center"><i>keine Übungen</i></td>
{% else %}
{% for discipline in disciplines %}
<td>
<td class=progress style="background-size:{{ (hourly[hour][discipline] / maximum[discipline] if discipline in hourly[hour] else 0) * 100 }}% 100%">
{% if discipline in hourly[hour] %}
{{ hourly[hour][discipline] }}
{% else %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment