fix: sidebar Favorites + Shared, Library page with tabs, CSRF fix
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

- Section Favorites ajoutée dans le sidebar (⭐)
- Section Shared ajoutée (👥)
- Section Library remplacée par bouton 📚 qui ouvre /library
- Page /library avec onglets: Recents | Favorites | Shared | Private
- CSRF token injecté dans les appels fetch (newPage, newSubPage)
- Bouton + sur éléments sidebar corrigé (POST /board/api/pages avec X-CSRF-Token)
- Bouton 📚 sur sections ouvre /library
- sidebar_data inclut favorite_pages=[]
This commit is contained in:
2026-07-08 15:17:14 -04:00
parent b10118eddc
commit 24e979a05f
4 changed files with 227 additions and 17 deletions
+19 -2
View File
@@ -141,8 +141,8 @@ def _sidebar_data(request: Request, owner: str = "", repo: str = "") -> dict:
})
return {"workspace_name": ws, "workspace_initial": ws[0].upper() if ws else "B",
"current_page": repo or "Dashboard", "last_edited": "now",
"recent_pages": recent, "private_pages": [r for r in recent if r.get("active")],
"user": user}
"recent_pages": recent, "private_pages": [r for r in recent if r.get("active") or r["id"].startswith("page/")],
"favorite_pages": [], "user": user}
def _extract_ai_keywords(owner: str, repo: str, labels: list[dict], body: str = ""):
@@ -241,6 +241,23 @@ def _apply_sorts(cards: list[dict], sorts: str) -> list[dict]:
return cards
# ═══════════ Library page ═══════════
@router.get("/library", response_class=HTMLResponse)
async def library_page(request: Request):
"""Library page avec onglets Recents, Favorites, Shared, Private."""
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader("app/templates"))
sidebar = _sidebar_data(request)
# Enrich with timestamps
for p in sidebar["recent_pages"]:
p["last_edited"] = "now"
for p in sidebar["private_pages"]:
p["last_edited"] = "now"
template = env.get_template("library.html")
return template.render(**sidebar)
# ═══════════ Board page ═══════════
@router.get("/{owner}/{repo}", response_class=HTMLResponse)
+15
View File
@@ -48,10 +48,25 @@ def _sidebar_data(request: Request, repos: list[dict]) -> dict:
"current_page": "Dashboard", "last_edited": "now",
"recent_pages": recent_pages,
"private_pages": [p for p in recent_pages if p["id"].startswith("page/")],
"favorite_pages": [],
"user": user,
}
@router.get("/library", response_class=HTMLResponse)
async def library_page(request: Request):
"""Library page avec onglets Recents, Favorites, Shared, Private."""
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader("app/templates"))
sidebar = _sidebar_data(request, [])
for p in sidebar["recent_pages"]:
p["last_edited"] = "now"
for p in sidebar["private_pages"]:
p["last_edited"] = "now"
template = env.get_template("library.html")
return template.render(**sidebar)
@router.get("/", response_class=HTMLResponse)
async def dashboard(
request: Request,