feat: sidebar Repository identique au Workspace-local, pages forge unifiees, GC miroirs vides
This commit is contained in:
@@ -456,10 +456,10 @@ def _sidebar_data(request: Request, owner: str = "", repo: str = "") -> dict:
|
||||
has_active_workspace = False
|
||||
local_ws_id = 0
|
||||
|
||||
if ws_cookie and ws_cookie.startswith("gitea:"):
|
||||
# Gitea workspace: preserve context across pages. Also load the local
|
||||
# mirror workspace so it appears in "My Workspaces" in the top section
|
||||
# of the sidebar, in parallel with the Gitea repository tree.
|
||||
if ws_cookie and (ws_cookie.startswith("gitea:") or ws_cookie.startswith("github:")):
|
||||
# Forge workspace (Gitea/GitHub): preserve context across pages. Also
|
||||
# load the local mirror workspace so it appears in Workspace in
|
||||
# parallel with the Repository tree (same navigation as workspace-local).
|
||||
parts = ws_cookie.split(":", 2)
|
||||
if len(parts) >= 3:
|
||||
gitea_owner = parts[1]
|
||||
@@ -472,8 +472,9 @@ def _sidebar_data(request: Request, owner: str = "", repo: str = "") -> dict:
|
||||
try:
|
||||
with get_conn() as conn:
|
||||
row = conn.execute(
|
||||
"SELECT id FROM workspaces WHERE owner_id=? AND name=? AND settings_json LIKE ?",
|
||||
(user["id"], f"{gitea_owner}/{gitea_repo}", "%gitea_repo%")
|
||||
"SELECT id FROM workspaces WHERE owner_id=? AND name=? "
|
||||
"AND (settings_json LIKE '%gitea_repo%' OR settings_json LIKE '%github_repo%')",
|
||||
(user["id"], f"{gitea_owner}/{gitea_repo}"),
|
||||
).fetchone()
|
||||
if row:
|
||||
local_ws_id = row["id"]
|
||||
|
||||
Reference in New Issue
Block a user