consolidated left menus into blocks, imported from frame
This commit is contained in:
@@ -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) }}
|
||||
<div class="mb-2 mt-2">
|
||||
<div class="font-bold mb-1">{{ menu.Title }}</div>
|
||||
{{ range _, it := menu.Items }}
|
||||
{{ if it.Show(.) }}
|
||||
{{ if it.Disabled }}
|
||||
<div class="text-gray-500 mb-1">{{ it.Text }}</div>
|
||||
{{ else }}
|
||||
<a href="{{ it.Link }}" class="text-blue-700 hover:text-blue-900">{{ it.Text }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ block leftCommunityMenu(menu) }}
|
||||
{{ __comm := .CurrentCommunity() }}
|
||||
<div class="mb-2 mt-2">
|
||||
<div class="mb-1">
|
||||
<img src="{{ ExtractCommunityLogo(__comm, .) }}" alt="{{ __comm.Name }}" class="w-28 h-16 rounded">
|
||||
</div>
|
||||
<div class="font-bold mb-1">{{ menu.Title }}</div>
|
||||
{{ range _, it := menu.Items }}
|
||||
{{ if it.Show(.) }}
|
||||
{{ if it.Disabled }}
|
||||
<div class="text-gray-500 mb-1">{{ it.Text }}</div>
|
||||
{{ else }}
|
||||
<div class="mb-1"><a href="{{ it.Link }}" class="text-blue-700 hover:text-blue-900">{{ it.Text }}</a></div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .IsMember() && !.IsMemberLocked() }}
|
||||
<div class="mt-4 mb-1"><a href="/comm/{{ __comm.Alias }}/unjoin" class="text-red-700 hover:text-red-900">⚠️ Unjoin</a></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
+3
-3
@@ -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" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -88,11 +89,10 @@
|
||||
{{ if i > 0 }}
|
||||
<div class="mb-2 mt-2"> </div>
|
||||
{{ 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 }}
|
||||
</div>
|
||||
|
||||
@@ -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") }}
|
||||
<div class="mb-2 mt-2">
|
||||
<div class="font-bold mb-1">{{ menu.Title }}</div>
|
||||
{{ ctxt := . }}
|
||||
{{ range menu.Items }}
|
||||
{{ if .Show(ctxt) }}
|
||||
{{ if .Disabled }}
|
||||
<div class="text-gray-500 mb-1">{{ .Text }}</div>
|
||||
{{ else }}
|
||||
<a href="{{ .Link }}" class="text-blue-700 hover:text-blue-900">{{ .Text }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -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() }}
|
||||
<div class="mb-2 mt-2">
|
||||
<div class="mb-1">
|
||||
<img src="{{ ExtractCommunityLogo(comm, .) }}" alt="{{ comm.Name }}" class="w-28 h-16 rounded">
|
||||
</div>
|
||||
<div class="font-bold mb-1">{{ menu.Title }}</div>
|
||||
{{ ctxt := . }}
|
||||
{{ range menu.Items }}
|
||||
{{ if .Show(ctxt) }}
|
||||
{{ if .Disabled }}
|
||||
<div class="text-gray-500 mb-1">{{ .Text }}</div>
|
||||
{{ else }}
|
||||
<div class="mb-1"><a href="{{ .Link }}" class="text-blue-700 hover:text-blue-900">{{ .Text }}</a></div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .IsMember() && !.IsMemberLocked() }}
|
||||
<div class="mb-1"><a href="/comm/{{ comm.Alias }}/unjoin" class="text-red-700 hover:text-red-900">⚠️ Unjoin</a></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user