{% extends "root.html" %}
{% block content %}
<div class="space-y-4 text-left">
<h1 class="text-3xl font-bold">Manage reactions</h1>
<p class="opacity-70 text-sm">The reaction set users can pick from on posts.</p>
<form method="post" action="/admin/reactions"
class="card bg-base-200 p-4 grid grid-cols-1 md:grid-cols-4 gap-2 items-end">
<label class="form-control">
<span class="label-text text-xs">Emoji</span>
<input class="input input-bordered input-sm" name="emoji" placeholder="🎉" required/>
</label>
<label class="form-control">
<span class="label-text text-xs">Key (identifier)</span>
<input class="input input-bordered input-sm" name="key" placeholder="party" required/>
</label>
<label class="form-control">
<span class="label-text text-xs">Position</span>
<input class="input input-bordered input-sm" type="number" name="position" placeholder="0"/>
</label>
<button class="btn btn-primary btn-sm" type="submit">Add reaction</button>
</form>
{% if reactions|length == 0 %}
<p class="opacity-70">No reactions configured.</p>
{% else %}
<div class="overflow-x-auto">
<table class="table">
<thead>
<tr><th>Emoji</th><th>Key</th><th class="text-right">Position</th><th></th></tr>
</thead>
<tbody>
{% for r in reactions %}
<tr class="hover {% if not r.is_active %}opacity-50{% endif %}">
<td class="text-2xl">{{ r.emoji }}</td>
<td><code class="text-xs">{{ r.key }}</code></td>
<td class="text-right font-mono">{{ r.position }}</td>
<td class="text-right whitespace-nowrap">
<form method="post" action="/admin/reactions/{{ r.id }}/toggle" class="inline">
<button class="btn btn-ghost btn-xs" type="submit">{% if r.is_active %}Disable{% else %}Enable{% endif %}</button>
</form>
<form method="post" action="/admin/reactions/{{ r.id }}/delete" class="inline"
hx-boost="false" onsubmit="return confirm('Delete {{ r.emoji }} {{ r.key }}? Existing reactions of this type are removed.');">
<button class="btn btn-error btn-xs" type="submit">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
{% endblock %}
neiam
/recourse
public · Issues · Pulls · Labels · Forks · Compare · Actions running · Badges · Packages
⭐
Log in to mark this repository.
2.3 KiB · text
History
b1da290