Files

22 lines
1.5 KiB
HTML

<div id="float" class="float" style="display: block;">
<div class="btn-row">
<button class="btn-close" onclick="toggleContent('float'); window.location.href='/employees';">x</button>
</div>
<form hx-put="/employees/00000000-0000-0000-0000-000000000000" hx-target="#employee-00000000-0000-0000-0000-000000000000" hx-swap="outerHTML transition:true swap:0.5s" hx-on::after-request="if(event.detail.successful) toggleContent('float'); window.location.href='/employees';">
<div class="row">
<input type="text" class="col-5" name="firstName" value="Testy" placeholder="First Name" required>
<div class="col-2"></div>
<input type="text" class="col-5" name="lastName" value="McTestface" placeholder="Last Name" required>
</div>
<div class="row" style="margin: 20px; float: left;">
<label for="active" style="margin-right: 15px;">
<h2>Active</h2></label>
<input type="checkbox" id="active" name="active" checked>
</div>
<div class="btn-row">
<button type="submit" class="btn-primary">Update</button>
<button class="danger" hx-confirm="Are you sure you want to delete this employee?" hx-delete="/api/v1/employees/00000000-0000-0000-0000-000000000000" hx-target="#employee-00000000-0000-0000-0000-000000000000" hx-swap="outerHTML transition:true swap:1s">Delete</button>
</div>
</form>
<h3><i><span class="primary" style="padding-right: 15px;">Note:</span><span class="secondary">It is better to mark an employee as in-active instead of deleting them.</span></i></h3>
</div>