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 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'app/app.py') 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', -- cgit v1.2.3