Confirmation page and minor improvements to homepage and form messages

Basic redirect with flash messages for success and error messages
This commit is contained in:
Alphonse Paix
2025-09-16 16:47:28 +02:00
parent f948728348
commit b736e2fe8d
12 changed files with 102 additions and 75 deletions

View File

@@ -7,7 +7,7 @@ block content %}
<div class="max-w-3xl">
<h1 class="text-4xl font-bold mb-4">zero2prod</h1>
<p class="text-xl text-blue-100 mb-6">
Welcome to my newsletter! Stay updated on my latest projects and
Welcome to our newsletter! Stay updated on our latest projects and
thoughts. Unsubscribe at any time.
</p>
<div class="flex flex-col sm:flex-row gap-4">
@@ -28,7 +28,6 @@ block content %}
</div>
</div>
<!-- Feature Cards -->
<div class="grid md:grid-cols-3 gap-6 mb-8">
<div class="bg-white rounded-lg shadow-md p-6 border border-gray-200">
<div
@@ -113,15 +112,10 @@ block content %}
<div class="max-w-2xl mx-auto text-center">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Stay updated</h2>
<p class="text-gray-600 mb-6">
Subscribe to my newsletter to get the latest updates.
Subscribe to our newsletter to get the latest updates.
</p>
<form
hx-post="/subscriptions"
hx-target="#subscription-result"
hx-swap="innerHTML"
class="max-w-md mx-auto"
>
<form action="/subscriptions" method="post" class="max-w-md mx-auto">
<div class="flex flex-col sm:flex-row gap-3">
<input
type="email"
@@ -139,7 +133,7 @@ block content %}
</div>
</form>
<div id="subscription-result" class="mt-4"></div>
<div class="mt-4">{{ message }}</div>
</div>
</div>
@@ -159,12 +153,12 @@ block content %}
</div>
</div>
<div>
<div class="text-2xl font-bold text-orange-600">0</div>
<div class="text-2xl font-bold text-green-600">0</div>
<div class="text-sm text-gray-600">email opened</div>
</div>
<div>
<div class="text-2xl font-bold text-purple-600">~1ms</div>
<div class="text-sm text-gray-600">response time</div>
<div class="text-2xl font-bold text-purple-600">3</div>
<div class="text-sm text-gray-600">issues delivered</div>
</div>
</div>
</div>