this repo has no description
1<style>
2 td.athlete-name {
3 max-width: 200px;
4 white-space: nowrap;
5 text-overflow:ellipsis;
6 overflow: hidden;
7 }
8
9 td.last-activity-date>time {
10 text-wrap: nowrap;
11 }
12
13 td.last-activity-date.old {
14 color: var(--faded-fg);
15 }
16
17 td.rank {
18 text-align: center;
19 font-weight: bold;
20 white-space: nowrap;
21 }
22
23 tr.rank-gold td.rank { color: #b8860b; }
24 tr.rank-silver td.rank { color: #808080; }
25 tr.rank-bronze td.rank { color: #cd7f32; }
26
27 tr.rank-gold td.rank::after { content: '🏆'; filter: grayscale(1) brightness(1.1) sepia(1) hue-rotate(10deg) saturate(3); }
28 tr.rank-silver td.rank::after { content: '🏆'; filter: grayscale(1) brightness(1.2); }
29 tr.rank-bronze td.rank::after { content: '🏆'; filter: grayscale(1) brightness(0.9) sepia(1) hue-rotate(-15deg) saturate(2); }
30</style>
31<table class="list-of-links">
32 <thead>
33 <tr>
34 <th>#</th>
35 <th>Athlete</th>
36 <th>Points</th>
37 <th>Last Activity</th>
38 </tr>
39 </thead>
40 <tbody>
41 {% set ns = namespace(rank=0, prev_total=-1) %}
42 {% for athlete in athletes|selectattr("points." ~ surface)|sort(attribute="points." ~ surface ~ ".total", reverse=true) %}
43 {% set sp = athlete.points[surface] %}
44 {% if sp.total != ns.prev_total %}
45 {% set ns.rank = ns.rank + 1 %}
46 {% endif %}
47 {% set ns.prev_total = sp.total %}
48 {% set rank_class = "" %}
49 {% if ns.rank == 1 %}
50 {% set rank_class = "rank-gold" %}
51 {% elif ns.rank == 2 %}
52 {% set rank_class = "rank-silver" %}
53 {% elif ns.rank == 3 %}
54 {% set rank_class = "rank-bronze" %}
55 {% endif %}
56 <tr id="eid:{{athlete.eid}}" class="{{rank_class}}">
57 <td class="rank">{{ns.rank if ns.rank > 3}}</td>
58 <td class="athlete-name">
59 <a href="{{athlete.url}}">
60 {{avatar_svg(athlete.eid)}}
61 {{athlete.name}}
62 </a>
63 </td>
64 <td>{{sp.total}}</td>
65 {% with is_old = athlete.latest_activity|age_hours >= 24 %}
66 <td class="last-activity-date {{'old' if is_old }}">
67 <time datetime="{{athlete.latest_activity}}">
68 {{athlete.latest_activity|format_iso3339}}
69 </time>
70 </td>
71 {% endwith %}
72 </tr>
73 {% endfor %}
74 </tbody>
75</table>