From b5f0c3ee2c3060dd9821d42f4e1bcbb87cbbee10 Mon Sep 17 00:00:00 2001 From: Ken D'Ambrosio Date: Mon, 25 May 2026 00:52:19 +0000 Subject: Add recipe overview page linked from dashboard stat card Clicking "Active Recipes" on the dashboard goes to /recipes/overview, which shows favorites and the 12 most recently added recipes as cards. Favorites are highlighted with a red border. Stat card has a hover lift. Co-Authored-By: Claude Sonnet 4.6 --- app/app.py | 20 ++++++++++ app/static/css/style.css | 9 +++++ app/templates/index.html | 10 +++-- app/templates/recipe_overview.html | 81 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 app/templates/recipe_overview.html (limited to 'app') diff --git a/app/app.py b/app/app.py index bdeb215..026907e 100644 --- a/app/app.py +++ b/app/app.py @@ -253,6 +253,26 @@ def index(): # ── Recipes ─────────────────────────────────────────────────────────────────── +@app.route('/recipes/overview') +def recipes_overview(): + db = database.get_db() + favorites = db.execute( + "SELECT * FROM recipes WHERE status = 'favorited' ORDER BY name" + ).fetchall() + recent = db.execute( + """SELECT * FROM recipes WHERE status != 'ignored' + ORDER BY id DESC LIMIT 12""" + ).fetchall() + db.close() + fav_ids = {r['id'] for r in favorites} + recent_new = [r for r in recent if r['id'] not in fav_ids] + return render_template( + 'recipe_overview.html', + favorites=favorites, recent=recent_new, + cuisine_emoji=CUISINE_EMOJI_MAP, + ) + + SORT_OPTIONS = { 'name': 'name', 'prep': 'prep_time, name', diff --git a/app/static/css/style.css b/app/static/css/style.css index 7167e05..37d36f6 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -67,6 +67,15 @@ body { line-height: 1; } +.stat-card-link { + transition: box-shadow 0.15s, transform 0.15s; + cursor: pointer; +} +.stat-card-link:hover { + box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important; + transform: translateY(-2px); +} + .stat-label { font-size: 0.8rem; color: var(--muted); diff --git a/app/templates/index.html b/app/templates/index.html index c33e348..55b5ef0 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -28,10 +28,12 @@
-
-
{{ stat_map.get('candidate', 0) + stat_map.get('favorited', 0) }}
-
Active Recipes
-
+ + +
diff --git a/app/templates/recipe_overview.html b/app/templates/recipe_overview.html new file mode 100644 index 0000000..252aed2 --- /dev/null +++ b/app/templates/recipe_overview.html @@ -0,0 +1,81 @@ +{% extends "base.html" %} +{% block title %}Recipe Overview — Menu Planner{% endblock %} + +{% block content %} +
+

Recipe Overview

+ Full Library +
+ +{% if favorites %} +

Favorites

+ +{% endif %} + +{% if recent %} +

Recently Added

+ +{% endif %} + +{% if not favorites and not recent %} +
+ +

No recipes yet. Add one or use the AI assistant.

+
+{% endif %} +{% endblock %} -- cgit v1.2.3