Started work on map detailed view.

This commit is contained in:
BurnyLlama 2021-11-04 22:58:32 +01:00
parent 7a9b2d5218
commit f978f01a6e

View File

@ -1,5 +1,6 @@
{% extends "../templates/basic.njk" %} {% extends "../templates/basic.njk" %}
{% import "../components/_map.njk" as mapComponent %} {% import "../components/_map.njk" as mapComponent %}
{% set map = data.map %}
{% block head %} {% block head %}
<title>DDStats - Maps!</title> <title>DDStats - Maps!</title>
@ -9,6 +10,38 @@
{% block body %} {% block body %}
<main> <main>
{{ mapComponent.card(data.map) }} <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> </main>
{% endblock %} {% endblock %}