format
This commit is contained in:
parent
cfd3c6200f
commit
6d329eb980
@ -5,328 +5,330 @@
|
||||
<div class="max-w-screen-lg w-full">
|
||||
<h1 class="h1">{{ user.name }}</h1>
|
||||
<div class="grid sm:grid-cols-2 gap-3">
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">
|
||||
Grunddaten
|
||||
<br/>
|
||||
<small class="inline-block text-xs text-gray-500 dark:text-gray-100 ">
|
||||
{% if user.last_access %}
|
||||
Zuletzt eingeloggt am {{ user.last_access | date(format="%d. %m. %Y") }}
|
||||
{% else %}
|
||||
{{ user.name }} hat sich noch nie eingeloggt.
|
||||
{% endif %}
|
||||
</small>
|
||||
</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3 grid gap-3">
|
||||
<form action="/admin/user/{{ user.id }}/change-mail" method="post">
|
||||
{{ macros::inputgroup(label='Mailadresse', name='mail', type="text", value=user.mail, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-phone" method="post">
|
||||
{{ macros::inputgroup(label='Telefonnummer', name='phone', type="text", value=user.phone, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-nickname" method="post">
|
||||
{{ macros::inputgroup(label='Spitzname', name='nickname', type="text", value=user.nickname, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<span>Notizen: to be replaced with activity :-)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Mitgliedschaft
|
||||
<br/>
|
||||
<small class="inline-block text-xs text-gray-500 dark:text-gray-100 ">
|
||||
{% if "SchnupperInterest" in member %}
|
||||
Interessiert am Schnupperkurs
|
||||
{% elif "Schnupperant" in member %}
|
||||
Beim nächsten Schnupperkurs angemeldet
|
||||
{% elif "Scheckbuch" in member %}
|
||||
{% set logbook = member["Scheckbuch"] %}
|
||||
Scheckbuch (Ausfahrten: {{ logbook | length }})
|
||||
{% elif "Regular" in member %}
|
||||
Reguläres Vereinsmitglied
|
||||
{% elif "Foerdernd" in member %}
|
||||
Förderndes Vereinsmitglied
|
||||
{% elif "Unterstuetzend" in member %}
|
||||
Unterstützendes Vereinsmitglied
|
||||
{% endif %}
|
||||
<h2 class="h2">
|
||||
Grunddaten
|
||||
<br />
|
||||
<small class="inline-block text-xs text-gray-500 dark:text-gray-100 ">
|
||||
{% if user.last_access %}
|
||||
Zuletzt eingeloggt am {{ user.last_access | date(format="%d. %m. %Y") }}
|
||||
{% else %}
|
||||
{{ user.name }} hat sich noch nie eingeloggt.
|
||||
{% endif %}
|
||||
</small>
|
||||
</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
|
||||
{% if is_clubmember %}
|
||||
<div class="py-3 grid gap-3">
|
||||
<form action="/admin/user/{{ user.id }}/change-member-since" method="post">
|
||||
{{ macros::inputgroup(label='Mitglied seit', name='member_since', type="date", value=user.member_since_date, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-birthdate" method="post">
|
||||
{{ macros::inputgroup(label='Geburtsdatum', name='birthdate', type="date", value=user.birthdate, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-address" method="post">
|
||||
{{ macros::inputgroup(label='Adresse', name='address', type="text", value=user.address, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
|
||||
<form action="/admin/user/{{ user.id }}/change-family" method="post">
|
||||
{{ macros::selectgroup(label="Familie", data=families, name='family_id', selected_id=user.family_id, display=['names'], default="Keine Familie", new_last_entry='Neue Familie anlegen', readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
</div>
|
||||
<div class="py-3">
|
||||
{% if user.membership_pdf %}
|
||||
<a href="/admin/user/{{ user.id }}/membership"
|
||||
class="link link-primary">Beitrittserklärung herunterladen</a>
|
||||
{% else %}
|
||||
⚠️ Aktuell gibt's keine Beitrittserklärung 😢
|
||||
{% if allowed_to_edit %}
|
||||
Das kannst du hier ändern ⤵️
|
||||
<form action="/admin/user/{{ user.id }}/add-membership-pdf"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
class="grid gap-3">
|
||||
<fieldset>
|
||||
{{ macros::input(label='Neue Beitrittserklärung hochladen', name='membership_pdf', type="file", accept='application/pdf') }}
|
||||
</fieldset>
|
||||
<input value="Hochladen" type="submit" class="btn btn-primary" />
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="py-3 grid gap-3">
|
||||
<form action="/admin/user/{{ user.id }}/change-mail" method="post">
|
||||
{{ macros::inputgroup(label='Mailadresse', name='mail', type="text", value=user.mail, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-phone" method="post">
|
||||
{{ macros::inputgroup(label='Telefonnummer', name='phone', type="text", value=user.phone, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-nickname" method="post">
|
||||
{{ macros::inputgroup(label='Spitzname', name='nickname', type="text", value=user.nickname, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<span>Notizen: to be replaced with activity :-)</span>
|
||||
</div>
|
||||
{% if allowed_to_edit %}
|
||||
<div class="py-3">
|
||||
<div class="mt-3 text-right">
|
||||
<a href="/admin/user/{{ user.id }}/delete"
|
||||
class="btn btn-alert"
|
||||
onclick="return confirm('Ist {{ user.name }} wirklich aus dem Verein ausgetreten?');">
|
||||
{% include "includes/delete-icon" %}
|
||||
Mitglied ist ausgetreten
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">
|
||||
Mitgliedschaft
|
||||
<br />
|
||||
<small class="inline-block text-xs text-gray-500 dark:text-gray-100 ">
|
||||
{% if "SchnupperInterest" in member %}
|
||||
Interessiert am Schnupperkurs
|
||||
{% elif "Schnupperant" in member %}
|
||||
Beim nächsten Schnupperkurs angemeldet
|
||||
{% elif "Scheckbuch" in member %}
|
||||
{% set logbook = member["Scheckbuch"] %}
|
||||
Scheckbuch (Ausfahrten: {{ logbook | length }})
|
||||
{% elif "Regular" in member %}
|
||||
Reguläres Vereinsmitglied
|
||||
{% elif "Foerdernd" in member %}
|
||||
Förderndes Vereinsmitglied
|
||||
{% elif "Unterstuetzend" in member %}
|
||||
Unterstützendes Vereinsmitglied
|
||||
{% endif %}
|
||||
</small>
|
||||
</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
{% if is_clubmember %}
|
||||
<div class="py-3 grid gap-3">
|
||||
<form action="/admin/user/{{ user.id }}/change-member-since" method="post">
|
||||
{{ macros::inputgroup(label='Mitglied seit', name='member_since', type="date", value=user.member_since_date, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-birthdate" method="post">
|
||||
{{ macros::inputgroup(label='Geburtsdatum', name='birthdate', type="date", value=user.birthdate, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-address" method="post">
|
||||
{{ macros::inputgroup(label='Adresse', name='address', type="text", value=user.address, readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
<form action="/admin/user/{{ user.id }}/change-family" method="post">
|
||||
{{ macros::selectgroup(label="Familie", data=families, name='family_id', selected_id=user.family_id, display=['names'], default="Keine Familie", new_last_entry='Neue Familie anlegen', readonly=not allowed_to_edit) }}
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% elif "Scheckbuch" in member %}
|
||||
<div class="grid gap-3 pb-3">
|
||||
<div class="py-3">
|
||||
{% if user.membership_pdf %}
|
||||
<a href="/admin/user/{{ user.id }}/membership" class="link link-primary">Beitrittserklärung herunterladen</a>
|
||||
{% else %}
|
||||
⚠️ Aktuell gibt's keine Beitrittserklärung 😢
|
||||
{% if allowed_to_edit %}
|
||||
Das kannst du hier ändern ⤵️
|
||||
<form action="/admin/user/{{ user.id }}/add-membership-pdf"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
class="grid gap-3">
|
||||
<fieldset>
|
||||
{{ macros::input(label='Neue Beitrittserklärung hochladen', name='membership_pdf', type="file", accept='application/pdf') }}
|
||||
</fieldset>
|
||||
<input value="Hochladen" type="submit" class="btn btn-primary" />
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if allowed_to_edit %}
|
||||
<div class="py-3">
|
||||
<div class="mt-3 text-right">
|
||||
<a href="/admin/user/{{ user.id }}/delete"
|
||||
class="btn btn-alert"
|
||||
onclick="return confirm('Ist {{ user.name }} wirklich aus dem Verein ausgetreten?');">
|
||||
{% include "includes/delete-icon" %}
|
||||
Mitglied ist ausgetreten
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% elif "Scheckbuch" in member %}
|
||||
<div class="grid gap-3 pb-3">
|
||||
{% for log in logbook %}
|
||||
{{ log::show_old(log=log, state="completed", only_ones=false, index=loop.index, allowed_to_edit=false) }}
|
||||
{% endfor %}
|
||||
|
||||
<button type="button" onclick="document.getElementById('call-for-action').showModal()" class="btn btn-primary">Zu Vereinsmitglied umwandeln</button>
|
||||
</div>
|
||||
<dialog id="call-for-action"
|
||||
class="max-w-screen-sm w-full dark:bg-primary-600 dark:text-white rounded-md"
|
||||
onclick="document.getElementById('call-for-action').close()">
|
||||
<div onclick="event.stopPropagation();" class="p-3">
|
||||
<button type="button"
|
||||
onclick="document.getElementById('call-for-action').close()"
|
||||
title="Schließen"
|
||||
class="sidebar-close border-0 bg-primary-100 focus:bg-primary-50 text-black flex items-center justify-center transform rotate-45 absolute right-0 mr-3">
|
||||
<svg class="inline h-5 w-5"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 16 16">
|
||||
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="mt-8">
|
||||
<form action="/admin/user/{{ user.id }}/scheckbook-to-regular"
|
||||
method="post"
|
||||
enctype="multipart/form-data" class="grid gap-3">
|
||||
Type: Select -> normales Mitglied, förderndes Mitglied, unterstützendes Mitglied
|
||||
{{ macros::input(label='Mitglied seit', name='member_since', type="date", value=now() | date(), required=true) }}
|
||||
{{ macros::input(label='Geburtsdatum', name='birthdate', type="date", value=user.birthdate, required=true) }}
|
||||
{{ macros::input(label='Telefonnummer', name='phone', type="text", value=user.phone, required=true) }}
|
||||
{{ macros::input(label='Adresse', name='address', type="text", value=user.address, required=true) }}
|
||||
{{ macros::input(label='Beitrittserklärung', name='membership_pdf', type="file", accept='application/pdf', required=true) }}
|
||||
<input value="Als neues, reguläres Mitglied anlegen"
|
||||
type="submit"
|
||||
class="btn btn-primary" />
|
||||
</form>
|
||||
<button type="button"
|
||||
onclick="document.getElementById('call-for-action').showModal()"
|
||||
class="btn btn-primary">Zu Vereinsmitglied umwandeln</button>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
{% endif %}
|
||||
<dialog id="call-for-action"
|
||||
class="max-w-screen-sm w-full dark:bg-primary-600 dark:text-white rounded-md"
|
||||
onclick="document.getElementById('call-for-action').close()">
|
||||
<div onclick="event.stopPropagation();" class="p-3">
|
||||
<button type="button"
|
||||
onclick="document.getElementById('call-for-action').close()"
|
||||
title="Schließen"
|
||||
class="sidebar-close border-0 bg-primary-100 focus:bg-primary-50 text-black flex items-center justify-center transform rotate-45 absolute right-0 mr-3">
|
||||
<svg class="inline h-5 w-5"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 16 16">
|
||||
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="mt-8">
|
||||
<form action="/admin/user/{{ user.id }}/scheckbook-to-regular"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
class="grid gap-3">
|
||||
Type: Select -> normales Mitglied, förderndes Mitglied, unterstützendes Mitglied
|
||||
{{ macros::input(label='Mitglied seit', name='member_since', type="date", value=now() | date(), required=true) }}
|
||||
{{ macros::input(label='Geburtsdatum', name='birthdate', type="date", value=user.birthdate, required=true) }}
|
||||
{{ macros::input(label='Telefonnummer', name='phone', type="text", value=user.phone, required=true) }}
|
||||
{{ macros::input(label='Adresse', name='address', type="text", value=user.address, required=true) }}
|
||||
{{ macros::input(label='Beitrittserklärung', name='membership_pdf', type="file", accept='application/pdf', required=true) }}
|
||||
<input value="Als neues, reguläres Mitglied anlegen"
|
||||
type="submit"
|
||||
class="btn btn-primary" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if is_clubmember %}
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Rollen</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
<ul>
|
||||
{% for role in user.proper_roles -%}
|
||||
{% if not role.cluster and not role.hide_in_lists %}
|
||||
<li class="flex my-2 w-full justify-between items-center hover:bg-gray-100">
|
||||
<span>
|
||||
<strong>
|
||||
{% if role.formatted_name %}
|
||||
{{ role.formatted_name }}
|
||||
{% else %}
|
||||
{{ role.name }}
|
||||
{% endif %}
|
||||
</strong><br/><small>{{ role.desc }}</small>
|
||||
</span>
|
||||
{% if allowed_to_edit %}
|
||||
<a href="/admin/user/{{ user.id }}/remove-role/{{ role.id }}"
|
||||
onclick="return confirm('Willst du die Rolle \'{{ role.name }}\' von {{ user.name }} wirklich entfernen?');">🗑️</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if allowed_to_edit %}
|
||||
<details>
|
||||
<summary>+ Rolle</summary>
|
||||
<form action="/admin/user/{{ user.id }}/add-role" method="post">
|
||||
<fieldset>
|
||||
<select name="role_id">
|
||||
{% for role in roles %}
|
||||
{% if not role.cluster and role not in user.proper_roles and not role.hide_in_lists %}
|
||||
<option value="{{ role.id }}">
|
||||
{% if is_clubmember %}
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Rollen</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
<ul>
|
||||
{% for role in user.proper_roles -%}
|
||||
{% if not role.cluster and not role.hide_in_lists %}
|
||||
<li class="flex my-2 w-full justify-between items-center hover:bg-gray-100">
|
||||
<span>
|
||||
<strong>
|
||||
{% if role.formatted_name %}
|
||||
{{ role.formatted_name }}
|
||||
{% else %}
|
||||
{{ role.name }}
|
||||
{% endif %}
|
||||
{% if role.desc %}({{ role.desc }}){% endif %}
|
||||
</option>
|
||||
</strong>
|
||||
<br />
|
||||
<small>{{ role.desc }}</small>
|
||||
</span>
|
||||
{% if allowed_to_edit %}
|
||||
<a href="/admin/user/{{ user.id }}/remove-role/{{ role.id }}"
|
||||
onclick="return confirm('Willst du die Rolle \'{{ role.name }}\' von {{ user.name }} wirklich entfernen?');">🗑️</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input value="Rolle hinzufügen" type="submit" class="btn btn-primary ml-1" />
|
||||
</fieldset>
|
||||
</form>
|
||||
</details>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if supposed_to_pay %}
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">💸-Beitrag</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
{% if fee %}
|
||||
<div>
|
||||
<strong>{{ fee.name }}</strong>
|
||||
<span class="block">{{ fee.sum_in_cents / 100 }}€</span>
|
||||
</div>
|
||||
<div>
|
||||
{% for p in fee.parts %}
|
||||
{{ p.0 }} ({{ p.1 / 100 }}€)
|
||||
{% if not loop.last %}+{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if "paid" in user.roles %}
|
||||
✅ bezahlt
|
||||
{% else %}
|
||||
❌ Zahlung ausständig
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if "paid" in user.roles %}
|
||||
✅ {{ member | keys }} hat schon bezahlt
|
||||
{% else %}
|
||||
❌
|
||||
{% for key, value in member %}
|
||||
{% if loop.first %}{{ key }}{% endif %}
|
||||
{% endfor %}
|
||||
hat noch nicht bezahlt
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Aktivität von und mit {{ user.name }}</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
<ul class="list-disc ms-4">
|
||||
<li>Passwort zurückgesetzt am/um X</li>
|
||||
<li>Am X beigetreten.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">TODO</h2>
|
||||
<div class="border-t bg-white dark:bg-primary-900 py-3 px-4 relative">
|
||||
<span class="text-black dark:text-white cursor-pointer">
|
||||
<span class="font-bold">
|
||||
{{ user.name }}
|
||||
{% if not user.last_access and allowed_to_edit and user.mail %}
|
||||
<form action="/admin/user"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
class="inline">
|
||||
• <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"
|
||||
onclick="return confirm('Willst du wirklich das Willkommensmail an {{ user.name }} ausschicken?');">Willkommensmail verschicken</a>
|
||||
</form>
|
||||
{% endif %}
|
||||
</span>
|
||||
</span>
|
||||
<form action="/admin/user"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
class="w-full mt-2">
|
||||
{% 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"
|
||||
href="/admin/user/{{ user.id }}/reset-pw"
|
||||
onclick="return confirm('Willst du wirklich das Passwort zurücksetzen?');">Passwort zurücksetzen</a>
|
||||
{% endif %}
|
||||
<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">
|
||||
{% for cluster, cluster_roles in roles | group_by(attribute="cluster") %}
|
||||
<label for="cluster_{{ loop.index }}">{{ cluster }}</label>
|
||||
{# Determine the initially selected role within the cluster #}
|
||||
{% set_global selected_role_id = "none" %}
|
||||
{% for role in cluster_roles %}
|
||||
{% if selected_role_id == "none" and role.name in user.roles %}
|
||||
{% set_global selected_role_id = role.id %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{# Set default name to the selected role ID or first role if none selected #}
|
||||
<select id="cluster_{{ loop.index }}"
|
||||
{% if selected_role_id == 'none' %} {% else %} name="roles[{{ selected_role_id }}]" {% endif %}
|
||||
{% if allowed_to_edit == false %}disabled{% endif %}
|
||||
onchange=" if (this.value === '') { this.removeAttribute('name'); } else { this.name = 'roles[' + this.options[this.selectedIndex].getAttribute('data-role-id') + ']'; }">
|
||||
<option value=""
|
||||
data-role-id="none"
|
||||
{% if selected_role_id == 'none' %}selected="selected"{% endif %}>
|
||||
None
|
||||
</option>
|
||||
{% for role in cluster_roles %}
|
||||
<option value="on"
|
||||
data-role-id="{{ role.id }}"
|
||||
{% if role.id == selected_role_id %}selected="selected"{% endif %}>
|
||||
{{ role.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if allowed_to_edit %}
|
||||
<details>
|
||||
<summary>+ Rolle</summary>
|
||||
<form action="/admin/user/{{ user.id }}/add-role" method="post">
|
||||
<fieldset>
|
||||
<select name="role_id">
|
||||
{% for role in roles %}
|
||||
{% if not role.cluster and role not in user.proper_roles and not role.hide_in_lists %}
|
||||
<option value="{{ role.id }}">
|
||||
{% if role.formatted_name %}
|
||||
{{ role.formatted_name }}
|
||||
{% else %}
|
||||
{{ role.name }}
|
||||
{% endif %}
|
||||
{% if role.desc %}({{ role.desc }}){% endif %}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input value="Rolle hinzufügen" type="submit" class="btn btn-primary ml-1" />
|
||||
</fieldset>
|
||||
</form>
|
||||
</details>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if supposed_to_pay %}
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">💸-Beitrag</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
{% if fee %}
|
||||
<div>
|
||||
<strong>{{ fee.name }}</strong>
|
||||
<span class="block">{{ fee.sum_in_cents / 100 }}€</span>
|
||||
</div>
|
||||
<div>
|
||||
{% for p in fee.parts %}
|
||||
{{ p.0 }} ({{ p.1 / 100 }}€)
|
||||
{% if not loop.last %}+{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if "paid" in user.roles %}
|
||||
✅ bezahlt
|
||||
{% else %}
|
||||
❌ Zahlung ausständig
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if "paid" in user.roles %}
|
||||
✅ {{ member | keys }} hat schon bezahlt
|
||||
{% else %}
|
||||
❌
|
||||
{% for key, value in member %}
|
||||
{% if loop.first %}{{ key }}{% endif %}
|
||||
{% endfor %}
|
||||
hat noch nicht bezahlt
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Aktivität von und mit {{ user.name }}</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
<ul class="list-disc ms-4">
|
||||
<li>Passwort zurückgesetzt am/um X</li>
|
||||
<li>Am X beigetreten.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Ergo-Challenge</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
{{ macros::input(label='DOB', name='dob', type="text", value=user.dob, readonly=allowed_to_edit == false) }}
|
||||
{{ macros::input(label='Weight (kg)', name='weight', type="text", value=user.weight, readonly=allowed_to_edit == false) }}
|
||||
{{ macros::input(label='Sex', name='sex', type="text", value=user.sex, readonly=allowed_to_edit == false) }}
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">TODO</h2>
|
||||
<div class="border-t bg-white dark:bg-primary-900 py-3 px-4 relative">
|
||||
<span class="text-black dark:text-white cursor-pointer">
|
||||
<span class="font-bold">
|
||||
{{ user.name }}
|
||||
{% if not user.last_access and allowed_to_edit and user.mail %}
|
||||
<form action="/admin/user"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
class="inline">
|
||||
• <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"
|
||||
onclick="return confirm('Willst du wirklich das Willkommensmail an {{ user.name }} ausschicken?');">Willkommensmail verschicken</a>
|
||||
</form>
|
||||
{% endif %}
|
||||
</span>
|
||||
</span>
|
||||
<form action="/admin/user"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
class="w-full mt-2">
|
||||
{% 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"
|
||||
href="/admin/user/{{ user.id }}/reset-pw"
|
||||
onclick="return confirm('Willst du wirklich das Passwort zurücksetzen?');">Passwort zurücksetzen</a>
|
||||
{% endif %}
|
||||
<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">
|
||||
{% for cluster, cluster_roles in roles | group_by(attribute="cluster") %}
|
||||
<label for="cluster_{{ loop.index }}">{{ cluster }}</label>
|
||||
{# Determine the initially selected role within the cluster #}
|
||||
{% set_global selected_role_id = "none" %}
|
||||
{% for role in cluster_roles %}
|
||||
{% if selected_role_id == "none" and role.name in user.roles %}
|
||||
{% set_global selected_role_id = role.id %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{# Set default name to the selected role ID or first role if none selected #}
|
||||
<select id="cluster_{{ loop.index }}"
|
||||
{% if selected_role_id == 'none' %} {% else %} name="roles[{{ selected_role_id }}]" {% endif %}
|
||||
{% if allowed_to_edit == false %}disabled{% endif %}
|
||||
onchange=" if (this.value === '') { this.removeAttribute('name'); } else { this.name = 'roles[' + this.options[this.selectedIndex].getAttribute('data-role-id') + ']'; }">
|
||||
<option value=""
|
||||
data-role-id="none"
|
||||
{% if selected_role_id == 'none' %}selected="selected"{% endif %}>
|
||||
None
|
||||
</option>
|
||||
{% for role in cluster_roles %}
|
||||
<option value="on"
|
||||
data-role-id="{{ role.id }}"
|
||||
{% if role.id == selected_role_id %}selected="selected"{% endif %}>
|
||||
{{ role.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Ergo-Challenge</h2>
|
||||
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
|
||||
<div class="py-3">
|
||||
{{ macros::input(label='DOB', name='dob', type="text", value=user.dob, readonly=allowed_to_edit == false) }}
|
||||
{{ macros::input(label='Weight (kg)', name='weight', type="text", value=user.weight, readonly=allowed_to_edit == false) }}
|
||||
{{ macros::input(label='Sex', name='sex', type="text", value=user.sex, readonly=allowed_to_edit == false) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
@ -174,10 +174,9 @@ function setChoiceByLabel(choicesInstance, label) {
|
||||
{% if autofocus %}autofocus{% endif %}
|
||||
{% if accept %}accept="{{ accept }}"{% endif %}
|
||||
{% if pattern %}pattern="{{ pattern }}"{% endif %}
|
||||
{% if readonly %}readonly{% endif %}/>
|
||||
{% if readonly %}readonly{% endif %} />
|
||||
</div>
|
||||
{% endmacro input %}
|
||||
|
||||
{% macro inputgroup(label, name, type, required=false, class='', value='', min='', hide_label=false, id='', autofocus=false, wrapper_class='', pattern='', readonly=false, accept='') %}
|
||||
<div class="{{ wrapper_class }}">
|
||||
<label for="{{ name }}"
|
||||
@ -185,24 +184,28 @@ function setChoiceByLabel(choicesInstance, label) {
|
||||
{{ label }}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input {% if type=='datetime-local' %}onclick='if (!this.value) setCurrentdate(this)'{% endif %}
|
||||
{% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %}
|
||||
name="{{ name }}"
|
||||
type="{{ type }}"
|
||||
{% if required %}required{% endif %}
|
||||
value="{{ value }}"
|
||||
class="input {% if readonly %}rounded-md{% else %}rounded-l-md{% endif %} {{ class }}"
|
||||
placeholder="{% if hide_label %}{{ label }}{% endif %}"
|
||||
{% if min is defined %}min="{{ min }}"{% endif %}
|
||||
{% if autofocus %}autofocus{% endif %}
|
||||
{% if accept %}accept="{{ accept }}"{% endif %}
|
||||
{% if pattern %}pattern="{{ pattern }}"{% endif %}
|
||||
readonly/>
|
||||
{% if allowed_to_edit %}
|
||||
<button type="button" class="btn btn-dark rounded-l-none-important edit-js">{% include "includes/pencil" %}</button>
|
||||
<input value="x" type="reset" class="edit-js btn btn-alert btn-hidden rounded-none-important"/>
|
||||
<input value="💾" type="submit" class="btn btn-primary btn-hidden rounded-l-none-important" />
|
||||
{% endif %}
|
||||
<input {% if type=='datetime-local' %}onclick='if (!this.value) setCurrentdate(this)'{% endif %}
|
||||
{% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %}
|
||||
name="{{ name }}"
|
||||
type="{{ type }}"
|
||||
{% if required %}required{% endif %}
|
||||
value="{{ value }}"
|
||||
class="input {% if readonly %}rounded-md{% else %}rounded-l-md{% endif %} {{ class }}"
|
||||
placeholder="{% if hide_label %}{{ label }}{% endif %}"
|
||||
{% if min is defined %}min="{{ min }}"{% endif %}
|
||||
{% if autofocus %}autofocus{% endif %}
|
||||
{% if accept %}accept="{{ accept }}"{% endif %}
|
||||
{% if pattern %}pattern="{{ pattern }}"{% endif %}
|
||||
readonly />
|
||||
{% if allowed_to_edit %}
|
||||
<button type="button" class="btn btn-dark rounded-l-none-important edit-js">{% include "includes/pencil" %}</button>
|
||||
<input value="x"
|
||||
type="reset"
|
||||
class="edit-js btn btn-alert btn-hidden rounded-none-important" />
|
||||
<input value="💾"
|
||||
type="submit"
|
||||
class="btn btn-primary btn-hidden rounded-l-none-important" />
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro inputgroup %}
|
||||
@ -213,42 +216,45 @@ function setChoiceByLabel(choicesInstance, label) {
|
||||
{% set display = ["name"] %}
|
||||
{% endif %}
|
||||
<div class="input-group">
|
||||
<select name="{{ name }}"
|
||||
{% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %}
|
||||
class="input {% if readonly %}rounded-md{% else %}rounded-l-md{% endif %} {{ class }}"
|
||||
{% if required %}required="required"{% endif %}
|
||||
disabled>
|
||||
{% if default %}<option selected value>{{ default }}</option>{% endif %}
|
||||
{% if nonSelectableDefault %}<option disabled selected value>{{ nonSelectableDefault }}</option>{% endif %}
|
||||
{% for d in data %}
|
||||
<option value="{{ d.id }}"
|
||||
{% if only_ergo and d.id!=4 %}disabled{% endif %}
|
||||
{% if d.id == selected_id %}selected{% endif %}
|
||||
{% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data- {{ extra }}={{ d[extra] }} {% else %} {% if d[extra] %}disabled{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if show_seats %} data-custom-properties='{"amount_seats": {{ d["amount_seats"] }}, "owner": "{{ d["owner"] }}", "default_destination": "{{ d["default_destination"] }}", "boat_in_ottensheim": {{ d["location_id"] == 2 }}, "boat_reserved_today": {{ d["reserved_today"] }}, "convert_handoperated_possible": {{ d["convert_handoperated_possible"] }}, "default_handoperated": {{ d["default_shipmaster_only_steering"] }}}' {% endif %}>
|
||||
{% for displa in display -%}
|
||||
{%- if d[displa] -%}
|
||||
{{- d[displa] -}}
|
||||
{%- else -%}
|
||||
{{- displa -}}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% if new_last_entry %}<option value="-1">{{ new_last_entry }}</option>{% endif %}
|
||||
</select>
|
||||
{% if allowed_to_edit %}
|
||||
<button type="button" class="btn btn-dark rounded-l-none-important edit-js">{% include "includes/pencil" %}</button>
|
||||
<input value="x" type="reset" class="edit-js btn btn-alert btn-hidden rounded-none-important"/>
|
||||
<input value="💾" type="submit" class="btn btn-primary btn-hidden rounded-l-none-important" />
|
||||
{% endif %}
|
||||
<select name="{{ name }}"
|
||||
{% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %}
|
||||
class="input {% if readonly %}rounded-md{% else %}rounded-l-md{% endif %} {{ class }}"
|
||||
{% if required %}required="required"{% endif %}
|
||||
disabled>
|
||||
{% if default %}<option selected value>{{ default }}</option>{% endif %}
|
||||
{% if nonSelectableDefault %}<option disabled selected value>{{ nonSelectableDefault }}</option>{% endif %}
|
||||
{% for d in data %}
|
||||
<option value="{{ d.id }}"
|
||||
{% if only_ergo and d.id!=4 %}disabled{% endif %}
|
||||
{% if d.id == selected_id %}selected{% endif %}
|
||||
{% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data- {{ extra }}={{ d[extra] }} {% else %} {% if d[extra] %}disabled{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if show_seats %} data-custom-properties='{"amount_seats": {{ d["amount_seats"] }}, "owner": "{{ d["owner"] }}", "default_destination": "{{ d["default_destination"] }}", "boat_in_ottensheim": {{ d["location_id"] == 2 }}, "boat_reserved_today": {{ d["reserved_today"] }}, "convert_handoperated_possible": {{ d["convert_handoperated_possible"] }}, "default_handoperated": {{ d["default_shipmaster_only_steering"] }}}' {% endif %}>
|
||||
{% for displa in display -%}
|
||||
{%- if d[displa] -%}
|
||||
{{- d[displa] -}}
|
||||
{%- else -%}
|
||||
{{- displa -}}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% if new_last_entry %}<option value="-1">{{ new_last_entry }}</option>{% endif %}
|
||||
</select>
|
||||
{% if allowed_to_edit %}
|
||||
<button type="button" class="btn btn-dark rounded-l-none-important edit-js">{% include "includes/pencil" %}</button>
|
||||
<input value="x"
|
||||
type="reset"
|
||||
class="edit-js btn btn-alert btn-hidden rounded-none-important" />
|
||||
<input value="💾"
|
||||
type="submit"
|
||||
class="btn btn-primary btn-hidden rounded-l-none-important" />
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro selectgroup %}
|
||||
|
||||
{% macro checkbox(label, name, id='', checked=false, class='', disabled=false, readonly=false) %}
|
||||
<label for="{{ name }}{{ id }}"
|
||||
class="flex items-center cursor-pointer text-black dark:text-white hover:text-gray-900 dark:hover:text-gray-100 {{ class }}">
|
||||
|
Loading…
x
Reference in New Issue
Block a user