diff options
| author | Ken D'Ambrosio <ken@claude> | 2026-05-25 00:52:19 +0000 |
|---|---|---|
| committer | Ken D'Ambrosio <ken@claude> | 2026-05-25 00:52:19 +0000 |
| commit | b5f0c3ee2c3060dd9821d42f4e1bcbb87cbbee10 (patch) | |
| tree | e3ae9394a10871e0acfb67329200e8a1939a5bb1 /app/app.py | |
| parent | 55bcec90c14db6f2956ed51cf4df1503c0767f81 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'app/app.py')
| -rw-r--r-- | app/app.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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', |
