mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
resetbutton & almanach edit start
This commit is contained in:
@@ -14,42 +14,54 @@
|
||||
|
||||
<div class="flex container-normal mx-auto px-8 mt-4">
|
||||
<div class="flex-col max-w-2xl w-full">
|
||||
<form class="w-full grid grid-cols-3 gap-4" id="changeuserform" x-target="changeuserform footer" hx-boost="false" method="POST" x-data="{ openpw: false }">
|
||||
<form
|
||||
class="w-full flex flex-col gap-4 dbform"
|
||||
id="changeuserform"
|
||||
x-target="changeuserform
|
||||
footer"
|
||||
hx-boost="false"
|
||||
method="POST"
|
||||
x-data="{ openpw: false }"
|
||||
@rbichange="FormHasChanged($el) ? resetb.classList.add('hidden') : resetb.classList.remove('hidden')">
|
||||
<!-- INFO: MESSAGES -->
|
||||
<div class="col-span-3">
|
||||
{{ template "_usermessage" $model }}
|
||||
</div>
|
||||
<div
|
||||
class="rounded-xs col-span-3 border-2 border-transparent px-3
|
||||
py-1 pb-1.5 border-l-2 focus-within:border-l-slate-600
|
||||
bg-slate-200 focus-within:bg-slate-100 transition-all duration-100">
|
||||
<label for="username" class="text-sm text-gray-700 font-bold"> Name <i class="ri-text"></i> </label>
|
||||
<input type="text" name="name" id="name" class="mt-1 block w-full focus:border-none focus:outline-none" placeholder="" required autocomplete="off" value="{{ $model.user.Name }}" autofocus />
|
||||
|
||||
<!-- INFO: BASIC FELDER -->
|
||||
<div class="inputwrapper">
|
||||
<label for="username" class="inputlabel"> Name <i class="ri-text"></i> </label>
|
||||
<div class="flex flex-row">
|
||||
<input type="text" name="name" id="name" class="inputinput" placeholder="" required autocomplete="off" value="{{ $model.user.Name }}" autofocus />
|
||||
<reset-button controls="name" wrapper-class="inputwrapper" modified-class-suffix="modified"></reset-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="rounded-xs col-span-3 border-2 border-transparent px-3
|
||||
py-1 pb-1.5 border-l-2 focus-within:border-l-slate-600
|
||||
bg-slate-200 focus-within:bg-slate-100 transition-all duration-100">
|
||||
<label for="username" class="text-sm text-gray-700 font-bold"> E-Mail <i class="ri-at-line"></i> </label>
|
||||
<input type="email" name="username" id="username" autocomplete="off" class="mt-1 block w-full rounded-md focus:border-none focus:outline-none" placeholder="" required value="{{ $model.user.Email }}" />
|
||||
<div class="inputwrapper">
|
||||
<label for="username" class="inputlabel"> E-Mail <i class="ri-at-line"></i> </label>
|
||||
<div class="flex flex-row">
|
||||
<input type="email" name="username" id="username" autocomplete="off" class="inputinput" placeholder="" required value="{{ $model.user.Email }}" />
|
||||
<reset-button controls="username" wrapper-class="inputwrapper" modified-class-suffix="modified"></reset-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="rounded-xs col-span-3 border-2 border-transparent px-3
|
||||
py-1 pb-1.5 border-l-2 focus-within:border-l-slate-600
|
||||
bg-slate-200 focus-within:bg-slate-100 transition-all duration-100">
|
||||
<label for="role" class="text-sm text-gray-700 font-bold"> Rolle <i class="ri-user-3-line"></i> </label>
|
||||
<select
|
||||
{{ if not (eq $model.request.user.Role "Admin") -}}
|
||||
disabled
|
||||
{{- end }}
|
||||
name="role"
|
||||
id="role"
|
||||
autocomplete="off"
|
||||
class="mt-1 block w-full rounded-md focus:border-none focus:outline-none
|
||||
disabled:opacity-50">
|
||||
<option value="User" {{ if eq $model.user.Role "User" }}selected{{ end }}>Benutzer</option>
|
||||
<option value="Editor" {{ if eq $model.user.Role "Editor" }}selected{{ end }}>Redakteur</option>
|
||||
<option value="Admin" {{ if eq $model.user.Role "Admin" }}selected{{ end }}>Administrator</option>
|
||||
</select>
|
||||
|
||||
<!-- INFO: ROLLE -->
|
||||
<div class="inputwrapper">
|
||||
<label for="role" class="inputlabel"> Rolle <i class="ri-user-3-line"></i> </label>
|
||||
<div class="flex flex-row">
|
||||
<select
|
||||
{{ if not (eq $model.request.user.Role "Admin") -}}
|
||||
disabled
|
||||
{{- end }}
|
||||
name="role"
|
||||
id="role"
|
||||
autocomplete="off"
|
||||
class="inputselect">
|
||||
<option value="User" {{ if eq $model.user.Role "User" }}selected{{ end }}>Benutzer</option>
|
||||
<option value="Editor" {{ if eq $model.user.Role "Editor" }}selected{{ end }}>Redakteur</option>
|
||||
<option value="Admin" {{ if eq $model.user.Role "Admin" }}selected{{ end }}>Administrator</option>
|
||||
</select>
|
||||
<reset-button controls="role" wrapper-class="inputwrapper" modified-class-suffix="modified"></reset-button>
|
||||
</div>
|
||||
</div>
|
||||
{{- if and
|
||||
(eq $model.request.user.Role "Admin")
|
||||
@@ -70,63 +82,49 @@
|
||||
<p class="text-sm text-gray-700 max-w-[80ch]">Achtung! Wenn Sie die Rolle eines Benutzers ändern, wird dieser unter Umständen von laufenden Sitzungen abgemeldet und muss sich erneut anmelden.</p>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- INFO: PW ÄNDERN AUSKLAPPEN -->
|
||||
<div class="col-span-3">
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" name="openpw" id="openpw" x-model="openpw" class="mr-2" />
|
||||
<label for="openpw" class="text-sm text-gray-700 font-bold"> Passwort ändern <i class="ri-key-2-line"></i> </label>
|
||||
<label for="openpw" class="inputlabeltext"> Passwort ändern <i class="ri-key-2-line"></i> </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- INFO: PASSWORT -->
|
||||
{{- if not (eq $model.request.user.Role "Admin") -}}
|
||||
<div
|
||||
x-bind:style="!openpw ? 'display:none' : ''"
|
||||
class="rounded-xs col-span-3 border-2 border-transparent px-3
|
||||
py-1 pb-1.5 border-l-2 focus-within:border-l-slate-600
|
||||
bg-slate-200 focus-within:bg-slate-100 transition-all duration-100">
|
||||
<label for="password_old" class="text-sm text-gray-700 font-bold"> Altes Passwort </label>
|
||||
<input x-bind:type="openpw ? 'password' : 'hidden'" name="password_old" id="password_old" class="mt-1 block w-full rounded-md focus:border-none focus:outline-none" placeholder="" required />
|
||||
<div x-bind:style="!openpw ? 'display:none' : ''" class="inputwrapper">
|
||||
<label for="password_old" class="inputlabel"> Altes Passwort </label>
|
||||
<input x-bind:type="openpw ? 'password' : 'hidden'" name="password_old" id="password_old" class="inputinput" placeholder="" required />
|
||||
</div>
|
||||
{{- end -}}
|
||||
<div
|
||||
x-bind:style="!openpw ? 'display:none' : ''"
|
||||
class="rounded-xs col-span-3 border-2 border-transparent px-3
|
||||
py-1 pb-1.5 border-l-2 focus-within:border-l-slate-600
|
||||
bg-slate-200 focus-within:bg-slate-100 transition-all duration-100">
|
||||
<label for="password" class="text-sm text-gray-700 font-bold"> Neues Passwort </label>
|
||||
<input x-bind:type="openpw ? 'password' : 'hidden'" minlength="10" name="password" id="password" class="mt-1 block w-full rounded-md focus:border-none focus:outline-none" placeholder="" required />
|
||||
<div x-bind:style="!openpw ? 'display:none' : ''" class="inputwrapper">
|
||||
<label for="password" class="inputlabel"> Neues Passwort </label>
|
||||
<input x-bind:type="openpw ? 'password' : 'hidden'" minlength="10" name="password" id="password" class="inputinput" placeholder="" required />
|
||||
</div>
|
||||
<div
|
||||
x-bind:style="!openpw ? 'display:none' : ''"
|
||||
class="rounded-xs col-span-3 border-2 border-transparent px-3
|
||||
py-1 pb-1.5 border-l-2 focus-within:border-l-slate-600
|
||||
bg-slate-200 focus-within:bg-slate-100 transition-all duration-100">
|
||||
<label for="password_repeat" class="text-sm text-gray-700 font-bold"> Passwort wiederholen </label>
|
||||
<input x-bind:type="openpw ? 'password' : 'hidden'" minlength="10" name="password_repeat" id="password_repeat" class="mt-1 block w-full rounded-md focus:border-none focus:outline-none" placeholder="" required />
|
||||
<div x-bind:style="!openpw ? 'display:none' : ''" class="inputwrapper">
|
||||
<label for="password_repeat" class="inputlabel"> Passwort wiederholen </label>
|
||||
<input x-bind:type="openpw ? 'password' : 'hidden'" minlength="10" name="password_repeat" id="password_repeat" class="inputinput" placeholder="" required />
|
||||
</div>
|
||||
<div class="col-span-3 flex justify-end" x-bind:style="!openpw ? 'display:none' : ''">
|
||||
<input type="checkbox" name="logout" id="logout" class="mr-2" x-bind:style="!openpw ? 'display:none' : ''" />
|
||||
<label for="logout" class="text-sm text-gray-700 font-bold"> überall ausloggen <i class="ri-logout-box-line"></i> </label>
|
||||
<label for="logout" class="inputlabeltext"><i class="ri-logout-box-line"></i> überall ausloggen</label>
|
||||
</div>
|
||||
<div class="col-span-1 col-start-2">
|
||||
<a
|
||||
href="/user/{{ $model.user.Id }}/edit?redirectTo={{ $model.redirect_url }}"
|
||||
type="cancel"
|
||||
class="w-full inline-flex justify-center py-2 px-4 border border-transparent rounded-md text-sm font-medium text-gray-800 bg-stone-200 hover:bg-stone-300 cursor-pointer focus:outline-none
|
||||
focus:ring-2 focus:ring-offset-2 focus:ring-slate-500 no-underline">
|
||||
Zurücksetzen
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-span-1 col-start-3">
|
||||
<input type="hidden" name="csrf_token" id="csrf_token" required value="{{ $model.csrf_token }}" />
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full inline-flex justify-center py-2 px-4 border border-transparent rounded-md
|
||||
shadow-sm text-sm font-medium text-white bg-slate-700 hover:bg-slate-800 cursor-pointer focus:outline-none
|
||||
focus:ring-2 focus:ring-offset-2 focus:ring-slate-500">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
<!-- INFO: Buttons -->
|
||||
<div class="grid grid-cols-3 gap-4 col-span-3 mt-6">
|
||||
<div id="resetb" class="col-span-1 col-start-2 hidden">
|
||||
<a href="/user/{{ $model.user.Id }}/edit?redirectTo={{ $model.redirect_url }}" type="cancel" class="resetbutton"> Zurücksetzen </a>
|
||||
</div>
|
||||
<div class="col-span-1 col-start-3">
|
||||
<input type="hidden" name="csrf_token" id="csrf_token" required value="{{ $model.csrf_token }}" />
|
||||
<button type="submit" class="submitbutton">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- INFO: Aktivieren/Deaktivieren -->
|
||||
<div class="col-span-1 mt-12 justify-self-end self-end items-end flex flex-row justify-end">
|
||||
{{ if not $model.user.Deactivated }}
|
||||
<form id="actbtn" x-init @ajax:before="confirm('Der Benutzer {{ $model.user.Name }} wird deaktiviert und kann sich nicht mehr einloggen. Sicher?') || $event.preventDefault()" action="/user/{{ $model.user.Id }}/deactivate/" method="POST" hx-boost="false" x-target="user-message footer actbtn" x-target.away="_top">
|
||||
|
||||
Reference in New Issue
Block a user