rowt/templates/admin/user/index.html.tera

58 lines
3.8 KiB
Plaintext
Raw Normal View History

2023-04-06 09:30:43 +02:00
{% import "includes/macros" as macros %}
2023-04-04 10:44:14 +02:00
{% extends "base" %}
{% block content %}
<div class="max-w-screen-lg w-full">
<h1 class="text-center text-3xl uppercase tracking-wide font-bold text-primary-900">Users</h1>
<form action="/admin/user/new" method="post" class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 flex items-end md:items-center justify-between">
<div class="w-full">
<h2 class="text-md font-bold mb-2 uppercase tracking-wide">Neuen User hinzufügen</h2>
<div class="grid md:grid-cols-3">
<div>
<label for="name" class="sr-only">Name</label>
<input type="text" name="name" class="relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:z-10 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Name"/>
</div>
<div class="flex items-center">
<label for="is_guest" class="flex items-center cursor-pointer hover:text-gray-100"><input type="checkbox" id="is_guest" name="is_guest" class="h-4 w-4 accent-gray-200 mr-2" checked="true"/> Gast</label>
</div>
</div>
</div>
<div>
<input value="Hinzufügen" type="submit" class="w-28 rounded-md bg-primary-500 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"/>
</div>
2023-04-05 20:56:36 +02:00
</form>
<div class="bg-primary-200 p-3 mt-4 rounded-t-md">
<label for="name" class="sr-only">Suche</label>
<input type="search" name="name" id="filter-js" class="w-full relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:z-10 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Suchen nach..."/>
</div>
<div class="bg-primary-100 p-3 rounded-b-md grid gap-4">
<div id="filter-result-js" class="text-primary-950"></div>
{% for user in users %}
<form action="/admin/user" data-filterable="true" data-filter="{{ user.name }}" method="post" class="bg-white p-3 rounded-md flex items-end md:items-center justify-between">
<div class="w-full">
<input type="hidden" name="id" value="{{ user.id }}" />
<div class="font-bold mb-1">{{ user.name }}</div>
<div class="grid md:grid-cols-3">
<label for="is_guest{{ loop.index }}" class="flex items-center cursor-pointer hover:text-gray-900"><input type="checkbox" id="is_guest{{ loop.index }}" name="is_guest" {% if user.is_guest %} checked="true"{% endif %} class="h-4 w-4 accent-primary-600 mr-2"/> Gast</label>
<label for="is_cox{{ loop.index }}" class="flex items-center cursor-pointer hover:text-gray-900"><input type="checkbox" id="is_cox{{ loop.index }}" name="is_cox" {% if user.is_cox %} checked="true"{% endif %} class="h-4 w-4 accent-primary-600 mr-2"/> Steuerberechtigter</label>
<label for="is_admin{{ loop.index }}" class="flex items-center cursor-pointer hover:text-gray-900"><input type="checkbox" id="is_admin{{ loop.index }}" name="is_admin" {% if user.is_admin %} checked="true"{% endif %} class="h-4 w-4 accent-primary-600 mr-2"/> Admin</label>
</div>
{% if user.pw %}
2023-04-05 22:28:11 +02:00
<a class="inline-block mt-1 text-primary-600 hover:text-primary-900 underline" href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a>
{% endif %}
</div>
<div>
<input value="Ändern" type="submit" class="w-28 rounded-md bg-primary-600 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"/>
</div>
2023-04-04 10:44:14 +02:00
</form>
{% endfor %}
</div>
2023-04-04 10:44:14 +02:00
</div>
2023-04-04 10:44:14 +02:00
{% endblock content %}