feat: Reorganizing views
This commit is contained in:
40
Resources/Views/users/form.leaf
Normal file
40
Resources/Views/users/form.leaf
Normal 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
|
||||
14
Resources/Views/users/index.leaf
Normal file
14
Resources/Views/users/index.leaf
Normal 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
|
||||
23
Resources/Views/users/table.leaf
Normal file
23
Resources/Views/users/table.leaf
Normal 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>
|
||||
Reference in New Issue
Block a user