edh-elo/app/templates/decks/detail.html
2024-06-26 19:23:04 -07:00

44 lines
1.2 KiB
HTML

{% extends "base.html" %}
{% block title %}Deck - {{ deck.name }}{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
<h2>This is the page for deck {{ deck.name }} with id {{ deck.id }}, owned by <a href="/player/{{ owner.id }}">{{ owner.name }}</a></h2>
{% if deck.description %}
<p>The description of the deck is: {{ deck.description }}</p>
{% endif %}
<h2>Game history</h2>
{% if game_history %}
<table>
<tr>
<th>Date</th>
<th>Participants</th>
<th>Result</th>
<th>ELO Score</th>
</tr>
{% for entry in game_history %}
<tr>
<td><a href="/game/{{ entry.game.id }}">{{ entry.game.date.strftime('%Y-%m-%d') }}</a></td>
<td>
<ul>
{% for participant in entry.game_participants %}
<li><a href="/deck/{{ participant.id }}">{{ participant.owner }} ({{ participant.name }})</a></li>
{% endfor %}
</ul>
</td>
<td>{{ "Win" if entry.game.winning_deck_id == deck.id else "Loss" }}</td>
<td>{{ entry.score|int }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>This Deck has not played any games</p>
{% endif %}
{% endblock %}