From b32762ae23dc1cc4d2b076ea14294a01e986c590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 16 Aug 2025 16:25:24 -0400 Subject: [PATCH] create templates for group selection menu displayed in organization dashboard header, and update dashboard template to show said selection menu --- templates/group/dashboard/menu.tmpl | 18 ++++++++++++++++++ templates/group/dashboard/menu_item.tmpl | 19 +++++++++++++++++++ templates/group/dashboard/submenu.tmpl | 6 ++++++ templates/user/dashboard/navbar.tmpl | 17 +++++++++++++---- 4 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 templates/group/dashboard/menu.tmpl create mode 100644 templates/group/dashboard/menu_item.tmpl create mode 100644 templates/group/dashboard/submenu.tmpl diff --git a/templates/group/dashboard/menu.tmpl b/templates/group/dashboard/menu.tmpl new file mode 100644 index 0000000000..d3dd86394f --- /dev/null +++ b/templates/group/dashboard/menu.tmpl @@ -0,0 +1,18 @@ + diff --git a/templates/group/dashboard/menu_item.tmpl b/templates/group/dashboard/menu_item.tmpl new file mode 100644 index 0000000000..8bc0c744d0 --- /dev/null +++ b/templates/group/dashboard/menu_item.tmpl @@ -0,0 +1,19 @@ + + + {{.Item.Title}} + + +{{$d := .Depth}} +{{$one := 1}} +{{$d1 := Eval $d "+" $one}} +{{template "group/dashboard/submenu" dict "." . "Items" (.Item.Children .SignedUser) "Depth" $d1}} diff --git a/templates/group/dashboard/submenu.tmpl b/templates/group/dashboard/submenu.tmpl new file mode 100644 index 0000000000..9f4ac6a640 --- /dev/null +++ b/templates/group/dashboard/submenu.tmpl @@ -0,0 +1,6 @@ +{{ range.Items}} +{{if .IsGroup}} + +{{ template "group/dashboard/menu_item" dict "." $ "Item" . "Depth" $.Depth}} +{{ end }} +{{ end }} diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index 7eb845833f..53ae80ffbc 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -74,25 +74,34 @@ +
+ {{template "group/dashboard/menu" .}} +
{{end}} {{if .ContextUser.IsOrganization}} + {{$suffix := ""}} + {{if .Team}} + {{$suffix = PathEscape .Team.Name}} + {{else if .Group}} + {{$suffix = URLJoin "group" (StringUtils.ToString .Group.ID)}} + {{end}}