cleaned up some template issues and fixed an issue with open-ended ranges in the go box on posts display

This commit is contained in:
2026-01-19 16:17:42 -07:00
parent 4bf11a55ab
commit 9ec2310a72
3 changed files with 24 additions and 9 deletions
+11 -5
View File
@@ -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)
+11 -3
View File
@@ -90,10 +90,10 @@
</div>
<!-- Permalink Info -->
<div class="text-center text-xs text-gray-600 mb-6">
<a href="{{ post_topicPermalink }}" class="text-blue-700 hover:text-blue-900">[Permalink to this topic]</a>
<div class="text-center text-sm text-gray-600 mb-6">
<a href="{{ post_topicPermalink }}" class="text-blue-700 hover:text-blue-900" title="Permalink to this topic">🔗Topic</a>
<span class="mx-2">·</span>
<a href="{{ postsPermalink }}" class="text-blue-700 hover:text-blue-900">[Permalink to these posts]</a>
<a href="{{ postsPermalink }}" class="text-blue-700 hover:text-blue-900" title="Permalink to these posts">🔗Posts</a>
</div>
<!-- Messages -->
@@ -203,6 +203,14 @@
</div>
</div>
</form>
{{ else if showFrozenArchiveMessages }}
<div class="text-center text-md text-gray-600">
{{ if isArchived }}
<b>This Is an <i>Archived</i> Topic</b>
{{ else if isFrozen }}
<b>This Is a <i>Frozen</i> Topic</b>
{{ end }}
</div>
{{ end }}
</div>
</div>
+2 -1
View File
@@ -11,7 +11,8 @@
<div class="text-sm text-gray-600">
<a href="{{ post_stem }}?r={{ post_cur.Num }}&ac=1" class="text-blue-700 hover:text-blue-900 font-mono">{{ post_cur.Num }}</a> of
<a href="{{ post_stem }}?r={{ post_max }}&ac=1" class="text-blue-700 hover:text-blue-900 font-mono">{{ post_max }}</a>
🔗 <a href="{{ post_topicPermalink }}.{{ post_cur.Num }}" class="ml-2 text-xs text-blue-700 hover:text-blue-900">&lt;{{ post_confRef }}.{{ post_cur.Num }}&gt;</a>
<a href="{{ post_topicPermalink }}.{{ post_cur.Num }}" class="ml-2 text-xs text-blue-700 hover:text-blue-900"
title="Permalink to this post">🔗&lt;{{ post_confRef }}.{{ post_cur.Num }}&gt;</a>
</div>
</div>
<div class="mb-2">