58 lines
3.2 KiB
Plaintext
58 lines
3.2 KiB
Plaintext
{% import "includes/macros" as macros %}
|
|
|
|
{% 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 sm:flex items-end 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 class="text-right">
|
|
<input value="Hinzufügen" type="submit" class="w-28 mt-2 sm:mt-0 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>
|
|
</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">
|
|
{{ macros::checkbox(label='Gast', name='is_guest' ~ loop.index , checked=user.is_guest) }}
|
|
{{ macros::checkbox(label='Steuerberechtigter', name='is_cox' ~ loop.index , checked=user.is_cox) }}
|
|
{{ macros::checkbox(label='Admin', name='is_admin' ~ loop.index , checked=user.is_admin) }}
|
|
</div>
|
|
{% if user.pw %}
|
|
<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>
|
|
</form>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock content %}
|