SielBotWebsite/templates/macros.html
Maaxxs 585cbc5ac2 Begrüßung: Willkommensnachricht mit Karte, private Nachricht, Startrollen und Abschied
Nachrichten-Editor mit Discord-Vorschau (Text oder Einbettung), Live-Vorschau der
Willkommenskarte, eigener Kartenhintergrund und Test per Direktnachricht.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 06:59:52 +02:00

28 lines
1.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{# Ein/Aus-Schalter (wie bei MEE6) #}
{% macro switch(id, checked) %}
<label class="switch" title="An/Aus">
<input type="checkbox" id="{{ id }}"{% if checked %} checked{% endif %}>
<span class="switch-track"><span class="switch-label-on">AN</span><span class="switch-label-off">AUS</span></span>
</label>
{% endmacro %}
{# Auswahlliste fuer Textkanaele, gruppiert nach Kategorie #}
{% macro channel_select(name, channels, selected, types=("text", "news"), empty="– keiner –") %}
{% set cats = channels | selectattr("type", "equalto", "category") | list %}
<select name="{{ name }}">
<option value="">{{ empty }}</option>
{% for ch in channels if ch.type in types and not ch.category_id %}
<option value="{{ ch.id }}"{% if ch.id == selected %} selected{% endif %}># {{ ch.name }}</option>
{% endfor %}
{% for cat in cats %}
{% set inner = channels | selectattr("category_id", "equalto", cat.id) | selectattr("type", "in", types) | list %}
{% if inner %}
<optgroup label="{{ cat.name }}">
{% for ch in inner %}
<option value="{{ ch.id }}"{% if ch.id == selected %} selected{% endif %}># {{ ch.name }}</option>
{% endfor %}
</optgroup>
{% endif %}
{% endfor %}
</select>
{% endmacro %}