fix: WORKSPSACES section + remaining emoji icons replaced
- base.html: séparateur entre version et Log out, _local_workspaces_for_user - board.py: _local_workspaces_for_user helper, app_version, fix emoji icons - dashboard.py: _local_workspaces_for_user helper - library.html: 📚📁📄🕒⭐👥🌐🔒📦 → SVG + icon map - workspaces.html: 📁🔍🗑📝 → SVG - local_workspace.html: page_icon, empty states, icon functions → SVG - settings.html: 👤🔔 → SVG nav icons - _icons.html: +'bell' icon - CSS: .nav-icon-inline, .empty-state-icon - 143 tests passent
This commit is contained in:
+16
-13
@@ -31,6 +31,21 @@ def _get_user_or_redirect(request: Request):
|
||||
return user
|
||||
|
||||
|
||||
def _local_workspaces_for_user(user: dict | None, workspace_id: int = 0) -> list[dict]:
|
||||
"""Return list of local workspaces for a user."""
|
||||
if not user:
|
||||
return []
|
||||
try:
|
||||
with get_conn() as conn:
|
||||
rows = conn.execute(
|
||||
"SELECT id, name FROM workspaces WHERE owner_id = ? ORDER BY name",
|
||||
(user["id"],)
|
||||
).fetchall()
|
||||
return [{"id": r["id"], "name": r["name"]} for r in rows]
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
|
||||
def _sidebar_data(request: Request, repos: list[dict], include_workspace: bool = True) -> dict:
|
||||
user = SessionManager.decode_session(request.cookies.get("flowdeck_session", ""))
|
||||
ws = user.get("login", "Bruno") if user else "Bruno"
|
||||
@@ -176,19 +191,7 @@ def _sidebar_data(request: Request, repos: list[dict], include_workspace: bool =
|
||||
"app_version": "4.0.3",
|
||||
}
|
||||
|
||||
# List local workspaces for user menu
|
||||
local_workspaces = []
|
||||
if user:
|
||||
try:
|
||||
with get_conn() as conn:
|
||||
ws_rows = conn.execute(
|
||||
"SELECT id, name FROM workspaces WHERE owner_id = ? ORDER BY name",
|
||||
(user["id"],)
|
||||
).fetchall()
|
||||
local_workspaces = [{"id": r["id"], "name": r["name"]} for r in ws_rows]
|
||||
except Exception:
|
||||
pass
|
||||
sidebar["local_workspaces"] = local_workspaces
|
||||
sidebar["local_workspaces"] = _local_workspaces_for_user(user)
|
||||
|
||||
return sidebar
|
||||
|
||||
|
||||
Reference in New Issue
Block a user