The basic demo code can now output "modernized" Venice front page HTML as a template. Some further directions also added.

This commit is contained in:
2025-09-11 23:38:41 -06:00
parent 38d8c50316
commit e2580402b8
7 changed files with 283 additions and 2 deletions
Executable
BIN
View File
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
/*
* 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/.
*/
+2
View File
@@ -3,6 +3,8 @@ module git.erbosoft.com/amy/amsterdam
go 1.25.0
require (
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
github.com/CloudyKit/jet/v6 v6.3.1 // indirect
github.com/labstack/echo/v4 v4.13.4 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
+4
View File
@@ -1,3 +1,7 @@
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c=
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
github.com/CloudyKit/jet/v6 v6.3.1 h1:6IAo5Cx21xrHVaR8zzXN5gJatKV/wO7Nf6bfCnCSbUw=
github.com/CloudyKit/jet/v6 v6.3.1/go.mod h1:lf8ksdNsxZt7/yH/3n4vJQWA9RUq4wpaHtArHhGVMOw=
github.com/labstack/echo/v4 v4.13.4 h1:oTZZW+T3s9gAu5L8vmzihV7/lkXGZuITzTQkTEhcXEA=
github.com/labstack/echo/v4 v4.13.4/go.mod h1:g63b33BZ5vZzcIUF8AtRH40DrTlXnx4UMC8rBdndmjQ=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
+35 -2
View File
@@ -1,14 +1,47 @@
/*
* 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/.
*/
package main
import (
"io"
"net/http"
"github.com/CloudyKit/jet/v6"
"github.com/labstack/echo/v4"
)
func main() {
var views = jet.NewSet(
jet.NewOSFileSystemLoader("./views"),
jet.DevelopmentMode(true),
)
type TemplateRenderer struct {
}
func (self *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
view, err := views.GetTemplate(name)
if err != nil {
return err
}
return view.Execute(w, nil, nil)
}
func setupEcho() *echo.Echo {
e := echo.New()
e.Renderer = &TemplateRenderer{}
e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello, world!")
return c.Render(http.StatusOK, "frame.jet", nil)
})
return e
}
func main() {
e := setupEcho()
e.Logger.Fatal(e.Start(":1323"))
}
+32
View File
@@ -0,0 +1,32 @@
/*
* 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/.
*/
package ui
import (
"github.com/labstack/echo/v4"
)
type AmContext interface {
Render(int, string, interface{}) error
}
type amContext struct {
echoContext echo.Context
}
func (c *amContext) Render(code int, name string, data interface{}) error {
return c.echoContext.Render(code, name, data)
}
func NewAmContext(ctxt echo.Context) AmContext {
rc := amContext{
echoContext: ctxt,
}
return &rc
}
+202
View File
@@ -0,0 +1,202 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Front Page - Venice Test</title>
<link rel="icon" href="http://necrovenice:8080/venice/images/venice-icon.png" type="image/png">
<link rel="shortcut icon" href="http://necrovenice:8080/venice/images/venice-favicon.ico">
<meta http-equiv="refresh" content="300">
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-blue-400 font-sans">
<!-- PAGE HEADER -->
<div class="bg-blue-600 w-full">
<div class="flex items-center justify-between px-2 py-2">
<!-- Site Logo -->
<div class="w-1/5">
<a href="http://venice.sourceforge.net/">
<img src="./venice-frontpage_files/powered-by-venice.gif"
alt="Venice Test"
class="w-35 h-20 mx-2 my-2">
</a>
</div>
<!-- Navigation Links -->
<div class="w-2/5 text-center">
<div class="text-white font-bold text-base mb-2">
<a href="http://necrovenice:8080/venice/top.js.vs" class="text-yellow-300 hover:text-yellow-400">
Front Page
</a>
</div>
<div class="text-white font-bold text-base">
<a href="http://necrovenice:8080/TODO" class="text-yellow-300 hover:text-yellow-400">Help</a>
<span class="mx-2">|</span>
<a href="http://necrovenice:8080/venice/find.js.vs" class="text-yellow-300 hover:text-yellow-400">Find</a>
</div>
</div>
<!-- Banner Ad -->
<div class="w-2/5 flex justify-end">
<img src="./venice-frontpage_files/midler.gif"
alt=""
class="w-96 h-15 mx-2 my-2">
</div>
</div>
<!-- Login Section -->
<div class="bg-blue-600 text-center py-2">
<span class="text-white text-base">
You are not logged in
<span class="mx-2">-</span>
<a href="http://necrovenice:8080/venice/login.js.vs?tgt=top.js.vs"
class="text-yellow-300 hover:text-yellow-400">Log In</a>
<span class="mx-2">|</span>
<a href="http://necrovenice:8080/venice/new_account.js.vs?tgt=top.js.vs"
class="text-yellow-300 hover:text-yellow-400">Create Account</a>
</span>
</div>
</div>
<!-- MAIN CONTENT AREA -->
<div class="flex">
<!-- LEFT SIDEBAR -->
<div class="w-32 bg-blue-400 p-2">
<div class="mb-4">
<div class="text-black text-sm">
<div class="font-bold mb-1">Front Page</div>
<div class="text-gray-500 mb-1">Calendar</div>
<div class="text-gray-500">Chat</div>
</div>
</div>
<div class="mt-4">
<div class="text-black text-sm">
<div class="font-bold mb-1">About This Site</div>
<div class="text-gray-500 mb-1">Documentation</div>
<a href="http://necrovenice:8080/venice/frame/about-venice.html"
class="text-blue-700 hover:text-blue-900">About Venice</a>
</div>
</div>
</div>
<!-- MAIN CONTENT -->
<div class="flex-1 bg-white">
<div class="flex">
<!-- 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>
<!-- Venice Currents Section -->
<div>
<h2 class="text-blue-800 text-4xl font-bold mb-2">Venice Currents</h2>
<hr class="border-2 border-gray-400 w-4/5 mb-4">
<div class="text-black text-sm">
<div class="mb-2">
<strong>Amy, formerly Eric</strong>
(<em>
<a href="http://necrovenice:8080/venice/user/Administrator"
target="_blank"
class="text-blue-700 hover:text-blue-900">Administrator</a>,
Sep 8, 2025 5:17:02 PM
</em>)
</div>
<pre class="mb-4 whitespace-pre-wrap">This is a test.
This is only a test.
If this had been an <em>actual</em> emergency, we would all be
dead by now.</pre>
<div class="text-xs italic">
(From the topic: <a href="http://necrovenice:8080/venice/go/Piazza!General.1"
class="text-blue-700 hover:text-blue-900">It Works Again!</a>)
</div>
</div>
</div>
</div>
<!-- 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>
</div>
</div>
</div>
</div>
<!-- FOOTER -->
<div class="flex">
<div class="w-32 bg-blue-400">&nbsp;</div>
<div class="flex-1 bg-white p-4">
<hr class="border-gray-400 w-4/5 mx-auto mb-4">
<div class="flex justify-center items-start gap-6">
<div class="text-right text-xs text-black leading-relaxed">
All trademarks and copyrights on this page are owned by their respective companies.<br>
All messages posted by users on this page are owned by those users.<br>
The rest: Copyright © 2001-2006
<a href="http://www.silverwrist.com/" class="text-blue-700 hover:text-blue-900">Silverwrist Design Studios</a>,
All Rights Reserved.<br>
See our <a href="http://necrovenice:8080/TODO" class="text-blue-700 hover:text-blue-900">Policy Page</a>
for our copyright and privacy policies.
</div>
<div class="flex-shrink-0">
<a href="http://venice.users.sf.net/" target="_blank">
<img src="./venice-frontpage_files/powered-by-venice.gif"
alt="Powered By Venice"
class="w-32 h-26">
</a>
</div>
</div>
</div>
</div>
</body>
</html>