Compare commits

..

No commits in common. "2540a3dc7ceaa94adde08fc8bacc0029e43084cd" and "72b86d4daded62492773c5452e30d9ff32c123f9" have entirely different histories.

2 changed files with 77 additions and 69 deletions

View File

@ -36,87 +36,89 @@
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 id="filter-result-js" class="search-result"></div> <div id="filter-result-js"
{% for user in users %} class="search-result"></div>
<div data-filterable="true" {% for user in users %}
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 %}" <div data-filterable="true"
class="border-t bg-white dark:bg-primary-900 py-3 px-4 relative"> 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">
<details class="block dark:text-white w-full"> <details class="block dark:text-white w-full">
<summary> <summary>
<span class="text-black dark:text-white cursor-pointer"> <span class="text-black dark:text-white cursor-pointer">
<span class="font-bold"> <span class="font-bold">
{{ user.name }} {{ user.name }}
{% if not user.last_access and "admin" in loggedin_user.roles and user.mail %} {% if not user.last_access and "admin" in loggedin_user.roles and user.mail %}
<form action="/admin/user" <form action="/admin/user"
method="post" method="post"
enctype="multipart/form-data" enctype="multipart/form-data"
class="inline"> class="inline">
&bullet; <a class="font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline" &bullet; <a class="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" href="/admin/user/{{ user.id }}/send-welcome-mail" onclick="return confirm('Willst du wirklich das Willkommensmail an {{ user.name }} ausschicken?');">Willkommensmail verschicken</a>
onclick="return confirm('Willst du wirklich das Willkommensmail an {{ user.name }} ausschicken?');">Willkommensmail verschicken</a> </form>
</form> {% endif %}
{% if user.last_access %}
&bullet; ⏳&nbsp;{{ user.last_access | date }}
{% endif %} {% endif %}
{% if user.last_access %}&bullet; ⏳&nbsp;{{ user.last_access | date }}{% endif %}
</span> </span>
<small class="block text-gray-600 dark:text-gray-100"> <small class="block text-gray-600 dark:text-gray-100">
{% for role in user.roles %} {% for role in user.roles %}
{{ role }} {{ role }}{% if not loop.last %}, {% endif %}
{% if not loop.last %},{% endif %} {% endfor %}
{% endfor %}
</small> </small>
</span> </span>
</summary> </summary>
<form action="/admin/user" <form action="/admin/user"
method="post" method="post"
enctype="multipart/form-data" enctype="multipart/form-data"
class="w-full mt-2"> class="w-full mt-2">
{% if user.pw %} {% if user.pw %}
<a class="block my-1 font-normal text-[#f43f5e] dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline" <a class="block my-1 font-normal text-[#f43f5e] dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
href="/admin/user/{{ user.id }}/reset-pw" href="/admin/user/{{ user.id }}/reset-pw" onclick="return confirm('Willst du wirklich das Passwort zurücksetzen?');">Passwort zurücksetzen</a>
onclick="return confirm('Willst du wirklich das Passwort zurücksetzen?');">Passwort zurücksetzen</a> {% endif %}
{% endif %} <div class="w-full grid gap-3 mt-3">
<div class="w-full grid gap-3 mt-3"> <input type="hidden" name="id" value="{{ user.id }}" />
<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"/>
<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> {% else %}
{% else %} {{ macros::input(label='Beitrittserklärung', name='membership_pdf', id=loop.index, type="file", readonly=allowed_to_edit == false, accept='application/pdf') }}
{{ macros::input(label='Beitrittserklärung', name='membership_pdf', id=loop.index, type="file", readonly=allowed_to_edit == false, accept='application/pdf') }} {% endif %}
{% endif %} {{ macros::input(label='DOB', name='dob', id=loop.index, type="text", value=user.dob, readonly=allowed_to_edit == false) }}
{{ macros::input(label='DOB', name='dob', id=loop.index, type="text", value=user.dob, readonly=allowed_to_edit == false) }} {{ macros::input(label='Weight (kg)', name='weight', id=loop.index, type="text", value=user.weight, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Weight (kg)', name='weight', id=loop.index, type="text", value=user.weight, readonly=allowed_to_edit == false) }} {{ macros::input(label='Sex', name='sex', id=loop.index, type="text", value=user.sex, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Sex', name='sex', id=loop.index, type="text", value=user.sex, readonly=allowed_to_edit == false) }} {{ macros::input(label='Mitglied seit', name='member_since_date', id=loop.index, type="text", value=user.member_since_date, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Mitglied seit', name='member_since_date', id=loop.index, type="text", value=user.member_since_date, readonly=allowed_to_edit == false) }} {{ macros::input(label='Geburtsdatum', name='birthdate', id=loop.index, type="text", value=user.birthdate, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Geburtsdatum', name='birthdate', id=loop.index, type="text", value=user.birthdate, readonly=allowed_to_edit == false) }} {{ macros::input(label='Mail', name='mail', id=loop.index, type="text", value=user.mail, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Mail', name='mail', id=loop.index, type="text", value=user.mail, readonly=allowed_to_edit == false) }} {{ macros::input(label='Nickname', name='nickname', id=loop.index, type="text", value=user.nickname, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Nickname', name='nickname', id=loop.index, type="text", value=user.nickname, readonly=allowed_to_edit == false) }} {{ macros::input(label='Notizen', name='notes', id=loop.index, type="text", value=user.notes, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Notizen', name='notes', id=loop.index, type="text", value=user.notes, readonly=allowed_to_edit == false) }} {{ macros::input(label='Telefon', name='phone', id=loop.index, type="text", value=user.phone, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Telefon', name='phone', id=loop.index, type="text", value=user.phone, readonly=allowed_to_edit == false) }} {{ macros::input(label='Adresse', name='address', id=loop.index, type="text", value=user.address, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Adresse', name='address', id=loop.index, type="text", value=user.address, readonly=allowed_to_edit == false) }} {% if allowed_to_edit %}
{% if allowed_to_edit %} {{ macros::select(label="Familie", data=families, name='family_id', selected_id=user.family_id, display=['names'], default="Keine Familie", new_last_entry='Neue Familie anlegen') }}
{{ macros::select(label="Familie", data=families, name='family_id', selected_id=user.family_id, display=['names'], default="Keine Familie", new_last_entry='Neue Familie anlegen') }} {% endif %}
{% endif %} </div>
</div> </div>
</div> {% if allowed_to_edit %}
{% if allowed_to_edit %} <div class="mt-3 text-right">
<div class="mt-3 text-right"> <a href="/admin/user/{{ user.id }}/delete"
<a href="/admin/user/{{ user.id }}/delete" class="w-28 btn btn-alert"
class="w-28 btn btn-alert" onclick="return confirm('Wirklich löschen?');">
onclick="return confirm('Wirklich löschen?');"> {% include "includes/delete-icon" %}
{% include "includes/delete-icon" %} Löschen
Löschen </a>
</a> <input value="Ändern" type="submit" class="w-28 btn btn-primary ml-1" />
<input value="Ändern" type="submit" class="w-28 btn btn-primary ml-1" /> </div>
</div> {% endif %}
{% endif %} </form>
</form> </details>
</details> </div>
</div> {% endfor %}
{% endfor %}
</div> </div>
{% endblock content %} {% endblock content %}

View File

@ -391,10 +391,16 @@
</div> </div>
{# --- START Add Buttons --- #} {# --- START Add Buttons --- #}
{% if "manage_events" in loggedin_user.roles or "cox" in loggedin_user.roles %} {% if "manage_events" in loggedin_user.roles or "cox" in loggedin_user.roles %}
<div class="grid {% if "manage_events" in loggedin_user.roles and "cox" in loggedin_user.roles %}grid-cols-2{% endif %} text-center"> <div class="grid {% if "manage_events" in loggedin_user.roles and "cox" in loggedin_user.roles %}grid-cols-2{% endif %} text-center">
{% if "manage_events" in loggedin_user.roles %} {% if "manage_events" in loggedin_user.roles %}
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" data-day="{{ day.day }}" data-body="#addEventForm" class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 dark:bg-primary-950 text-white py-2 text-sm font-semibold <a href="#"
{% if "cox" in loggedin_user.roles %} data-sidebar="true"
data-trigger="sidebar"
data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen"
data-day="{{ day.day }}"
data-body="#addEventForm"
class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 dark:bg-primary-950 text-white py-2 text-sm font-semibold
{% if "cox" in loggedin_user.roles %}
rounded-bl-md rounded-bl-md
{% else %} {% else %}
rounded-b-md rounded-b-md