Feat: Decks page.

This commit is contained in:
2026-02-16 19:30:31 +00:00
parent 1cd9b7c976
commit 5661632540
75 changed files with 11850 additions and 536 deletions

View File

@@ -40,67 +40,65 @@
</form>
<!-- Games Table -->
<div class="games-table-container">
<table class="games-table" id="gamesTable">
<thead>
<tr>
<th>Game ID</th>
<th>Type</th>
<th>Location</th>
<th>Started</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% if model.games and model.games|length > 0 %}
{% for game in model.games %}
<tr class="game-row {% if not game.active %}inactive{% endif %}" data-game-id="{{ game.game_id }}">
<td class="game-id">#{{ game.game_id }}</td>
<td class="game-type">
{% if game.is_commander %}
<span class="badge badge-commander">Commander</span>
{% elif game.is_draft %}
<span class="badge badge-draft">Draft</span>
{% elif game.is_sealed %}
<span class="badge badge-sealed">Sealed</span>
{% else %}
<span class="badge badge-standard">Standard</span>
{% endif %}
</td>
<td class="game-location">{{ game.location_name or 'Unknown' }}</td>
<td class="game-date">{{ model.format_datetime_text(game.start_on) if game.start_on else 'Not started' }}</td>
<td class="game-status">
{% if game.end_on %}
<span class="status status-ended">Ended</span>
{% elif game.active %}
<span class="status status-active">Active</span>
{% else %}
<span class="status status-inactive">Inactive</span>
{% endif %}
</td>
<td class="game-actions">
<a href="{{ model.HASH_PAGE_MTG_GAME }}/{{ game.game_id }}" class="btn-tcg btn-join">Join Game</a>
</td>
</tr>
{% endfor %}
{% else %}
<tr class="no-games-row">
<td colspan="6" class="no-games">
<div class="no-games-message">
<span class="no-games-icon">&#x2694;</span>
<p>No games found. Start a new battle!</p>
</div>
<table class="games-table {{ model.FLAG_TABLE_MAIN }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }} {{ model.FLAG_DECK }}" id="{{ model.ID_TABLE_MAIN }}">
<thead>
<tr>
<th class="{{ model.ATTR_GAME_ID }}">Game ID</th>
<th class="{{ model.FLAG_IS_COMMANDER }}">Type</th>
<th class="{{ model.FLAG_LOCATION_NAME }}">Location</th>
<th class="{{ model.FLAG_START_ON }}">Started</th>
<th class="{{ model.FLAG_ACTIVE }}">Status</th>
<th class="{{ model.FLAG_NAV_MTG_GAME }}">Actions</th>
</tr>
</thead>
<tbody>
{% if model.games and model.games|length > 0 %}
{% for game in model.games %}
<tr class="game-row {% if not game.active %}inactive{% endif %}" data-game-id="{{ game.game_id }}">
<td class="{{ model.ATTR_GAME_ID }}">#{{ game.game_id }}</td>
<td class="{{ model.FLAG_IS_COMMANDER }}">
{% if game.is_commander %}
<span class="badge badge-commander">Commander</span>
{% elif game.is_draft %}
<span class="badge badge-draft">Draft</span>
{% elif game.is_sealed %}
<span class="badge badge-sealed">Sealed</span>
{% else %}
<span class="badge badge-standard">Standard</span>
{% endif %}
</td>
<td class="{{ model.FLAG_LOCATION_NAME }}">{{ game.location_name or 'Unknown' }}</td>
<td class="{{ model.FLAG_START_ON }}">{{ model.format_datetime_text(game.start_on) if game.start_on else 'Not started' }}</td>
<td class="{{ model.FLAG_ACTIVE }}">
{% if game.end_on %}
<span class="status status-ended">Ended</span>
{% elif game.active %}
<span class="status status-active">Active</span>
{% else %}
<span class="status status-inactive">Inactive</span>
{% endif %}
</td>
<td class="{{ model.FLAG_NAV_MTG_GAME }}">
<a href="{{ model.HASH_PAGE_MTG_GAME }}/{{ game.game_id }}" class="btn-tcg btn-join">Join Game</a>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
{% endfor %}
{% else %}
<tr class="no-games-row">
<td colspan="6" class="no-games">
<div class="no-games-message">
<span class="no-games-icon">&#x2694;</span>
<p>No games found. Start a new battle!</p>
</div>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
<!-- New Game Modal -->
<div id="newGameModal" class="modal-overlay hidden">
<div id="newGameModal" class="modal-overlay {{ model.FLAG_IS_COLLAPSED }}">
<div class="modal-content tcg-card">
<div class="modal-header">
<h2 class="tcg-section-title">Create New Game</h2>
@@ -158,5 +156,4 @@
var flagStartOn = "{{ model.FLAG_START_ON }}";
var flagStartingLife = "{{ model.FLAG_STARTING_LIFE }}";
</script>
{# <script src="{{ url_for('static', filename='js/pages/tcg/mtg_games.js') }}"></script> #}
{% endblock %}