Added beginning support for (un)finished maps on player profiles...
This commit is contained in:
parent
98ad48e35b
commit
24d30240a7
|
@ -78,9 +78,11 @@ routes.get(
|
||||||
'/players/:player',
|
'/players/:player',
|
||||||
(req, res) => {
|
(req, res) => {
|
||||||
const player = wrapper.player(req.params.player)
|
const player = wrapper.player(req.params.player)
|
||||||
|
const finishedMaps = wrapper.finishedMaps(req.params.player)
|
||||||
|
const unfinishedMaps = wrapper.unfinishedMaps(req.params.player)
|
||||||
const [success, error] = player ? [true, null] : [false, `Player ${req.params.player} does not exist!`]
|
const [success, error] = player ? [true, null] : [false, `Player ${req.params.player} does not exist!`]
|
||||||
|
|
||||||
tx(req, res)('pages/playerProfile.njk', { player, error }, success, { currentSection: "players" })
|
tx(req, res)('pages/playerProfile.njk', { player, finishedMaps, unfinishedMaps, error }, success, { currentSection: "players" })
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{% extends "../templates/basic.njk" %}
|
{% extends "../templates/basic.njk" %}
|
||||||
{% import "../components/_utils.njk" as utils %}
|
{% import "../components/_utils.njk" as utils %}
|
||||||
|
{% import "../components/_map.njk" as map %}
|
||||||
{% set player = data.player %}
|
{% set player = data.player %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
|
@ -43,6 +44,22 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<h2>Finished maps</h2>
|
||||||
|
<div class="flex-container">
|
||||||
|
{% for finishedMap in data.finishedMaps %}
|
||||||
|
{{ map.card(finishedMap) }}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h2>Unfinished maps</h2>
|
||||||
|
<div class="flex-container">
|
||||||
|
{% for unfinishedMap in data.unfinishedMaps %}
|
||||||
|
{{ map.card(unfinishedMap) }}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user