Files

43 lines
2.7 KiB
HTML

<div class="container" id="content">
<div id="float" class="float" style="display: block;">
<div class="btn-row">
<button class="btn-close" onclick="toggleContent('float');" hx-get="/vendors" hx-push-url="true" hx-target="body" hx-swap="outerHTML">x</button>
</div>
<form id="vendor-form" hx-put="/vendors/00000000-0000-0000-0000-000000000000" hx-target="#content" hx-swap="outerHTML">
<div class="row">
<input type="text" class="col-9" id="vendor-name" name="name" value="Test" placeholder="Vendor Name" hx-put="/vendors/00000000-0000-0000-0000-000000000000" hx-trigger="keyup changed delay:500ms" required>
<button class="danger" style="font-size: 1.25em; padding: 10px 20px; border-radius: 10px;" hx-delete="/api/v1/vendors/00000000-0000-0000-0000-000000000000" hx-confirm="Are you sure you want to delete this vendor?" hx-target="#vendor-00000000-0000-0000-0000-000000000000" hx-swap="outerHTML transition:true swap:1s" hx-on::after-request="if(event.detail.successful) toggleContent('float'); window.location.href='/vendors';">Delete</button>
<button type="submit" class="btn-primary" style="float: right">Update</button>
</div>
</form>
<h2 style="margin-left: 20px; font-size: 1.5em;" class="label">Branches</h2>
<form id="branch-form" hx-post="/vendors/branches" hx-target="#branch-list" hx-swap="beforeend" hx-on::after-request="if(event.detail.successful) this.reset();">
<input type="hidden" name="vendorID" value="00000000-0000-0000-0000-000000000000">
<input type="text" class="col-9" name="name" placeholder="Add branch..." required hx-trigger="keyup changed delay:800ms">
<button type="submit" class="btn-secondary" style="float: right; padding: 10px 50px;" hx-target="#branch-list" hx-swap="beforeend">+</button>
</form>
<div hx-get="/vendors/branches?vendorID=00000000-0000-0000-0000-000000000000" hx-target="this" hx-indicator=".hx-indicator" hx-trigger="revealed">
<img src="/images/spinner.svg" width="30" height="30" class="hx-indicator">
</div>
</div>
<table>
<thead>
<tr>
<th>Name</th>
<th>Branches</th>
<th style="width: 100px;">
<button class="btn btn-add" style="padding: 0px 10px;" hx-get="/vendors/create" hx-target="#float" hx-swap="outerHTML">+</button>
</th>
</tr>
</thead>
<tbody id="vendor-table">
<tr id="vendor-00000000-0000-0000-0000-000000000000">
<td>Test</td>
<td>(0) Branches</td>
<td>
<button class="btn-detail" style="padding-left: 15px;" hx-get="/vendors/00000000-0000-0000-0000-000000000000" hx-target="#float" hx-push-url="true" hx-swap="outerHTML"></button>
</td>
</tr>
</tbody>
</table>
</div>