2021-11-04 22:50:57 +01:00
|
|
|
{% extends "../templates/basic.njk" %}
|
|
|
|
{% import "../components/_map.njk" as mapComponent %}
|
2021-11-13 20:12:01 +01:00
|
|
|
{% import "../components/_utils.njk" as utils %}
|
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">
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block body %}
|
2021-11-05 10:32:06 +01:00
|
|
|
<main class="flex-container">
|
2021-11-13 20:12:01 +01:00
|
|
|
<form action="/maps" method="get" id="search">
|
2021-11-06 16:55:37 +01:00
|
|
|
<h1>Search</h1>
|
2021-11-13 21:28:28 +01:00
|
|
|
<input type="text" name="map" id="map" placeholder="Map name" value="{{ options.query.map }}">
|
|
|
|
<input type="text" name="categories" id="categories" placeholder="Category" value="{{ options.query.categories }}">
|
|
|
|
<input type="text" name="stars" id="stars" placeholder="Star amount" value="{{ options.query.stars }}">
|
2021-11-06 16:55:37 +01:00
|
|
|
|
|
|
|
<div class="sorting">
|
|
|
|
<label for="asc">
|
2021-11-13 21:28:28 +01:00
|
|
|
<input type="radio" name="order" id="asc" value="asc" {{ "checked" if options.query.sortyBy == "asc" }}>
|
2021-11-06 16:55:37 +01:00
|
|
|
Sort Ascending
|
|
|
|
</label>
|
|
|
|
<label for="desc">
|
2021-11-13 21:28:28 +01:00
|
|
|
<input type="radio" name="order" id="desc" value="desc" {{ "checked" if options.query.sortyBy == "desc" }}>
|
2021-11-06 16:55:37 +01:00
|
|
|
Sort Descending
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button type="submit">Search!</button>
|
2021-11-13 02:34:52 +01:00
|
|
|
</form>
|
2021-11-06 16:55:37 +01:00
|
|
|
|
2021-11-13 20:12:01 +01:00
|
|
|
<div class="flex-container pages">
|
2021-11-13 21:28:28 +01:00
|
|
|
{{ utils.pager(data.maps.pageInfo.page, data.maps.pageInfo.totalPages, options.query) }}
|
2021-11-13 20:12:01 +01:00
|
|
|
</div>
|
|
|
|
|
2021-11-13 02:28:43 +01:00
|
|
|
{% for map in data.maps.maps %}
|
2021-11-04 22:50:57 +01:00
|
|
|
{{ mapComponent.card(map) }}
|
|
|
|
{% endfor %}
|
2021-11-13 20:12:01 +01:00
|
|
|
|
|
|
|
<div class="flex-container pages">
|
|
|
|
{{ utils.pager(data.maps.pageInfo.page, data.maps.pageInfo.totalPages) }}
|
|
|
|
</div>
|
2021-11-04 22:50:57 +01:00
|
|
|
</main>
|
|
|
|
{% endblock %}
|