Use HTML swap to display success and error messages

This commit is contained in:
Alphonse Paix
2025-09-17 03:40:23 +02:00
parent a3533bfde7
commit 7689628ffb
18 changed files with 134 additions and 232 deletions

View File

@@ -8,7 +8,10 @@
<p class="mt-2 text-sm text-gray-600">Sign in to access the admin dashboard.</p>
</div>
<div class="bg-white rounded-lg shadow-md p-8 border border-gray-200">
<form action="/login" method="post" class="space-y-6">
<form hx-post="/login"
hx-target="#login-messages"
hx-swap="innerHTML"
class="space-y-6">
<div>
<label for="username" class="block text-sm font-medium text-gray-700 mb-2">Username</label>
<input type="text"
@@ -31,8 +34,8 @@
Continue
</button>
</div>
<div id="login-messages" class="mt-4"></div>
</form>
<div class="mt-4 text-center">{{ error }}</div>
</div>
<div class="text-center">
<a href="/"