diff --git a/routers/focus.py b/routers/focus.py index f651e4f..755e3db 100644 --- a/routers/focus.py +++ b/routers/focus.py @@ -592,6 +592,15 @@ async def toggle_focus(focus_id: str, request: Request, db: AsyncSession = Depen return RedirectResponse(url=referer, status_code=303) +@router.post("/{focus_id}/toggle-critical") +async def toggle_critical(focus_id: str, request: Request, db: AsyncSession = Depends(get_db)): + repo = BaseRepository("daily_focus", db) + item = await repo.get(focus_id) + if item: + await repo.update(focus_id, {"critical": not item.get("critical", False)}) + return RedirectResponse(url="/focus", status_code=303) + + @router.post("/{focus_id}/remove") async def remove_from_focus(focus_id: str, request: Request, db: AsyncSession = Depends(get_db)): repo = BaseRepository("daily_focus", db) diff --git a/templates/focus.html b/templates/focus.html index be4f921..6dbc3c3 100644 --- a/templates/focus.html +++ b/templates/focus.html @@ -24,13 +24,13 @@
- + {% for domain in hierarchy %} - +
+ @@ -50,6 +50,11 @@
+
+ +
+
{{ item.due_date or '' }} {% if item.task_id %}{% elif item.list_item_id %}{% else %}{% endif %} {% if item.task_id %}{% if item.task_title %}{{ item.task_title }}{% else %}[Deleted]{% endif %}{% elif item.list_item_id %}{% if item.list_item_content %}{{ item.list_item_content }}{% else %}[Deleted]{% endif %}{% else %}{{ item.title }}{% endif %}