ddstats-server/views/pages/mapSingle.njk

105 lines
2.9 KiB
Plaintext
Raw Normal View History

2021-11-04 22:50:57 +01:00
{% extends "../templates/basic.njk" %}
{% import "../components/_map.njk" as mapComponent %}
2021-11-04 22:58:32 +01:00
{% set map = data.map %}
2021-11-04 23:20:41 +01:00
{% set raceLeaderboard = data.raceLeaderboard %}
{% set teamLeaderboard = data.teamLeaderboard %}
2021-11-04 22:50:57 +01:00
{% block head %}
<title>DDStats - Maps!</title>
<link rel="stylesheet" type="text/css" href="/assets/css/maps.css">
<script src="/assets/scripts/lazyLoadImages.js" defer></script>
{% endblock %}
{% block body %}
<main>
2021-11-04 22:58:32 +01:00
<img class="map-image" src="https://ddnet.tw/ranks/maps/{{ map.map | replace(r/[À-ž]/g, "__") | replace(r/[^a-zA-Z0-9]/g, "_") }}.png">
<h1 class="map-name">{{ map.map }}</h1>
<table class="map-info">
<tr>
<td>
{% if map.mappers[1] %}
Mappers:
{% else %}
Mapper:
{% endif %}
</td>
<td>
{{ map.mappers.join(", ") }}
</td>
</tr>
<tr>
<td>
Category:
</td>
<td>
{{ map.category }}
</td>
</tr>
<tr>
<td>
Rating:
</td>
<td>
{% for i in range(0, map.stars) %}★{% endfor %}
{% for i in range(0, 5 - map.stars) %}☆{% endfor %}
</td>
</tr>
2021-11-04 23:17:41 +01:00
<tr>
<td>
Points:
</td>
<td>
{{ map.points }}
</td>
</tr>
<tr>
<td>
Released:
</td>
<td>
{{ map.release }}
</td>
</tr>
<tr>
<td>
Total finishes:
</td>
<td>
{{ map.finishes.total }}
</td>
</tr>
<tr>
<td>
Team finishes:
</td>
<td>
{{ map.finishes.team }}
</td>
</tr>
<tr>
<td>
Unique finishes
</td>
<td>
{{ map.finishes.unique }}
</td>
</tr>
<tr>
<td>
Median time:
</td>
<td>
{{ map.times.median | round(2)}}
</td>
</tr>
<tr>
<td>
Average time:
</td>
<td>
{{ map.times.average | round(2)}}
</td>
</tr>
2021-11-04 22:58:32 +01:00
</table>
2021-11-04 22:50:57 +01:00
</main>
{% endblock %}