Added new pages
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<div>
|
||||
<form id="category-form" action="submit">
|
||||
<fieldset id="form-box-boundaries">
|
||||
<legend>CATEGORY FORM</legend>
|
||||
<div class="form-container form-left">
|
||||
<div id="form-state" class="warning"></div><br>
|
||||
|
||||
<label class="fullwidth-label" for="category-name">NAME</label>
|
||||
<input class="tui-input underline fullwidth" type="text" name="category-name" id="category-name"><br><br>
|
||||
|
||||
<label for="category-description">DESCRIPTION</label>
|
||||
<input
|
||||
class="tui-input underline fullwidth" type="text" name="category-description"
|
||||
id="category-description"><br><br>
|
||||
|
||||
<button
|
||||
class="subbutton"
|
||||
hx-post="/categories/new"
|
||||
hx-swap="none"
|
||||
type="submit"
|
||||
id="category-submit-button">CREATE</button>
|
||||
<br>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.body.addEventListener("wrongCredentials", function(evt) {
|
||||
var messageDiv = document.getElementById("login-state")
|
||||
messageDiv.innerHTML = evt.detail.value
|
||||
|
||||
setTimeout(() => {
|
||||
messageDiv.innerHTML = ""
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
// Add the spinner
|
||||
var btn = document.getElementById("login-submit-button");
|
||||
btn.addEventListener('htmx:beforeRequest', function (evt) {
|
||||
btn.classList.add("loading");
|
||||
spinner(btn)
|
||||
});
|
||||
|
||||
btn.addEventListener('htmx:afterRequest', function (evt) {
|
||||
btn.classList.remove("loading");
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user