diff --git a/ui/views/block_leftmenus.jet b/ui/views/block_leftmenus.jet new file mode 100644 index 0000000..a1882ae --- /dev/null +++ b/ui/views/block_leftmenus.jet @@ -0,0 +1,43 @@ +{* + * Amsterdam Web Communities System + * Copyright (c) 2025-2026 Erbosoft Metaverse Design Solutions, All Rights Reserved + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + *} +{{ block leftMenu(menu) }} +
+
{{ menu.Title }}
+ {{ range _, it := menu.Items }} + {{ if it.Show(.) }} + {{ if it.Disabled }} +
{{ it.Text }}
+ {{ else }} + {{ it.Text }} + {{ end }} + {{ end }} + {{ end }} +
+{{ end }} +{{ block leftCommunityMenu(menu) }} + {{ __comm := .CurrentCommunity() }} +
+
+ {{ __comm.Name }} +
+
{{ menu.Title }}
+ {{ range _, it := menu.Items }} + {{ if it.Show(.) }} + {{ if it.Disabled }} +
{{ it.Text }}
+ {{ else }} +
{{ it.Text }}
+ {{ end }} + {{ end }} + {{ end }} + {{ if .IsMember() && !.IsMemberLocked() }} +
⚠️ Unjoin
+ {{ end }} +
+{{ end }} diff --git a/ui/views/frame.jet b/ui/views/frame.jet index 6d452be..3cd5299 100644 --- a/ui/views/frame.jet +++ b/ui/views/frame.jet @@ -6,6 +6,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. *} + {{ import "block_leftmenus.jet" }} @@ -88,11 +89,10 @@ {{ if i > 0 }}
 
{{ end }} - {{ .SetScratch("__menu", m) }} {{ if m.Tag == "community" }} - {{ include "menu_left_comm.jet" }} + {{ yield leftCommunityMenu(menu=m) }} {{ else }} - {{ include "menu_left.jet" }} + {{ yield leftMenu(menu=m) }} {{ end }} {{ end }} diff --git a/ui/views/menu_left.jet b/ui/views/menu_left.jet deleted file mode 100644 index 5b2f89b..0000000 --- a/ui/views/menu_left.jet +++ /dev/null @@ -1,22 +0,0 @@ -{* - * Amsterdam Web Communities System - * Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - *} -{{ menu := .GetScratch("__menu") }} -
-
{{ menu.Title }}
- {{ ctxt := . }} - {{ range menu.Items }} - {{ if .Show(ctxt) }} - {{ if .Disabled }} -
{{ .Text }}
- {{ else }} - {{ .Text }} - {{ end }} - {{ end }} - {{ end }} -
diff --git a/ui/views/menu_left_comm.jet b/ui/views/menu_left_comm.jet deleted file mode 100644 index f0ca74a..0000000 --- a/ui/views/menu_left_comm.jet +++ /dev/null @@ -1,29 +0,0 @@ -{* - * Amsterdam Web Communities System - * Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - *} -{{ menu := .GetScratch("__menu") }} -{{ comm := .CurrentCommunity() }} -
-
- {{ comm.Name }} -
-
{{ menu.Title }}
- {{ ctxt := . }} - {{ range menu.Items }} - {{ if .Show(ctxt) }} - {{ if .Disabled }} -
{{ .Text }}
- {{ else }} -
{{ .Text }}
- {{ end }} - {{ end }} - {{ end }} - {{ if .IsMember() && !.IsMemberLocked() }} -
⚠️ Unjoin
- {{ end }} -