Added (un)finished maps to player profiles.

This commit is contained in:
BurnyLlama 2021-11-22 19:35:47 +01:00
parent 24d30240a7
commit 9b5193a64e

View File

@ -19,6 +19,7 @@
with a time of {{ utils.fancyTime(player.firstFinish.time) }}. with a time of {{ utils.fancyTime(player.firstFinish.time) }}.
</p> </p>
</div> </div>
<div> <div>
<h2>Points</h2> <h2>Points</h2>
<table> <table>
@ -44,21 +45,57 @@
</tr> </tr>
</table> </table>
</div> </div>
{% macro insertMap(mapData) %}
<div class="map">
<a href="/maps/{{ mapData.map | urlencode }}">
<img class="map-image" data-src="https://ddnet.tw/ranks/maps/{{ mapData.map | replace(r/[À-ž]/g, "__") | replace(r/[^a-zA-Z0-9]/g, "_") }}.png">
</a>
<h1 class="map-name">{{ mapData.map }}</h1>
<table class="map-info">
<tr>
<td>Finishes</td>
<td>{{ mapData.finishes }}</td>
</tr>
<tr>
<td>Points</td>
<td>{{ mapData.points }}</td>
</tr>
<tr>
<td>Rank</td>
<td>{{ mapData.rank }}</td>
</tr>
{% if mapData.teamrank %}
<tr>
<td>Teamrank</td>
<td>{{ mapData.teamrank }}</td>
</tr>
{% endif %}
</table>
<a class="map-more-info" href="/maps/{{ mapData.map | urlencode }}">More Info</a>
</div>
{% endmacro %}
<div> <div>
<h2>Finished maps</h2> <h2>Finished maps</h2>
{% for category, finishedMaps in data.finishedMaps %}
<h3>{{ category }}</h3>
<div class="flex-container"> <div class="flex-container">
{% for finishedMap in data.finishedMaps %} {% for finishedMap in finishedMaps %}
{{ map.card(finishedMap) }} {{ insertMap(finishedMap) }}
{% endfor %} {% endfor %}
</div> </div>
{% endfor %}
</div> </div>
<div> <div>
<h2>Unfinished maps</h2> <h2>Unfinished maps</h2>
{% for category, unfinishedMaps in data.unfinishedMaps %}
<h3>{{ category }}</h3>
<div class="flex-container"> <div class="flex-container">
{% for unfinishedMap in data.unfinishedMaps %} {% for unfinishedMap in unfinishedMaps %}
{{ map.card(unfinishedMap) }} {{ insertMap(unfinishedMap) }}
{% endfor %} {% endfor %}
</div> </div>
{% endfor %}
</div> </div>
</div> </div>
</main> </main>