[TASK] quick restructure of user screen
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m26s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
Marie Birner 2024-06-24 16:58:19 +02:00
parent 1dc0c9c0e1
commit dba1e08c5d

View File

@ -36,37 +36,47 @@
placeholder="Suchen nach (Name, [yes|no]-role:<name>, has-[no-]membership-pdf)" /> placeholder="Suchen nach (Name, [yes|no]-role:<name>, has-[no-]membership-pdf)" />
</div> </div>
<!-- END filterBar --> <!-- END filterBar -->
<div class="bg-primary-100 dark:bg-primary-950 p-3 rounded-b-md grid gap-4">
<div id="filter-result-js" <div id="filter-result-js"
class="text-primary-950 dark:text-white text-right"></div> class="search-result"></div>
{% for user in users %} {% for user in users %}
<div data-filterable="true" <div data-filterable="true"
data-filter="{{ user.name }} {% for role in roles %} {% if role.name in user.roles %} yes-role:{{ role.name }} {% else %} no-role:{{ role.name }} {% endif %} role-{{ role }} {% endfor %} {% if user.membership_pdf %}has-membership-pdf{% else %}has-no-membership-pdf{% endif %} "> data-filter="{{ user.name }} {% for role in roles %} {% if role.name in user.roles %} yes-role:{{ role.name }} {% else %} no-role:{{ role.name }} {% endif %} role-{{ role }} {% endfor %} {% if user.membership_pdf %}has-membership-pdf{% else %}has-no-membership-pdf{% endif %}" class="border-t bg-white dark:bg-primary-900 py-3 px-4 relative">
<form action="/admin/user" <details class="block">
method="post" <summary>
enctype="multipart/form-data" <span class="text-black dark:text-white cursor-pointer">
class="bg-white dark:bg-primary-900 p-3 rounded-md w-full"> <span class="font-bold">
<div class="w-full grid gap-3">
<input type="hidden" name="id" value="{{ user.id }}" />
<div class="font-bold mb-1 text-black dark:text-white">
{{ user.name }} {{ user.name }}
{% if user.last_access %} {% if user.last_access %}
(last access: (last access:
{{ user.last_access | date }}) {{ user.last_access | date }})
{% endif %} {% endif %}
</span>
<small class="block text-gray-600 dark:text-gray-100">
{{ user.roles }}
</small>
</span>
</summary>
<form action="/admin/user"
method="post"
enctype="multipart/form-data"
class="w-full mt-2">
{% if user.pw %} {% if user.pw %}
<a class="block mt-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline" <a class="block my-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a> href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a>
{% endif %} {% endif %}
{% if not user.last_access and "admin" in loggedin_user.roles %} {% if not user.last_access and "admin" in loggedin_user.roles %}
<a class="block mt-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline" <a class="block my-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
href="/admin/user/{{ user.id }}/send-welcome-mail">Willkommensmail verschicken</a> href="/admin/user/{{ user.id }}/send-welcome-mail">Willkommensmail verschicken</a>
{% endif %} {% endif %}
</div> <div class="w-full grid gap-3 mt-3">
<input type="hidden" name="id" value="{{ user.id }}" />
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-3"> <div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-3">
{% for role in roles %} {% for role in roles %}
{{ macros::checkbox(label=role.name, name="roles[" ~ role.id ~ "]", id=loop.index , checked=role.name in user.roles, disabled=allowed_to_edit == false) }} {{ macros::checkbox(label=role.name, name="roles[" ~ role.id ~ "]", id=loop.index , checked=role.name in user.roles, disabled=allowed_to_edit == false) }}
{% endfor %} {% endfor %}
<hr class="sm:col-span-2 lg:col-span-4 my-3"/>
{% if user.membership_pdf %} {% if user.membership_pdf %}
<a href="/admin/user/{{ user.id }}/membership" <a href="/admin/user/{{ user.id }}/membership"
class="text-black dark:text-white">Beitrittserklärung herunterladen</a> class="text-black dark:text-white">Beitrittserklärung herunterladen</a>
@ -100,8 +110,8 @@
</div> </div>
{% endif %} {% endif %}
</form> </form>
</details>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div>
{% endblock content %} {% endblock content %}