Fix: eagerload series.sets i admin og API (MissingGreenlet i async mode)
This commit is contained in:
@@ -1,27 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Forside{% endblock %}
|
||||
{% block content %}
|
||||
<h1>📦 Alle serier</h1>
|
||||
<p style="color:var(--text-muted);margin-bottom:24px;">{{ sets|length }} serie(r) i databasen</p>
|
||||
<h1>⚡ Pokémon TCG serier</h1>
|
||||
<p style="color:var(--text-muted);margin-bottom:24px;">{{ series|length }} serie(r) i databasen</p>
|
||||
|
||||
<div class="card-grid">
|
||||
{% for s in sets %}
|
||||
<a href="/sets/{{ s.code }}" class="card-set">
|
||||
{% for serie in series %}
|
||||
<a href="/series/{{ serie.name|urlencode }}" class="card-set">
|
||||
<div class="card">
|
||||
<span class="tag">{{ s.code }}</span>
|
||||
<h3 style="margin-top:10px;">{{ s.name }}</h3>
|
||||
{% if s.release_date %}
|
||||
<p style="font-size:0.85rem;color:var(--text-muted);margin-top:4px;">📅 {{ s.release_date }}</p>
|
||||
<h3 style="margin-bottom:6px;">📦 {{ serie.name }}</h3>
|
||||
<p style="font-size:0.85rem;color:var(--text-muted);">
|
||||
{{ serie.sets|length }} sæt
|
||||
</p>
|
||||
{% if serie.description %}
|
||||
<p style="font-size:0.85rem;color:var(--text-muted);margin-top:6px;">{{ serie.description }}</p>
|
||||
{% endif %}
|
||||
<p style="font-size:0.85rem;color:var(--text-muted);margin-top:4px;">{{ s.cards|length }} kort</p>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if sets|length == 0 %}
|
||||
{% if series|length == 0 %}
|
||||
<div class="card" style="text-align:center;color:var(--text-muted);">
|
||||
<p>Ingen serier endnu. Log ind som admin for at tilføje.</p>
|
||||
<p>Ingen serier i databasen endnu.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user