87 lines
4.6 KiB
HTML
87 lines
4.6 KiB
HTML
{% extends "base.html" %}
|
||
{% from "macros.html" import channel_select %}
|
||
{% block title %}Reaktionsrollen{% endblock %}
|
||
{% block content %}
|
||
<div class="page-head">
|
||
<a href="/reaktionsrollen" class="back-link">← Alle Reaktionsrollen</a>
|
||
<h1>{{ panel.name if panel else "Neue Reaktionsrollen" }}
|
||
{% if status == "published" %}<span class="tag tag-green">Veröffentlicht</span>
|
||
{% elif status == "changed" %}<span class="tag tag-gold">Geändert – noch nicht im Discord</span>
|
||
{% else %}<span class="tag">Entwurf</span>{% endif %}
|
||
</h1>
|
||
</div>
|
||
{% if error %}
|
||
<div class="flash flash-error">{{ error }}</div>
|
||
{% else %}
|
||
<script type="application/json" id="rr-data">{{ {"panel": draft or panel, "template": preset, "guild": {"name": guild.name, "bot_avatar": guild.bot_avatar, "member_count": guild.member_count, "channels": guild.channels, "roles": guild.roles, "emojis": guild.emojis}, "user": {"id": user.id, "name": user.name, "avatar": user.avatar}} | tojson }}</script>
|
||
|
||
<form method="post" action="/reaktionsrollen/speichern" id="rr-form">
|
||
<input type="hidden" name="csrf" value="{{ csrf }}">
|
||
<input type="hidden" name="id" value="{{ panel.id if panel else '' }}">
|
||
<input type="hidden" name="payload" id="rr-payload">
|
||
|
||
<section class="panel">
|
||
<div class="field-row">
|
||
<label class="field"><span>Name (nur fürs Panel)</span>
|
||
<input type="text" id="rr-name" maxlength="80">
|
||
</label>
|
||
<label class="field"><span>Kanal</span>
|
||
{{ channel_select("channel", guild.channels, None, empty="– Kanal wählen –") }}
|
||
</label>
|
||
</div>
|
||
<label class="field"><span>Log-Kanal (optional) – hier meldet Siel jede Rolle, die über diese Nachricht vergeben oder entfernt wird</span>
|
||
{{ channel_select("log_channel", guild.channels, None, empty="– kein Log –") }}
|
||
</label>
|
||
|
||
<div class="field"><span>Art</span>
|
||
<div class="choice-grid" id="rr-kind">
|
||
<label class="choice"><input type="radio" name="kind" value="reactions"><strong>Reaktionen</strong><small>Emojis unter der Nachricht, bis zu 20</small></label>
|
||
<label class="choice"><input type="radio" name="kind" value="buttons"><strong>Knöpfe</strong><small>Mit Beschriftung und Farbe, bis zu 25</small></label>
|
||
<label class="choice"><input type="radio" name="kind" value="select"><strong>Auswahlliste</strong><small>Aufklappliste, bis zu 25</small></label>
|
||
</div>
|
||
</div>
|
||
<div class="field"><span>Modus</span>
|
||
<div class="choice-grid" id="rr-mode">
|
||
<label class="choice"><input type="radio" name="mode" value="normal"><strong>Mehrere Rollen</strong><small>An- und abwählen, beliebig viele</small></label>
|
||
<label class="choice"><input type="radio" name="mode" value="unique"><strong>Nur eine Rolle</strong><small>Eine neue Wahl ersetzt die alte</small></label>
|
||
<label class="choice"><input type="radio" name="mode" value="verify"><strong>Verifizieren</strong><small>Rolle geben, andere wegnehmen – Reaktion entfernen macht es rückgängig</small></label>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="panel">
|
||
<h2>Nachricht</h2>
|
||
<div id="rr-editor"></div>
|
||
</section>
|
||
|
||
<section class="panel">
|
||
<div class="panel-head">
|
||
<div>
|
||
<h2>Rollen</h2>
|
||
<p class="muted small" id="rr-items-hint"></p>
|
||
</div>
|
||
</div>
|
||
<div id="rr-items" class="rr-items"></div>
|
||
<button type="button" class="btn btn-sm btn-ghost" id="rr-add">+ Rolle hinzufügen</button>
|
||
<label class="field" id="rr-placeholder-field" hidden><span>Text in der leeren Auswahlliste</span>
|
||
<input type="text" id="rr-placeholder" maxlength="150">
|
||
</label>
|
||
<div class="field" id="rr-remove-field" hidden>
|
||
<span>Beim Verifizieren wegnehmen</span>
|
||
<div class="role-list" id="rr-remove"></div>
|
||
</div>
|
||
</section>
|
||
|
||
<div class="savebar">
|
||
<span class="muted small" id="dirty-note"></span>
|
||
{% if panel %}{% endif %}
|
||
<button type="submit" name="action" value="save" class="btn btn-secondary">Speichern</button>
|
||
<button type="submit" name="action" value="publish" class="btn">{{ "Speichern & aktualisieren" if panel and panel.message_id else "Speichern & veröffentlichen" }}</button>
|
||
</div>
|
||
</form>
|
||
|
||
<datalist id="emoji-suggestions"></datalist>
|
||
<script src="/static/js/embed-editor.js?v=2"></script>
|
||
<script src="/static/js/rr.js?v=3"></script>
|
||
{% endif %}
|
||
{% endblock %}
|