ddstats-server/views/pages/mapSingle.njk

47 lines
1.4 KiB
Plaintext

{% extends "../templates/basic.njk" %}
{% import "../components/_map.njk" as mapComponent %}
{% set map = data.map %}
{% 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>
<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>
</table>
</main>
{% endblock %}