feat: Reorganizing views

This commit is contained in:
2025-01-08 18:10:26 -05:00
parent f5dbd7e121
commit e414afd95b
20 changed files with 55 additions and 61 deletions

View File

@@ -0,0 +1,40 @@
#extend("htmx-form", htmxForm):
#export("formBody"):
<input type="text"
id="username"
name="username"
placeholder="Username"
autofocus
required
>
<br>
#if(context.showEmailInput):
<input type="email"
id="email"
name="email"
placeholder="Email"
required
>
<br>
#endif
<input type="password"
id="password"
name="password"
placeholder="Password"
autofocus
required
>
<br>
#if(context.showConfirmPassword):
<input type="password"
id="confirmPassword"
name="confirmPassword"
placeholder="Confirm Password"
autofocus
required
>
<br>
#endif
<input type="submit" value="#(context.buttonLabel)">
#endexport
#endextend

View File

@@ -0,0 +1,14 @@
#extend("home"):
#export("homeContent"):
<div id="home-content" class="container">
<div class="container">
<h1>Users</h1>
<br>
<p>Users are people that can login and generate puchase orders for employees.</p>
<br>
</div>
#extend("users/form", form)
#extend("users/table")
</div>
#endexport
#endextend

View File

@@ -0,0 +1,23 @@
<table id="user-table">
<tr>
<th>Username</th>
<th>Email</th>
<th></th>
</tr>
#for(user in users):
<tr id="user_#(user.id)">
<td>#(user.username)</td>
<td>#(user.email)</td>
<td style="width: 60px;">
<a class="btn btn-delete"
hx-delete="/users/#(user.id)"
hx-target="#user-table"
hx-swap="outerHTML"
hx-confirm="Are you sure you want to delete this user?"
>
<img src="images/trash-can.svg" alt="Delete">
</a>
</td>
</tr>
#endfor
</table>