landed "manage communities" list on sidebox
This commit is contained in:
+3
-2
@@ -136,7 +136,8 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an
|
||||
// expireTime is the expiration time sent in the dynamic headers.
|
||||
var expireTime string = lctime.Strftime("%c", time.Unix(1, 0))
|
||||
|
||||
type PageFunc func(AmContext) (string, any)
|
||||
// AmPageFunc is the definition for an Amsterdam "page function" that handles most of the work and defers to the wrapper for rendering.
|
||||
type AmPageFunc func(AmContext) (string, any)
|
||||
|
||||
/* AmWrap wraps the Amsterdam handler function in a wrapper that implements the spec for
|
||||
* Echo handler functions.
|
||||
@@ -145,7 +146,7 @@ type PageFunc func(AmContext) (string, any)
|
||||
* Returns:
|
||||
* The wrapped function.
|
||||
*/
|
||||
func AmWrap(myfunc PageFunc) echo.HandlerFunc {
|
||||
func AmWrap(myfunc AmPageFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
ctxt := AmContextFromEchoContext(c)
|
||||
|
||||
|
||||
@@ -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/.
|
||||
*}
|
||||
<div class="p-4">
|
||||
<!-- Page Title -->
|
||||
<div class="mb-6">
|
||||
<h1 class="text-blue-800 text-4xl font-bold">Your Communities</h1>
|
||||
<hr class="border-2 border-gray-400 w-4/5 mt-2 mb-6">
|
||||
</div>
|
||||
|
||||
<!-- Backlink -->
|
||||
<div class="mb-4">
|
||||
<a class="text-blue-700 hover:text-blue-900 text-sm flex items-center gap-2 w-fit" href="/">
|
||||
<span>←</span>
|
||||
Return to Front Page
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-1 gap-1 mb-6">
|
||||
{{ range i, c := communities }}
|
||||
<div class="flex items-start gap-1">
|
||||
<span class="text-sm pt-0.5">🟣</span>
|
||||
<a href="/comm/{{ c.Alias }}/profile" class="text-blue-700 hover:text-blue-900">{{ c.Name }}</a>
|
||||
{{ if canUnjoin[i] }}
|
||||
<a href="/comm/{{ c.Alias }}/unj" class="hover:scale-125 inline-block transition-transform" title="Unjoin">🗙</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<!-- Information Note -->
|
||||
<div class="mt-6 p-4 bg-blue-50 border-l-4 border-blue-400">
|
||||
<p class="text-sm text-gray-700">
|
||||
<strong>Note:</strong> Click on the 🗙 symbol to unjoin a community. You will lose access to that
|
||||
community's resources and discussions.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@
|
||||
<span class="text-black text-xs font-bold">
|
||||
[
|
||||
{{ if sb.Flags["canManage"] }}
|
||||
<a href="/TODO/manage_comms" class="text-blue-700 hover:text-blue-900">Manage</a>
|
||||
<a href="/manage_comm" class="text-blue-700 hover:text-blue-900">Manage</a>
|
||||
{{ if sb.Flags["canCreate"] }}|{{ end }}
|
||||
{{ end }}
|
||||
{{ if sb.Flags["canCreate"] }}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<!-- Action Buttons -->
|
||||
<div class="flex gap-4 justify-center">
|
||||
<form method="POST" action="/comm/{{ comm.Alias }}/unjoin">
|
||||
<input type="hidden" name="returnURL" value="{{ returnURL }}">
|
||||
<button type="submit" name="cancel"
|
||||
class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded font-medium transition-colors">✗ Cancel</button>
|
||||
<button type="submit" name="unjoin"
|
||||
|
||||
Reference in New Issue
Block a user