broke out the generation of the sideboxes
This commit is contained in:
+12
-4
@@ -28,11 +28,12 @@ type AmContext interface {
|
||||
RC() int
|
||||
OutputType() string
|
||||
Render(string) error
|
||||
Scratchpad() map[any]any
|
||||
Scratchpad() map[string]any
|
||||
SubRender(string) ([]byte, error)
|
||||
Session() *sessions.Session
|
||||
SetOutputType(string)
|
||||
SetRC(int)
|
||||
SetScratch(string, any)
|
||||
URLPath() string
|
||||
VarMap() jet.VarMap
|
||||
}
|
||||
@@ -43,7 +44,7 @@ type amContext struct {
|
||||
httprc int
|
||||
rendervars jet.VarMap
|
||||
outputType string
|
||||
scratchpad map[any]any
|
||||
scratchpad map[string]any
|
||||
session *sessions.Session
|
||||
}
|
||||
|
||||
@@ -77,9 +78,9 @@ func (c *amContext) Render(name string) error {
|
||||
}
|
||||
|
||||
// Scratchpad returns the per-request scratchpad for values.
|
||||
func (c *amContext) Scratchpad() map[any]any {
|
||||
func (c *amContext) Scratchpad() map[string]any {
|
||||
if c.scratchpad == nil {
|
||||
c.scratchpad = make(map[any]any)
|
||||
c.scratchpad = make(map[string]any)
|
||||
}
|
||||
return c.scratchpad
|
||||
}
|
||||
@@ -116,6 +117,13 @@ func (c *amContext) SetRC(rc int) {
|
||||
c.httprc = rc
|
||||
}
|
||||
|
||||
func (c *amContext) SetScratch(name string, val any) {
|
||||
if c.scratchpad == nil {
|
||||
c.scratchpad = make(map[string]any)
|
||||
}
|
||||
c.scratchpad[name] = val
|
||||
}
|
||||
|
||||
// URLPath returns the path component of the request URL.
|
||||
func (c *amContext) URLPath() string {
|
||||
return c.echoContext.Request().URL.Path
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{*
|
||||
* 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/.
|
||||
*}
|
||||
<!-- Featured Communities -->
|
||||
<div class="mb-4">
|
||||
<div class="bg-blue-600 px-2 py-1 rounded-t">
|
||||
<h3 class="text-white font-bold text-base">Featured Communities:</h3>
|
||||
</div>
|
||||
<div class="bg-blue-400 px-2 py-2 rounded-b">
|
||||
<div class="flex items-center">
|
||||
<span class="mr-2">🟣</span>
|
||||
<a href="http://necrovenice:8080/venice/community/Piazza"
|
||||
class="text-blue-700 hover:text-blue-900 font-bold text-sm">La Piazza</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
{*
|
||||
* 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/.
|
||||
*}
|
||||
<!-- Featured Conferences -->
|
||||
<div class="mb-4">
|
||||
<div class="bg-blue-600 px-2 py-1 rounded-t">
|
||||
<h3 class="text-white font-bold text-base">Featured Conferences:</h3>
|
||||
</div>
|
||||
<div class="bg-blue-400 px-2 py-2 rounded-b">
|
||||
<div class="flex items-center">
|
||||
<span class="mr-2">🟣</span>
|
||||
<div class="text-sm">
|
||||
<a href="http://necrovenice:8080/venice/conf/topics.js.vs?sig=2&conf=2"
|
||||
class="text-blue-700 hover:text-blue-900 font-bold">General Discussion</a>
|
||||
<span class="text-black"> (La Piazza)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
{*
|
||||
* 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/.
|
||||
*}
|
||||
<!-- Users Online -->
|
||||
<div class="mb-4">
|
||||
<div class="bg-blue-600 px-2 py-1 rounded-t">
|
||||
<h3 class="text-white font-bold text-base">Users Online:</h3>
|
||||
</div>
|
||||
<div class="bg-blue-400 px-2 py-2 rounded-b">
|
||||
<div class="text-black text-sm font-bold mb-2">1 total (max 1)</div>
|
||||
<div class="flex items-center">
|
||||
<span class="mr-2">🟣</span>
|
||||
<span class="text-black text-sm">Not logged in (1)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+15
-52
@@ -8,14 +8,16 @@
|
||||
*}
|
||||
<!-- Content Area -->
|
||||
<div class="flex-1 p-4">
|
||||
<!-- Welcome Section -->
|
||||
<div class="mb-8">
|
||||
<h1 class="text-blue-800 text-4xl font-bold mb-2">Welcome to Venice</h1>
|
||||
<hr class="border-2 border-gray-400 w-4/5 mb-4">
|
||||
<p class="text-black text-sm mb-4">
|
||||
Welcome to the <strong>Venice Web Communities System</strong>. To get the most out of this site, you should log in or create an account, using one of the links above.
|
||||
</p>
|
||||
</div>
|
||||
{{ if .CurrentUser().IsAnon }}
|
||||
<!-- Welcome Section -->
|
||||
<div class="mb-8">
|
||||
<h1 class="text-blue-800 text-4xl font-bold mb-2">Welcome to Amsterdam</h1>
|
||||
<hr class="border-2 border-gray-400 w-4/5 mb-4">
|
||||
<p class="text-black text-sm mb-4">
|
||||
Welcome to the <strong>Amsterdam Web Communities System</strong>. To get the most out of this site, you should log in or create an account, using one of the links above.
|
||||
</p>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<!-- Venice Currents Section -->
|
||||
<div>
|
||||
@@ -46,48 +48,9 @@ dead by now.</pre>
|
||||
|
||||
<!-- RIGHT SIDEBAR -->
|
||||
<div class="w-52 p-4">
|
||||
<!-- Featured Communities -->
|
||||
<div class="mb-4">
|
||||
<div class="bg-blue-600 px-2 py-1 rounded-t">
|
||||
<h3 class="text-white font-bold text-base">Featured Communities:</h3>
|
||||
</div>
|
||||
<div class="bg-blue-400 px-2 py-2 rounded-b">
|
||||
<div class="flex items-center">
|
||||
<span class="mr-2">🟣</span>
|
||||
<a href="http://necrovenice:8080/venice/community/Piazza"
|
||||
class="text-blue-700 hover:text-blue-900 font-bold text-sm">La Piazza</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Featured Conferences -->
|
||||
<div class="mb-4">
|
||||
<div class="bg-blue-600 px-2 py-1 rounded-t">
|
||||
<h3 class="text-white font-bold text-base">Featured Conferences:</h3>
|
||||
</div>
|
||||
<div class="bg-blue-400 px-2 py-2 rounded-b">
|
||||
<div class="flex items-center">
|
||||
<span class="mr-2">🟣</span>
|
||||
<div class="text-sm">
|
||||
<a href="http://necrovenice:8080/venice/conf/topics.js.vs?sig=2&conf=2"
|
||||
class="text-blue-700 hover:text-blue-900 font-bold">General Discussion</a>
|
||||
<span class="text-black"> (La Piazza)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Users Online -->
|
||||
<div class="mb-4">
|
||||
<div class="bg-blue-600 px-2 py-1 rounded-t">
|
||||
<h3 class="text-white font-bold text-base">Users Online:</h3>
|
||||
</div>
|
||||
<div class="bg-blue-400 px-2 py-2 rounded-b">
|
||||
<div class="text-black text-sm font-bold mb-2">1 total (max 1)</div>
|
||||
<div class="flex items-center">
|
||||
<span class="mr-2">🟣</span>
|
||||
<span class="text-black text-sm">Not logged in (1)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ ctxt := . }}
|
||||
{{ range sideboxes }}
|
||||
{{ ctxt.SetScratch("__sidebox", .) }}
|
||||
{{ ctxt.SubRender(.TemplateName) | raw }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user