2025-03-13 08:25:39 +01:00
|
|
|
package templates
|
|
|
|
|
|
|
|
templ Login() {
|
|
|
|
<div class="container">
|
2025-03-15 01:49:52 +01:00
|
|
|
<h2>Connection</h2>
|
2025-03-13 08:25:39 +01:00
|
|
|
<form hx-post="/api/login" hx-target-error="#loginError" id="loginForm">
|
|
|
|
<div hx-trigger="changed" id="loginError"></div>
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="email" class="form-label">Email Address</label>
|
2025-03-15 01:49:52 +01:00
|
|
|
<input name="email" class="form-control" type="email" id="email" required>
|
2025-03-13 08:25:39 +01:00
|
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="password" class="form-label">Password</label>
|
2025-03-15 01:49:52 +01:00
|
|
|
<input name="password" class="form-control" type="password" id="password" required>
|
2025-03-13 08:25:39 +01:00
|
|
|
</div>
|
2025-03-15 01:49:52 +01:00
|
|
|
<button class="btn btn-primary" type="submit">Connect</button>
|
2025-03-13 08:25:39 +01:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
document.getElementById('loginForm').addEventListener('htmx:afterRequest', function (ev) {
|
|
|
|
if (ev.detail.successful) {
|
|
|
|
window.location.href = '/'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</div>
|
|
|
|
}
|