added filtered user display/removal to topic management page

This commit is contained in:
2026-01-28 23:16:46 -07:00
parent 17471f292a
commit 05378156d3
4 changed files with 66 additions and 3 deletions
+30 -2
View File
@@ -360,9 +360,37 @@ func TopicManage(ctxt ui.AmContext) (string, any, error) {
}
ctxt.VarMap().Set("canInvite", member)
ctxt.VarMap().Set("subscribed", false) // TODO
ctxt.VarMap().Set("bozos", make([]string, 0)) // TODO
// Get the filtered users list.
bozos, err := topic.GetBozos(ctxt.Ctx(), ctxt.CurrentUser())
if err != nil {
return ui.ErrorPage(ctxt, err)
}
ctxt.VarMap().Set("bozos", bozos)
ctxt.VarMap().Set("subscribed", false) // TODO
ctxt.VarMap().Set("amsterdam_pageTitle", "Manage Topic: "+topic.Name)
return "framed_template", "manage_topic.jet", nil
}
/* TopicRemoveBozo removes filtering from a specified user in the topic.
* Parameters:
* ctxt - The AmContext for the request.
* Returns:
* Command string dictating what to be rendered.
* Data as a parameter for the command string.
* Standard Go error status.
*/
func TopicRemoveBozo(ctxt ui.AmContext) (string, any, error) {
comm := ctxt.CurrentCommunity()
topic := ctxt.GetScratch("currentTopic").(*database.Topic)
bozoUid, err := strconv.Atoi(ctxt.URLParam("uid"))
if err != nil {
return ui.ErrorPage(ctxt, err)
}
err = topic.SetBozo(ctxt.Ctx(), ctxt.CurrentUser(), int32(bozoUid), false)
if err != nil {
return ui.ErrorPage(ctxt, err)
}
return "redirect", fmt.Sprintf("/comm/%s/conf/%s/op/%d/manage", comm.Alias, ctxt.GetScratch("currentAlias"), topic.Number), nil
}