continued
implemented HTMX implemented ORM (sequelize)
This commit is contained in:
parent
2a9bd4e81b
commit
d756a192e4
71 changed files with 3822 additions and 694 deletions
106
views/htmx/admin/editUser.njk
Normal file
106
views/htmx/admin/editUser.njk
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<div class="flex flex-col gap-8 w-full">
|
||||
<form class="card flex flex-col gap-6 p-12" hx-post="/htmx/admin/groups/{{ group.id }}" hx-target="#admin-group-section">
|
||||
<div class="w-full flex flex-row justify-between items-center">
|
||||
<span class="text-2xl font-thin">
|
||||
edit User {{ user.username }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-col gap-8">
|
||||
<div class="flex flex-row align-center gap-4">
|
||||
<div class="flex flex-col w-1/2 gap-3">
|
||||
<label for="username" class="w-full text-sm font-medium">
|
||||
Username
|
||||
</label>
|
||||
<input type="text" name="username" placeholder="Username" value="{{ user.username }}">
|
||||
</div>
|
||||
<div class="flex flex-col w-1/2 gap-3">
|
||||
<label for="uidnumber" class="w-full text-sm font-medium">
|
||||
User ID
|
||||
</label>
|
||||
<input type="number" name="uidnumber" placeholder="1000" value="{{ user.uidnumber }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row align-center gap-4">
|
||||
<div class="flex flex-col w-1/2 gap-3">
|
||||
<label for="firstName" class="w-full text-sm font-medium">
|
||||
First Name
|
||||
</label>
|
||||
<input type="text" name="firstName" class="" placeholder="John" value="{{ user.firstName }}">
|
||||
</div>
|
||||
<div class="flex flex-col w-1/2 gap-3">
|
||||
<label for="lastName" class="w-full text-sm font-medium">
|
||||
Last Name
|
||||
</label>
|
||||
<input type="text" name="lastName" class="" placeholder="Doe" value="{{ user.lastName }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row align-center gap-4">
|
||||
<div class="flex flex-col w-1/2 gap-3">
|
||||
<label for="username" class="w-full text-sm font-medium">
|
||||
Primary Group
|
||||
</label>
|
||||
<select name="primaryGroup" class="">
|
||||
{% for group in groupList %}
|
||||
<option value="{{ group.gidnumber }}" {% if group.isPrimaryGroup %}selected{% endif %}>{{ group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-col w-1/2 gap-3">
|
||||
<label for="mail" class="w-full text-sm font-medium">
|
||||
Mail Address
|
||||
</label>
|
||||
<input type="text" name="mail" class="" placeholder="john@doe.com" value="{{ user.mail }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex w-full justify-end gap-4">
|
||||
<a href="#" class="button-sm"
|
||||
hx-get="/htmx/admin/users/table"
|
||||
hx-target="#admin-user-section">
|
||||
<i class="ti ti-arrow-left"></i>
|
||||
Back
|
||||
</a>
|
||||
<button type="button" class="button-sm primary-fill">
|
||||
<i class="ti ti-device-floppy"></i>
|
||||
Save Changes
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="card flex flex-col w-full">
|
||||
<div class="w-full flex flex-row justify-between items-center py-5 px-8">
|
||||
<span class="text-2xl font-thin">
|
||||
manage Groups for {{ user.username }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="table grid-cols-[min-content_1fr_min-content]">
|
||||
<!-- Table Header -->
|
||||
<div class="thead font-bold py-2 border-b">
|
||||
<div>GID</div>
|
||||
<div>Name</div>
|
||||
<div>Actions</div>
|
||||
</div>
|
||||
{% for group in groupList %}
|
||||
<!-- Table Row -->
|
||||
<div class="trow py-2 border-b">
|
||||
<div>{{ group.gidnumber }}</div>
|
||||
<div>{{ group.name }}</div>
|
||||
<div class="flex flex-row justify-end align-center gap-4">
|
||||
{% if not group.isPrimaryGroup and not group.isOtherGroup %}
|
||||
<a href="#" class="button-sm text-xs hover:underline success-fill whitespace-nowrap"
|
||||
hx-get="/htmx/admin/groups/{{ group.id }}"
|
||||
hx-target="#admin-group-section">
|
||||
<i class="ti ti-user-plus"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="#" class="button-sm text-xs hover:underline danger-fill whitespace-nowrap"
|
||||
hx-get="/htmx/admin/groups/{{ group.id }}"
|
||||
hx-target="#admin-group-section">
|
||||
<i class="ti ti-user-minus"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue