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

77 lines
3.9 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 %}
2023-07-30 14:33:50 +02:00
<div class="max-w-screen-lg w-full">
{% if flash %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
{% endif %}
2023-04-28 19:44:32 +02:00
2023-07-30 14:33:50 +02:00
<h1 class="h1">Users</h1>
2023-07-30 14:33:50 +02:00
<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:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Name"/>
2023-07-30 14:33:50 +02:00
</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"/>
2023-08-09 23:39:11 +02:00
Scheckbuch</label>
2023-07-30 14:33:50 +02:00
</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>
2023-04-05 20:56:36 +02:00
2023-07-30 14:33:50 +02:00
<!-- START filterBar -->
<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:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Suchen nach..."/>
2023-07-30 14:33:50 +02:00
</div>
<!-- END filterBar -->
2023-07-30 14:33:50 +02:00
<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 %}
2023-09-27 15:36:07 +02:00
<div data-filterable="true" data-filter="{{ user.name }}">
<form action="/admin/user" method="post" class="bg-white p-3 rounded-md flex items-end md:items-center justify-between w-full">
<div class="w-full">
<input type="hidden" name="id" value="{{ user.id }}"/>
<div class="font-bold mb-1">{{ user.name }}
{% if user.last_access %}
(last access:
{{ user.last_access | date }})
{% endif %}
</div>
<div class="grid md:grid-cols-3">
{{ macros::checkbox(label='Scheckbuch', name='is_guest', id=loop.index , checked=user.is_guest) }}
{{ macros::checkbox(label='Steuerberechtigter', name='is_cox', id=loop.index , checked=user.is_cox) }}
{{ macros::checkbox(label='Technical', name='is_tech', id=loop.index , checked=user.is_tech) }}
{{ macros::checkbox(label='Admin', name='is_admin', id=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 class="grid gap-3">
<a href="/admin/user/{{ user.id }}/delete" class="inline-block btn btn-alert" onclick="return confirm('Wirklich löschen?');">
{% include "includes/delete-icon" %}
Löschen
</a>
<input value="Ändern" type="submit" class="w-28 btn btn-primary"/>
</div>
</form>
</div>
2023-07-30 14:33:50 +02:00
{% endfor %}
</div>
2023-04-04 10:44:14 +02:00
2023-07-30 14:33:50 +02:00
</div>
2023-04-04 10:44:14 +02:00
{% endblock content %}