Files
amsterdam/ui/views/menu.jet
T

69 lines
3.1 KiB
Plaintext

{*
* 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/.
*
* SPDX-License-Identifier: MPL-2.0
*}
<div class="p-4">
<!-- Page Title -->
{{ if menu.Title != "" }}
<div class="mb-6">
{{ if menu.Subtitle != "" }}
<div class="flex items-baseline gap-3 mb-2">
<h1 class="text-blue-800 text-4xl font-bold">{{ menu.Title }}</h1>
<h2 class="text-blue-800 text-2xl font-bold">{{ menu.Subtitle }}</h2>
</div>
{{ else }}
<h1 class="text-blue-800 text-4xl font-bold mb-2">{{ menu.Title }}</h1>
{{ end }}
<hr class="border-2 border-gray-400 w-4/5 mb-4">
</div>
{{ end }}
<!-- Rendered Menu -->
<div class="max-w-2xl">
<div class="bg-gray-50 p-6 rounded-lg">
<nav class="space-y-3">
{{ range _, m := menu.Items }}
{{ vis := true }}
{{ if m.Ifdef != "" && !defs[m.Ifdef] }}{{ vis = false }}{{ end }}
{{ if vis && m.Show(.) }}
<div class="flex items-start gap-3">
{{ if m.Image != "" }}
{{ if it.Link != "" && !it.Disabled }}
<a href="{{ it.Link }}"><img src="{{ it.Image }}" alt="{{ it.Text }}"></a>
{{ else }}
<img src="{{ it.Image }}" alt="{{ it.Text }}">
{{ end }}
{{ else }}
<span class="text-lg pt-0.5">🟣</span>
{{ if m.Disabled }}
<span class="text-gray-500 font-medium">{{ m.Text }}</span>
{{ else if m.Link != "" }}
{{ if m.Hazard }}
<a href="{{ m.Link }}" class="text-red-700 hover:text-red-900 font-medium">⚠️ {{ m.Text }}</a>
{{ else }}
<a href="{{ m.Link }}" class="text-blue-700 hover:text-blue-900 font-medium">{{ m.Text }}</a>
{{ end }}
{{ else }}
<span class="font-medium">{{ m.Text }}</span>
{{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}
</nav>
</div>
{{ if menu.Warning != "" }}
<div class="mt-6 p-4 bg-yellow-50 border-l-4 border-yellow-400">
<p class="text-sm text-gray-700">{{ menu.Warning | raw }}</p>
</div>
{{ end }}
</div>
</div>