P0: Status-Badge-Farben semantisch vereinheitlicht
Zentrales status_badge-Makro (status.html): neuheit/neu+abgeschlossen = emerald, offen = slate, in_bearbeitung/planung = sky, warnung/konflikt/ pruefung = amber mit Warn-Icon, fehler = red, deaktiviert/archiviert = slate. Angewendet in neuheiten, planung, archiv, dedup, Benutzerliste.
This commit is contained in:
@@ -81,7 +81,7 @@
|
|||||||
<dl class="mt-1.5 space-y-0.5 text-xs text-slate-500">
|
<dl class="mt-1.5 space-y-0.5 text-xs text-slate-500">
|
||||||
{% if eintrag.verlag %}<div><dt class="inline font-medium text-slate-400">Verlag: </dt><dd class="inline">{{ eintrag.verlag }}</dd></div>{% endif %}
|
{% if eintrag.verlag %}<div><dt class="inline font-medium text-slate-400">Verlag: </dt><dd class="inline">{{ eintrag.verlag }}</dd></div>{% endif %}
|
||||||
{% if eintrag.jahr or eintrag.ausgabe %}<div><dt class="inline font-medium text-slate-400">Jahr/Ausgabe: </dt><dd class="inline">{{ eintrag.jahr if eintrag.jahr else eintrag.ausgabe }}</dd></div>{% endif %}
|
{% if eintrag.jahr or eintrag.ausgabe %}<div><dt class="inline font-medium text-slate-400">Jahr/Ausgabe: </dt><dd class="inline">{{ eintrag.jahr if eintrag.jahr else eintrag.ausgabe }}</dd></div>{% endif %}
|
||||||
<div><dt class="inline font-medium text-slate-400">Status: </dt><dd class="inline">{{ status_anzeige.get(eintrag.status, eintrag.status) }}</dd></div>
|
<div><dt class="inline font-medium text-slate-400">Status: </dt><dd class="inline">{% from "status.html" import status_badge %}{{ status_badge(eintrag.status, status_anzeige.get(eintrag.status, eintrag.status)) }}</dd></div>
|
||||||
<div>
|
<div>
|
||||||
<dt class="inline font-medium text-slate-400">Archiviert am: </dt>
|
<dt class="inline font-medium text-slate-400">Archiviert am: </dt>
|
||||||
<dd class="inline">{{ eintrag.archiviert_am.strftime('%d.%m.%Y %H:%M') if eintrag.archiviert_am else '—' }}</dd>
|
<dd class="inline">{{ eintrag.archiviert_am.strftime('%d.%m.%Y %H:%M') if eintrag.archiviert_am else '—' }}</dd>
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3">{{ eintrag.verlag or '—' }}</td>
|
<td class="px-4 py-3">{{ eintrag.verlag or '—' }}</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap">{{ eintrag.jahr if eintrag.jahr else (eintrag.ausgabe or '—') }}</td>
|
<td class="px-4 py-3 whitespace-nowrap">{{ eintrag.jahr if eintrag.jahr else (eintrag.ausgabe or '—') }}</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap">{{ status_anzeige.get(eintrag.status, eintrag.status) }}</td>
|
<td class="px-4 py-3 whitespace-nowrap">{% from "status.html" import status_badge %}{{ status_badge(eintrag.status, status_anzeige.get(eintrag.status, eintrag.status)) }}</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap">{{ namen.get(eintrag.rezensent_id, '—') if eintrag.rezensent_id else '—' }}</td>
|
<td class="px-4 py-3 whitespace-nowrap">{{ namen.get(eintrag.rezensent_id, '—') if eintrag.rezensent_id else '—' }}</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap text-slate-500">
|
<td class="px-4 py-3 whitespace-nowrap text-slate-500">
|
||||||
{{ eintrag.archiviert_am.strftime('%d.%m.%Y %H:%M') if eintrag.archiviert_am else '—' }}
|
{{ eintrag.archiviert_am.strftime('%d.%m.%Y %H:%M') if eintrag.archiviert_am else '—' }}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
<span class="inline-block px-2 py-0.5 rounded-full bg-amber-100 text-amber-800 text-xs mr-1">{{ konflikt_anzeige.get(konflikt.art, konflikt.art) }}</span>
|
<span class="inline-block px-2 py-0.5 rounded-full bg-amber-100 text-amber-800 text-xs mr-1">{{ konflikt_anzeige.get(konflikt.art, konflikt.art) }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="text-emerald-700">Keine Treffer</span>
|
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-800 text-xs">{% from "icons.html" import icon_check %}{{ icon_check("h-3.5 w-3.5") }} Keine Treffer</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
class="ml-0.5 text-[10px] uppercase tracking-wide text-sky-600/70 hover:text-sky-800 align-super">{{ eintrag.quelle }} ↗</a>
|
class="ml-0.5 text-[10px] uppercase tracking-wide text-sky-600/70 hover:text-sky-800 align-super">{{ eintrag.quelle }} ↗</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
<span class="ml-auto shrink-0 inline-block px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-800 text-xs">{{ eintrag.status }}</span>
|
{% from "status.html" import status_badge %}{{ status_badge(eintrag.status, none, "ml-auto shrink-0") }}
|
||||||
</div>
|
</div>
|
||||||
<dl class="mt-1.5 space-y-0.5 text-xs text-slate-500">
|
<dl class="mt-1.5 space-y-0.5 text-xs text-slate-500">
|
||||||
{% if eintrag.verlag %}<div><dt class="inline font-medium text-slate-400">Verlag: </dt><dd class="inline">{{ eintrag.verlag }}</dd></div>{% endif %}
|
{% if eintrag.verlag %}<div><dt class="inline font-medium text-slate-400">Verlag: </dt><dd class="inline">{{ eintrag.verlag }}</dd></div>{% endif %}
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<td class="px-4 py-3">{{ eintrag.autor or '—' }}</td>
|
<td class="px-4 py-3">{{ eintrag.autor or '—' }}</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap">{{ eintrag.erscheinungsjahr if eintrag.erscheinungsjahr else '—' }}</td>
|
<td class="px-4 py-3 whitespace-nowrap">{{ eintrag.erscheinungsjahr if eintrag.erscheinungsjahr else '—' }}</td>
|
||||||
<td class="px-4 py-3">
|
<td class="px-4 py-3">
|
||||||
<span class="inline-block px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-800 text-xs">{{ eintrag.status }}</span>
|
{% from "status.html" import status_badge %}{{ status_badge(eintrag.status) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap text-slate-500">
|
<td class="px-4 py-3 whitespace-nowrap text-slate-500">
|
||||||
{{ eintrag.aktualisiert_am.strftime('%d.%m.%Y %H:%M') if eintrag.aktualisiert_am else '—' }}
|
{{ eintrag.aktualisiert_am.strftime('%d.%m.%Y %H:%M') if eintrag.aktualisiert_am else '—' }}
|
||||||
|
|||||||
@@ -87,13 +87,7 @@
|
|||||||
title="Die dedup-Prüfung hatte beim Eintragen Treffer.">{% from "icons.html" import icon_warnung %}{{ icon_warnung("h-3.5 w-3.5") }} Prüfhinweis</span>
|
title="Die dedup-Prüfung hatte beim Eintragen Treffer.">{% from "icons.html" import icon_warnung %}{{ icon_warnung("h-3.5 w-3.5") }} Prüfhinweis</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
{% if eintrag.status == 'offen' %}
|
{% from "status.html" import status_badge %}{{ status_badge(eintrag.status, status_anzeige[eintrag.status], "ml-auto shrink-0") }}
|
||||||
<span class="ml-auto shrink-0 inline-block px-2 py-0.5 rounded-full bg-slate-200 text-slate-700 text-xs">{{ status_anzeige[eintrag.status] }}</span>
|
|
||||||
{% elif eintrag.status == 'in_bearbeitung' %}
|
|
||||||
<span class="ml-auto shrink-0 inline-block px-2 py-0.5 rounded-full bg-sky-100 text-sky-800 text-xs">{{ status_anzeige[eintrag.status] }}</span>
|
|
||||||
{% else %}
|
|
||||||
<span class="ml-auto shrink-0 inline-block px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-800 text-xs">{{ status_anzeige[eintrag.status] }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
<dl class="mt-1.5 space-y-0.5 text-xs text-slate-500">
|
<dl class="mt-1.5 space-y-0.5 text-xs text-slate-500">
|
||||||
{% if eintrag.verlag %}<div><dt class="inline font-medium text-slate-400">Verlag: </dt><dd class="inline">{{ eintrag.verlag }}</dd></div>{% endif %}
|
{% if eintrag.verlag %}<div><dt class="inline font-medium text-slate-400">Verlag: </dt><dd class="inline">{{ eintrag.verlag }}</dd></div>{% endif %}
|
||||||
@@ -180,13 +174,7 @@
|
|||||||
<td class="px-4 py-3 whitespace-nowrap">{{ eintrag.ausgabe or '—' }}</td>
|
<td class="px-4 py-3 whitespace-nowrap">{{ eintrag.ausgabe or '—' }}</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap">{{ namen.get(eintrag.rezensent_id, '—') }}</td>
|
<td class="px-4 py-3 whitespace-nowrap">{{ namen.get(eintrag.rezensent_id, '—') }}</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap">
|
<td class="px-4 py-3 whitespace-nowrap">
|
||||||
{% if eintrag.status == 'offen' %}
|
{% from "status.html" import status_badge %}{{ status_badge(eintrag.status, status_anzeige[eintrag.status]) }}
|
||||||
<span class="inline-block px-2 py-0.5 rounded-full bg-slate-200 text-slate-700 text-xs">{{ status_anzeige[eintrag.status] }}</span>
|
|
||||||
{% elif eintrag.status == 'in_bearbeitung' %}
|
|
||||||
<span class="inline-block px-2 py-0.5 rounded-full bg-sky-100 text-sky-800 text-xs">{{ status_anzeige[eintrag.status] }}</span>
|
|
||||||
{% else %}
|
|
||||||
<span class="inline-block px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-800 text-xs">{{ status_anzeige[eintrag.status] }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap text-slate-500">
|
<td class="px-4 py-3 whitespace-nowrap text-slate-500">
|
||||||
{{ eintrag.aktualisiert_am.strftime('%d.%m.%Y %H:%M') if eintrag.aktualisiert_am else '—' }}
|
{{ eintrag.aktualisiert_am.strftime('%d.%m.%Y %H:%M') if eintrag.aktualisiert_am else '—' }}
|
||||||
|
|||||||
@@ -28,10 +28,11 @@
|
|||||||
<td class="px-4 py-2">{{ b.display_name }}</td>
|
<td class="px-4 py-2">{{ b.display_name }}</td>
|
||||||
<td class="px-4 py-2">{{ rollen_anzeige[b.role] or b.role }}</td>
|
<td class="px-4 py-2">{{ rollen_anzeige[b.role] or b.role }}</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
|
{% from "status.html" import status_badge %}
|
||||||
{% if b.active %}
|
{% if b.active %}
|
||||||
<span class="text-emerald-700">aktiv</span>
|
{{ status_badge("aktiv", "aktiv") }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="text-red-600">deaktiviert</span>
|
{{ status_badge("deaktiviert", "deaktiviert") }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2 text-slate-500">{{ b.created_at.strftime('%d.%m.%Y') if b.created_at else '–' }}</td>
|
<td class="px-4 py-2 text-slate-500">{{ b.created_at.strftime('%d.%m.%Y') if b.created_at else '–' }}</td>
|
||||||
|
|||||||
26
src/redaktionskern/templates/status.html
Normal file
26
src/redaktionskern/templates/status.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{# Einheitliche Status-Badges (semantisches Farbsystem).
|
||||||
|
Aufruf: {% from "status.html" import status_badge %}
|
||||||
|
{{ status_badge(eintrag.status) }} oder mit abweichendem Text:
|
||||||
|
{{ status_badge(eintrag.status, status_anzeige[eintrag.status]) }} #}
|
||||||
|
{% from "icons.html" import icon_warnung %}
|
||||||
|
{% macro status_badge(status, text=none, extra="") -%}
|
||||||
|
{% set farben = {
|
||||||
|
'neuheit': 'bg-emerald-100 text-emerald-800',
|
||||||
|
'neu': 'bg-emerald-100 text-emerald-800',
|
||||||
|
'offen': 'bg-slate-200 text-slate-800',
|
||||||
|
'in_bearbeitung': 'bg-sky-100 text-sky-800',
|
||||||
|
'planung': 'bg-sky-100 text-sky-800',
|
||||||
|
'abgeschlossen': 'bg-emerald-100 text-emerald-800',
|
||||||
|
'aktiv': 'bg-emerald-100 text-emerald-800',
|
||||||
|
'warnung': 'bg-amber-100 text-amber-800',
|
||||||
|
'konflikt': 'bg-amber-100 text-amber-800',
|
||||||
|
'pruefung': 'bg-amber-100 text-amber-800',
|
||||||
|
'fehler': 'bg-red-100 text-red-800',
|
||||||
|
'deaktiviert': 'bg-slate-200 text-slate-600',
|
||||||
|
'archiviert': 'bg-slate-200 text-slate-600',
|
||||||
|
} -%}
|
||||||
|
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs whitespace-nowrap {{ farben.get(status, 'bg-slate-100 text-slate-700') }} {{ extra }}">
|
||||||
|
{%- if status in ('warnung', 'konflikt', 'pruefung') %}{{ icon_warnung("h-3.5 w-3.5") }} {% endif -%}
|
||||||
|
{{ text if text is not none else status }}
|
||||||
|
</span>
|
||||||
|
{%- endmacro %}
|
||||||
Reference in New Issue
Block a user