From 64faf9ec4d8590300bd3fb7a2642b24b31a556b9 Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Sat, 31 Jan 2026 23:25:44 -0700 Subject: [PATCH] set up front end pages for Find in Community/Conference/Topic --- docs/MISSINGFUNCS.md | 2 +- find.go | 44 +++++++++++++ main.go | 3 + ui/views/conflist.jet | 2 +- ui/views/find_posts.jet | 138 ++++++++++++++++++++++++++++++++++++++++ ui/views/posts.jet | 2 +- ui/views/topiclist.jet | 2 +- 7 files changed, 189 insertions(+), 4 deletions(-) create mode 100644 ui/views/find_posts.jet diff --git a/docs/MISSINGFUNCS.md b/docs/MISSINGFUNCS.md index 38a96ee..e362c2d 100644 --- a/docs/MISSINGFUNCS.md +++ b/docs/MISSINGFUNCS.md @@ -21,7 +21,7 @@ _(italicized items can be deferred)_ - Import User Accounts - Conferences list: - Find - - Manage + - Manage (reorder/show/hide/delete) - Create New - Community Admin Menu: - Set Community Category diff --git a/find.go b/find.go index bbc6a42..036bb71 100644 --- a/find.go +++ b/find.go @@ -304,3 +304,47 @@ func Find(ctxt ui.AmContext) (string, any, error) { } return "framed_template", "find.jet", nil } + +func commonFindGetBackend(ctxt ui.AmContext) (string, any, error) { + ofs := 0 + p := ctxt.Parameter("ofs") + if p != "" { + v, err := strconv.Atoi(p) + if err == nil { + ofs = v + } + } + ctxt.VarMap().Set("ofs", ofs) + ctxt.VarMap().Set("term", "") + ctxt.VarMap().Set("amsterdam_pageTitle", "Find Posts") + return "framed_template", "find_posts.jet", nil +} + +func FindPostsPageCommunity(ctxt ui.AmContext) (string, any, error) { + comm := ctxt.CurrentCommunity() + ctxt.VarMap().Set("scope", "community") + ctxt.VarMap().Set("entityName", comm.Name) + ctxt.VarMap().Set("backlink", fmt.Sprintf("/comm/%s/conf", comm.Alias)) + ctxt.VarMap().Set("postlink", fmt.Sprintf("/comm/%s/find", comm.Alias)) + return commonFindGetBackend(ctxt) +} + +func FindPostsPageConference(ctxt ui.AmContext) (string, any, error) { + comm := ctxt.CurrentCommunity() + conf := ctxt.GetScratch("currentConference").(*database.Conference) + ctxt.VarMap().Set("scope", "conference") + ctxt.VarMap().Set("entityName", conf.Name) + ctxt.VarMap().Set("backlink", fmt.Sprintf("/comm/%s/conf/%s", comm.Alias, ctxt.GetScratch("currentAlias"))) + ctxt.VarMap().Set("postlink", fmt.Sprintf("/comm/%s/conf/%s/find", comm.Alias, ctxt.GetScratch("currentAlias"))) + return commonFindGetBackend(ctxt) +} + +func FindPostsPageTopic(ctxt ui.AmContext) (string, any, error) { + comm := ctxt.CurrentCommunity() + topic := ctxt.GetScratch("currentTopic").(*database.Topic) + ctxt.VarMap().Set("scope", "topic") + ctxt.VarMap().Set("entityName", topic.Name) + ctxt.VarMap().Set("backlink", fmt.Sprintf("/comm/%s/conf/%s/r/%d", comm.Alias, ctxt.GetScratch("currentAlias"), topic.Number)) + ctxt.VarMap().Set("postlink", fmt.Sprintf("/comm/%s/conf/%s/op/%d/find", comm.Alias, ctxt.GetScratch("currentAlias"), topic.Number)) + return commonFindGetBackend(ctxt) +} diff --git a/main.go b/main.go index a30306f..3a01fd3 100644 --- a/main.go +++ b/main.go @@ -91,6 +91,7 @@ func setupEcho() *echo.Echo { commGroup.GET("/members", ui.AmWrap(MemberList)) commGroup.POST("/members", ui.AmWrap(MemberSearch)) commGroup.GET("/invite", ui.AmWrap(InviteToCommunity)) + commGroup.GET("/find", ui.AmWrap(FindPostsPageCommunity)) commGroup.GET("/admin", ui.AmWrap(CommunityAdminMenu)) commGroup.GET("/admin/profile", ui.AmWrap(CommunityProfileForm)) commGroup.POST("/admin/profile", ui.AmWrap(EditCommunityProfile)) @@ -103,6 +104,7 @@ func setupEcho() *echo.Echo { confGroup.GET("", ui.AmWrap(Topics)) confGroup.GET("/new_topic", ui.AmWrap(NewTopicForm)) confGroup.POST("/new_topic", ui.AmWrap(NewTopic)) + confGroup.GET("/find", ui.AmWrap(FindPostsPageConference)) confGroup.GET("/manage", ui.AmWrap(ConfManage)) confGroup.POST("/pseud", ui.AmWrap(SetPseud)) confGroup.GET("/fixseen", ui.AmWrap(ConfFixseen)) @@ -111,6 +113,7 @@ func setupEcho() *echo.Echo { confGroup.GET("/r/:topic", ui.AmWrap(ReadPosts), ui.SetTopic) confGroup.POST("/r/:topic", ui.AmWrap(PostInTopic), ui.SetTopic) opsGroup := confGroup.Group("/op/:topic", ui.SetTopic) + opsGroup.GET("/find", ui.AmWrap(FindPostsPageTopic)) opsGroup.GET("/hide", ui.AmWrap(HideTopic)) opsGroup.GET("/freeze", ui.AmWrap(FreezeTopic)) opsGroup.GET("/archive", ui.AmWrap(ArchiveTopic)) diff --git a/ui/views/conflist.jet b/ui/views/conflist.jet index 339f546..9555a39 100644 --- a/ui/views/conflist.jet +++ b/ui/views/conflist.jet @@ -52,7 +52,7 @@
- Find Posts diff --git a/ui/views/find_posts.jet b/ui/views/find_posts.jet new file mode 100644 index 0000000..36f5a0d --- /dev/null +++ b/ui/views/find_posts.jet @@ -0,0 +1,138 @@ +{* + * 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/. + *} +
+ +
+
+

Find Posts

+ {{ if scope == "community" }} + in Community: {{ entityName }} + {{ else if scope == "conference" }} + in Conference: {{ entityName }} + {{ else if scope == "topic" }} + in Topic: {{ entityName | raw }} + {{ end }} +
+
+
+ + +
+ {{ if scope == "community" }} + Return to Conference List + {{ else if scope == "conference" }} + Return to Topic List + {{ else if scope == "topic" }} + Return to Topic + {{ end }} +
+ + {{ if isset(errorMessage) }} + +
+
+
+ ⚠️ +
+
+

{{ CapitalizeString(errorMessage) }}.

+
+
+
+ {{ end }} + + +
+
+ + +
+
+ +
+ Keywords: + +
+ +
+ +
+
+
+
+
+ + {{ if isset(resultHeader) }} + +
+
+
{{ resultHeader }}
+
+ {{ if isset(resultList) }} +
+
+ + + + + + + + + + + + {{ range _, rx := resultList }} + + + + + + + + {{ end }} + +
Post LinkAuthorPost DateLinesPreview
+ {{ rx.PostLink }} + + {{ rx.Author }} + {{ DisplayDateTime( rx.PostDate, .) }}{{ rx.Lines }}{{ rx.Excerpt }}
+
+
+ + {{ if isset(resultShowPrev) || isset(resultShowNext) }} + +
+
+ + + + {{ if isset(resultShowPrev) }} + + {{ end }} + {{ if isset(resultShowNext) }} + + {{ end }} +
+
+ {{ end }} + {{ end }} + {{ end }} +
\ No newline at end of file diff --git a/ui/views/posts.jet b/ui/views/posts.jet index 416adc2..d216fd8 100644 --- a/ui/views/posts.jet +++ b/ui/views/posts.jet @@ -34,7 +34,7 @@ Next & Keep New {{ end }} - Find {{ if !isAnon }} {{ end }} - Find