feat: Moves employee views to their own controller, updates css, and employee table view.

This commit is contained in:
2025-01-07 17:07:37 -05:00
parent 08a0a8e1a3
commit 6eb723a7cf
11 changed files with 215 additions and 81 deletions

View File

@@ -0,0 +1,45 @@
<form class="employee-form"
id="employee-form"
#if(employee.id):
hx-put="/employees/#(employee.id)"
#else:
hx-post="/employees"
#endif
#if(employee.id):
hx-target="#home-content"
#else:
hx-target="#employee-table"
#endif
#if(oob):
hx-swap-oob="outerHTML"
#endif
>
<label for="firstName">First Name</label>
<input type="text"
id="firstName"
name="firstName"
placeholder="First Name"
autofocus
required
#if(employee.firstName): value=#(employee.firstName) #endif
>
<br>
<label for="lastName">Last Name</label>
<input type="text"
id="lastName"
name="lastName"
placeholder="Last Name"
required
#if(employee.lastName): value=#(employee.lastName) #endif
>
<br>
<input type="submit" value=#if(employee.id): Update #else: Create #endif>
#if(employee.id):
<button hx-get="/employees/form"
hx-target="#employee-form"
hx-swap="outerHTML"
>
Reset
</button>
#endif
</form>