Modify the order of the sidebar, remove tabs from users

This commit is contained in:
hansi
2025-12-16 22:09:55 +01:00
parent 0143d9579b
commit 9435399096
6 changed files with 81 additions and 72 deletions

View File

@@ -97,14 +97,17 @@ def get_sidebar(role_text: str, username: str):
d.dash_id,
d.dash_text,
d.page_file,
d.dash_type
d.dash_type,
d.order_no as dash_order,
g.order_no as group_order
from
groups g
left join dashboards d
on g.group_id = d.group_id
where
g.active = 1
and d.active = 1
and d.active = 1
order by g.order_no, d.order_no
"""
else:
sql = """
@@ -114,7 +117,9 @@ def get_sidebar(role_text: str, username: str):
p.dash_id,
d.dash_text,
d.page_file,
d.dash_type
d.dash_type,
d.order_no as dash_order,
g.order_no as group_order
FROM
users u
left join permissions p
@@ -129,13 +134,10 @@ def get_sidebar(role_text: str, username: str):
and d.active = 1
and p.active = 1
and u.username = ?
order by
g.order_no,
d.order_no
order by g.order_no, d.order_no
"""
params = (username,) if "?" in sql else None
df = get_list(sql, params)
return df
# ---------------------------------------------------------------------------