From 9ec2310a722583711cfa0f861d4078abf929708f Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Mon, 19 Jan 2026 16:17:42 -0700 Subject: [PATCH] cleaned up some template issues and fixed an issue with open-ended ranges in the go box on posts display --- conference.go | 16 +++++++++++----- ui/views/posts.jet | 14 +++++++++++--- ui/views/singlepost.jet | 3 ++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/conference.go b/conference.go index 8452393..30056e6 100644 --- a/conference.go +++ b/conference.go @@ -350,11 +350,15 @@ func breakRange(topic *database.Topic, into []int32, param string, sep string) e } into[0] = int32(v) if len(rstr) > 1 { - v, err = strconv.ParseInt(strings.TrimSpace(rstr[1]), 10, 32) - if err != nil { - return fmt.Errorf("posts not found: %s in topic %d", param, topic.Number) + if len(rstr[1]) == 0 { + into[1] = -1 + } else { + v, err = strconv.ParseInt(strings.TrimSpace(rstr[1]), 10, 32) + if err != nil { + return fmt.Errorf("posts not found: %s in topic %d", param, topic.Number) + } + into[1] = int32(v) } - into[1] = int32(v) } else { into[1] = into[0] } @@ -566,7 +570,9 @@ func ReadPosts(ctxt ui.AmContext) (string, any, error) { ctxt.VarMap().Set("isSticky", topic.Sticky) confNukePerm := conf.TestPermission("Conference.Nuke", myLevel) ctxt.VarMap().Set("canDelete", confNukePerm) - ctxt.VarMap().Set("canPost", (!(topic.Frozen || topic.Archived) || confHidePerm) && conf.TestPermission("Conference.Post", myLevel)) + confPostPerm := conf.TestPermission("Conference.Post", myLevel) + ctxt.VarMap().Set("canPost", (!(topic.Frozen || topic.Archived) || confHidePerm) && confPostPerm) + ctxt.VarMap().Set("showFrozenArchiveMessages", confPostPerm) // Set advanced controls. advancedControls := ctxt.HasParameter("ac") && (len(posts) == 1) diff --git a/ui/views/posts.jet b/ui/views/posts.jet index b834297..7e2ec54 100644 --- a/ui/views/posts.jet +++ b/ui/views/posts.jet @@ -90,10 +90,10 @@ -
- [Permalink to this topic] + @@ -203,6 +203,14 @@
+ {{ else if showFrozenArchiveMessages }} +
+ {{ if isArchived }} + This Is an Archived Topic + {{ else if isFrozen }} + This Is a Frozen Topic + {{ end }} +
{{ end }} diff --git a/ui/views/singlepost.jet b/ui/views/singlepost.jet index 4a6afb1..cde5123 100644 --- a/ui/views/singlepost.jet +++ b/ui/views/singlepost.jet @@ -11,7 +11,8 @@
{{ post_cur.Num }} of {{ post_max }} - 🔗 <{{ post_confRef }}.{{ post_cur.Num }}> + 🔗<{{ post_confRef }}.{{ post_cur.Num }}>