badge kategorii

This commit is contained in:
Mateusz Gruszczyński
2025-08-01 14:24:25 +02:00
parent beed40868d
commit 3f67007f2f
4 changed files with 50 additions and 11 deletions

View File

@@ -9,10 +9,11 @@
<span class="badge bg-secondary ms-2">(Archiwalna)</span>
{% endif %}
{# Kategorie #}
{% if list.categories %}
{% for cat in list.categories %}
<span class="badge rounded-pill bg-light text-dark border ms-1" style="font-size: 0.75rem; opacity: 0.85;">
{% if list.category_badges %}
{% for cat in list.category_badges %}
<span class="badge rounded-pill text-dark ms-1" style="background-color: {{ cat.color }};
font-size: 0.75rem;
opacity: 0.85;">
{{ cat.name }}
</span>
{% endfor %}
@@ -23,6 +24,7 @@
</a>
{% endif %}
</h2>
</div>
<a href="{{ request.url_root }}share/{{ list.share_token }}" class="btn btn-primary btn-sm w-100 mb-3" {% if not

View File

@@ -20,13 +20,16 @@
{% endif %}
{# Kategorie - tylko wyświetlenie, bez linków #}
{% if list.categories %}
{% for cat in list.categories %}
<span class="badge rounded-pill bg-light text-dark border ms-1" style="font-size: 0.7rem; opacity: 0.85;">
{% if list.category_badges %}
{% for cat in list.category_badges %}
<span class="badge rounded-pill text-dark ms-1" style="background-color: {{ cat.color }};
font-size: 0.75rem;
opacity: 0.85;">
{{ cat.name }}
</span>
{% endfor %}
{% endif %}
</h2>

View File

@@ -74,7 +74,16 @@
{% set percent = (purchased_count / total_count * 100) if total_count > 0 else 0 %}
<li class="list-group-item bg-dark text-white">
<div class="d-flex justify-content-between align-items-center flex-wrap w-100">
<span class="fw-bold">{{ l.title }} (Autor: Ty)</span>
<span class="fw-bold">
{{ l.title }} (Autor: Ty)
{% for cat in l.category_badges %}
<span class="badge rounded-pill text-dark ms-1" style="background-color: {{ cat.color }};
font-size: 0.5rem;
opacity: 0.85;">
{{ cat.name }}
</span>
{% endfor %}
</span>
<div class="btn-group mt-2 mt-md-0" role="group">
<a href="/list/{{ l.id }}" class="btn btn-sm btn-outline-light">📄 Otwórz</a>
@@ -118,7 +127,17 @@
{% set percent = (purchased_count / total_count * 100) if total_count > 0 else 0 %}
<li class="list-group-item bg-dark text-white">
<div class="d-flex justify-content-between align-items-center flex-wrap w-100">
<span class="fw-bold">{{ l.title }} (Autor: {{ l.owner.username }})</span>
<span class="fw-bold">
{{ l.title }} (Autor: {{ l.owner.username }})
{% for cat in l.category_badges %}
<span class="badge rounded-pill text-dark ms-1" style="background-color: {{ cat.color }};
font-size: 0.75rem;
opacity: 0.85;">
{{ cat.name }}
</span>
{% endfor %}
</span>
<a href="/guest-list/{{ l.id }}" class="btn btn-sm btn-outline-light">📄 Otwórz</a>
</div>
<div class="progress progress-dark progress-thin mt-2 position-relative">