summaryrefslogtreecommitdiffstats
path: root/app/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/app.py')
-rw-r--r--app/app.py20
1 files changed, 20 insertions, 0 deletions
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',