From 14cac6177f73d2c79090fe6b9c3d5ba4a4ff9e04 Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Sat, 5 Apr 2025 20:20:50 -0500 Subject: [PATCH 1/5] add: newsletter html template for sending emails --- templates/template.html | 98 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 templates/template.html diff --git a/templates/template.html b/templates/template.html new file mode 100644 index 0000000..fe55e32 --- /dev/null +++ b/templates/template.html @@ -0,0 +1,98 @@ + + + +
+

🚀 RideAware Development Update

+

Dear RideAware Community,

+

We’re excited to share the latest updates on the development of the RideAware platform! Over the past few weeks, we’ve been hard at work implementing new features, improving the backend infrastructure, and enhancing the user experience. Here’s a summary of what we’ve accomplished:

+ +

🔒 User Authentication and Security

+ + +

👤 User Profiles

+ + +

🛠 Backend Improvements

+ + +

🌐 Frontend Enhancements

+ + +

📧 Newsletter System

+ + +

🎯 What’s Next?

+

Looking ahead, we’re planning to:

+ + +

💡 Get Involved

+

We’re proud to share that the RideAware platform is open source! If you’re a developer or enthusiast, you can view the codebase, contribute to the project, or provide feedback. Check out the repository here: RideAware GitHub.

+ +

Thank you for your continued support as we build RideAware into a platform that empowers cyclists and fosters a connected community. Stay tuned for more updates!

+ +

Best regards,

+

The RideAware Development Team 🚴‍♂️

+
+ From 8e5cce42942202c05ff7c4bbe030d954bdee81d6 Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Sat, 5 Apr 2025 20:21:29 -0500 Subject: [PATCH 2/5] feat: changed confirmation email from txt to html --- server.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server.py b/server.py index 143f4d8..a5534eb 100644 --- a/server.py +++ b/server.py @@ -16,15 +16,16 @@ def send_confirmation_email(email): SMTP_USER = os.getenv('SMTP_USER') SMTP_PASSWORD = os.getenv('SMTP_PASSWORD') - # Create the message for the unsubscribe_link = f"{request.url_root}unsubscribe?email={email}" + subject = 'Thanks for subscribing!' - body = ("Thanks for subscribing!\n\n" - "We're excited to share our journey with you.\n\n" - f"If you ever wish to unsubscribe, please click here." + + html_body = render_template( + 'confirmation_email.html', + unsubscribe_link=unsubscribe_link ) - msg = MIMEText(body, 'html', 'utf-8') + msg = MIMEText(html_body, 'html', 'utf-8') # Specify HTML msg['Subject'] = subject msg['From'] = SMTP_USER msg['To'] = email @@ -36,7 +37,7 @@ def send_confirmation_email(email): server.quit() except Exception as e: print(f"Failed to send email to {email}: {e}") - + @app.route("/") def index(): return render_template("index.html") From 96aec26f5a9ae306be69fb829234f02e9a3aedbc Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Sat, 5 Apr 2025 20:21:44 -0500 Subject: [PATCH 3/5] refactor: complete overwrite of the css --- static/css/styles.css | 229 +++++++++++++++++++++--------------------- 1 file changed, 117 insertions(+), 112 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index a27334a..591eeaf 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1,6 +1,8 @@ +/* Reset and General Styles */ html { box-sizing: border-box; } + *, *:before, *:after { @@ -13,18 +15,23 @@ body { padding: 0; } +img { + max-width: 100%; + height: auto; +} + +/* Header and Nav */ header { background-color: #fff; padding: 10px 20px; text-align: center; - font-size: 24px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); margin: 5px auto; } header nav { display: flex; - justify-content: normal; + justify-content: flex-start; /* Align items to the start */ align-items: center; } @@ -35,14 +42,16 @@ header nav a { font-size: 22px; } +/* Hero Section Styles */ .hero-section-1 { width: 100%; margin: 0; padding: 0; - overflow: hidden; + overflow: hidden; } -.hero-content, .hero-text { +.hero-content, +.hero-text { width: 100%; height: 100%; margin: 0; @@ -50,9 +59,8 @@ header nav a { } .hero-text img { - width: 70%; - height: auto; - display: block; + width: 70%; + display: block; margin: 0 auto; } @@ -109,6 +117,7 @@ header nav a { cursor: pointer; } +/* Feature Cards */ .hero-section-3 { width: 100%; } @@ -168,6 +177,7 @@ header nav a { margin-right: 10px; } +/* Main Content */ main { width: 100%; margin: 0; @@ -179,6 +189,13 @@ main .inner-container { padding: 10px 20px; } +main h1 { + text-align: center; + margin-bottom: 20px; + color: #007bff; +} + +/* Footer */ .normal-footer { background-color: #337cf2; color: #fff; @@ -189,22 +206,101 @@ main .inner-container { } .fixed-footer { - position: fixed; - bottom: 0; - left: 0; - width: 100%; - background-color: #337cf2; - color: #fff; - padding: 10px; - text-align: center; - z-index: 1000; - } - -img { - max-width: 100%; - height: auto; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + background-color: #337cf2; + color: #fff; + padding: 10px; + text-align: center; + z-index: 1000; } +/* Newsletter Styles */ +.newsletter { + margin-bottom: 40px; + border-bottom: 1px solid #ddd; + padding-bottom: 20px; +} + +.newsletter h2 { + color: #007bff; +} + +.newsletter-time { + color: #666; + font-size: 0.9em; +} + +.newsletter-detail { + max-width: 800px; + margin: 20px auto; + padding: 20px; + border: 1px solid #ddd; + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.newsletter-detail h1 { + color: #007bff; +} + +.back-link { + margin-top: 20px; + display: inline-block; + color: #007bff; + text-decoration: none; +} + +.back-link:hover { + text-decoration: underline; +} + +.cards-container { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 20px; +} + +.newsletter-content { + width: 100%; /* Fixed to 100% */ +} + +.newsletter-card { + background: #fff; + border: 1px solid #ddd; + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + width: 300px; + display: flex; + flex-direction: column; + padding: 20px; + transition: transform 0.15s ease-in-out; +} + +.newsletter-card:hover { + transform: translateY(-5px); +} + +.newsletter-card h2 { + font-size: 1.5em; + color: #007bff; + margin-bottom: 10px; +} + +.newsletter-card p.newsletter-time { + font-size: 0.8em; +} + +.newsletter-main { + max-width: 1200px; + margin: 0 auto; + padding: 20px; +} + +/* Media Queries */ @media (max-width: 768px) { .hero-content { flex-direction: column; @@ -216,11 +312,6 @@ img { padding: 10px; } - .hero-illustration { - width: 100%; - height: auto; - } - .hero-section-2 input { width: 80%; } @@ -265,89 +356,3 @@ img { padding: 50px 0; } } - -.newsletter { - margin-bottom: 40px; - border-bottom: 1px solid #ddd; - padding-bottom: 20px; -} - -.newsletter h2 { - color: #007bff; -} - -.newsletter-time { - color: #666; - font-size: 0.9em; -} - -.newsletter-detail { - max-width: 800px; - margin: 20px auto; - padding: 20px; - border: 1px solid #ddd; - border-radius: 8px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -} -.newsletter-detail h1 { - color: #007bff; -} -.back-link { - margin-top: 20px; - display: inline-block; - color: #007bff; - text-decoration: none; -} -.back-link:hover { - text-decoration: underline; -} - -main h1 { - text-align: center; - margin-bottom: 20px; - color: #007bff; -} - -.cards-container { - display: flex; - flex-wrap: wrap; - justify-content: center; - gap: 20px; -} - -.newsletter-content { - width: 5000px%; -} - -.newsletter-card { - background: #fff; - border: 1px solid #ddd; - border-radius: 8px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - width: 300px; - display: flex; - flex-direction: column; - padding: 20px; - transition: transform 0.15s ease-in-out; -} - -.newsletter-card:hover { - transform: translateY(-5px); -} - -.newsletter-card h2 { - font-size: 1.5em; - color: #007bff; - margin-bottom: 10px; -} - -.newsletter-card p.newsletter-time { - font-size: 0.8em -} - -.newsletter-main { - max-width: 1200px; - margin: 0 auto; - padding: 20px; - } - From 781d88080f2cb8e54613d28280f85dd79901a9d7 Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Sat, 5 Apr 2025 20:22:05 -0500 Subject: [PATCH 4/5] feat: Confirmation email template that gets sent on new adds --- templates/confirmation_email.html | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 templates/confirmation_email.html diff --git a/templates/confirmation_email.html b/templates/confirmation_email.html new file mode 100644 index 0000000..fcdf824 --- /dev/null +++ b/templates/confirmation_email.html @@ -0,0 +1,35 @@ + + + + + + Thanks for Subscribing! + + + +
+

Thanks for subscribing to RideAware newsletter!

+

We're excited to share our journey with you.

+

If you ever wish to unsubscribe, please click here.

+
+ + From 13d8f65ee3aace123fc95e4e71ea1ed835d2a5e6 Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Sat, 5 Apr 2025 20:22:32 -0500 Subject: [PATCH 5/5] refactor: change from standard html blocks to jinja2 --- templates/index.html | 6 +++--- templates/newsletter_detail.html | 9 ++++----- templates/newsletters.html | 16 ++++------------ 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/templates/index.html b/templates/index.html index 0174394..7d64890 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,7 +4,7 @@ RideAware - +
@@ -19,7 +19,7 @@
- RideAware Logo + RideAware Logo
@@ -90,6 +90,6 @@
Copyright © 2025 RideAware. All rights reserved.
- + diff --git a/templates/newsletter_detail.html b/templates/newsletter_detail.html index 0f5bd51..87d85d0 100644 --- a/templates/newsletter_detail.html +++ b/templates/newsletter_detail.html @@ -4,7 +4,7 @@ RideAware - Newsletter Detail - +
@@ -17,17 +17,16 @@
+ ← Back to Newsletters

{{ newsletter.subject }}

- ← Back to Newsletters -
-