Frontend fixes
Some checks failed
Rust / Test (push) Has been cancelled
Rust / Rustfmt (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Code coverage (push) Has been cancelled

This commit is contained in:
Alphonse Paix
2025-09-23 02:36:44 +02:00
parent ab650fdd35
commit bcb5ada8ef
5 changed files with 18 additions and 33 deletions

File diff suppressed because one or more lines are too long

View File

@@ -81,15 +81,15 @@ pub async fn send_unsubscribe_email(
base_url, unsubscribe_token base_url, unsubscribe_token
); );
let html_content = format!( let html_content = format!(
"You've requested to unsubscribe from my emails. To confirm, please click the link below:<br />\ r#"You've requested to unsubscribe from the newsletter. To confirm, please click the link below:<br />
<a href=\"{}\">Confirm unsubscribe</a><br />\ <a href="{}">Confirm unsubscribe</a><br />
If you did not request this, you can safely ignore this email.", If you did not request this, you can safely ignore this email."#,
confirmation_link confirmation_link
); );
let text_content = format!( let text_content = format!(
"You've requested to unsubscribe from my emails. To confirm, please follow the link below:\ r#"You've requested to unsubscribe from the newsletter. To confirm, please follow the link below:
{}\ {}
If you did not request this, you can safely ignore this email.", If you did not request this, you can safely ignore this email."#,
confirmation_link confirmation_link
); );
email_client email_client

View File

@@ -17,7 +17,7 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center h-16"> <div class="flex justify-between items-center h-16">
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
<div class="flex items-center space-x-2 group"> <a href="/" class="flex items-center space-x-2 group">
<div class="w-6 h-6 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-xl flex items-center justify-center shadow-lg group-hover:shadow-xl transition-all duration-200"> <div class="w-6 h-6 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-xl flex items-center justify-center shadow-lg group-hover:shadow-xl transition-all duration-200">
<svg class="w-4 h-4 text-white group-hover:scale-110 transition-transform duration-200" <svg class="w-4 h-4 text-white group-hover:scale-110 transition-transform duration-200"
fill="none" fill="none"
@@ -29,13 +29,8 @@
<span class="text-sm font-bold bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent"> <span class="text-sm font-bold bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent">
zero2prod zero2prod
</span> </span>
</div> </a>
<nav class="hidden md:flex items-center"> <nav class="hidden md:flex items-center">
<a href="/"
class="text-gray-700 hover:text-blue-600 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 relative group">
Home
<span class="absolute inset-x-4 bottom-0 h-0.5 bg-blue-600 scale-x-0 group-hover:scale-x-100 transition-transform duration-200"></span>
</a>
<a href="/posts" <a href="/posts"
class="text-gray-700 hover:text-blue-600 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 relative group"> class="text-gray-700 hover:text-blue-600 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 relative group">
Posts Posts
@@ -47,7 +42,7 @@
<a href="/admin/dashboard" <a href="/admin/dashboard"
hx-boost="true" hx-boost="true"
class="hidden md:flex bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 shadow-md hover:shadow-lg transform hover:scale-105"> class="hidden md:flex bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200 shadow-md hover:shadow-lg transform hover:scale-105">
dashboard Dashboard
</a> </a>
<button class="md:hidden p-2 text-gray-700 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors duration-200" <button class="md:hidden p-2 text-gray-700 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors duration-200"
onclick="toggleMobileMenu()"> onclick="toggleMobileMenu()">
@@ -60,10 +55,6 @@
<div id="mobile-menu" <div id="mobile-menu"
class="hidden md:hidden border-t border-gray-100 pb-4 pt-4"> class="hidden md:hidden border-t border-gray-100 pb-4 pt-4">
<nav class="flex flex-col space-y-2"> <nav class="flex flex-col space-y-2">
<a href="/"
class="text-gray-700 hover:text-blue-600 hover:bg-blue-50 px-4 py-2 rounded-lg text-sm font-medium transition-colors duration-200">
Home
</a>
<a href="/posts" <a href="/posts"
class="text-gray-700 hover:text-blue-600 hover:bg-blue-50 px-4 py-2 rounded-lg text-sm font-medium transition-colors duration-200"> class="text-gray-700 hover:text-blue-600 hover:bg-blue-50 px-4 py-2 rounded-lg text-sm font-medium transition-colors duration-200">
Posts Posts

View File

@@ -10,7 +10,9 @@
fill="none" fill="none"
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke="currentColor"> stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" opacity="0.7" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 11h10M7 14h6" opacity="0.3" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l8 8M16 8l-8 8" stroke="#dc2626" opacity="0.8" />
</svg> </svg>
</div> </div>
<h1 class="text-2xl font-bold text-gray-900 mb-2">Unsubscribe</h1> <h1 class="text-2xl font-bold text-gray-900 mb-2">Unsubscribe</h1>
@@ -29,7 +31,7 @@
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-orange-500 transition-colors"> class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-orange-500 transition-colors">
</div> </div>
<div class="bg-amber-50 border border-amber-200 rounded-lg p-4"> <div class="bg-amber-50 border border-amber-200 rounded-lg p-4">
<div class="flex"> <div class="flex items-center">
<svg class="w-5 h-5 text-amber-600 mt-0.5 mr-2 flex-shrink-0" <svg class="w-5 h-5 text-amber-600 mt-0.5 mr-2 flex-shrink-0"
fill="none" fill="none"
viewBox="0 0 24 24" viewBox="0 0 24 24"
@@ -37,20 +39,12 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg> </svg>
<div class="text-sm text-amber-800"> <div class="text-sm text-amber-800">
<p> <p>You will receive an email with an unsubscribe link.</p>
You will receive an email with an unsubscribe link. Alternatively, you can click the 'Unsubscribe' link in any of our newsletter emails.
</p>
</div> </div>
</div> </div>
</div> </div>
<button type="submit" <button type="submit"
class="w-full bg-orange-600 text-white hover:bg-orange-700 font-medium py-3 px-4 rounded-md transition-colors flex items-center justify-center"> class="w-full bg-orange-600 text-white hover:bg-orange-700 font-medium py-3 px-4 rounded-md transition-colors flex items-center justify-center">
<svg class="w-4 h-4 mr-2"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
</svg>
Unsubscribe Unsubscribe
</button> </button>
<div id="unsubscribe-messages" class="mt-4"></div> <div id="unsubscribe-messages" class="mt-4"></div>

View File

@@ -12,10 +12,10 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z" />
</svg> </svg>
</div> </div>
<h1 class="text-4xl font-bold text-gray-800 mb-4">Good bye, friend!</h1> <h1 class="text-4xl font-bold text-gray-800 mb-4">Good bye, friend.</h1>
<h2 class="text-xl font-medium text-gray-600 mb-6">You've successfully unsubscribed</h2> <h2 class="text-xl font-medium text-gray-600 mb-6">Unsubscription was successfull!</h2>
<p class="text-gray-600 mb-8 max-w-2xl mx-auto"> <p class="text-gray-600 mb-8 max-w-2xl mx-auto">
Your email has been removed from the database. You won't receive emails anymore. If you change your mind, you are welcome back any time! Your email has been removed from the database. If you change your mind, you are welcome back any time!
</p> </p>
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center"> <div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
<a href="/" <a href="/"