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>
28 lines
1.3 KiB
HTML
28 lines
1.3 KiB
HTML
{# 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 %}
|