on manage conference list, wired up "move up," "move down," and "show/hide" commands

This commit is contained in:
2026-02-19 23:02:03 -07:00
parent 68fa307736
commit 831c6c5524
2 changed files with 62 additions and 0 deletions
+36
View File
@@ -803,11 +803,47 @@ func ManageConferenceList(ctxt ui.AmContext) (string, any) {
return "error", ENOPERM
}
if ctxt.HasParameter("t") {
confid := ctxt.QueryParamInt("t", -1)
if confid == -1 {
return "error", EINVAL
}
conf, err := database.AmGetConference(ctxt.Ctx(), int32(confid))
if err != nil {
return "error", err
}
f, err := conf.HiddenInList(ctxt.Ctx(), comm)
if err == nil {
err = conf.SetHiddenInList(ctxt.Ctx(), comm, !f)
}
if err != nil {
return "error", err
}
}
clist, err := database.AmListConferences(ctxt.Ctx(), comm.Id, true)
if err != nil {
return "error", err
}
if ctxt.HasParameter("m") {
index := ctxt.QueryParamInt("m", -1)
if index == -1 {
return "error", EINVAL
}
delta := ctxt.QueryParamInt("n", 0)
if delta == 0 {
return "error", EINVAL
}
err = database.AmReorderConferences(ctxt.Ctx(), comm.Id, clist[index].Sequence, clist[index+delta].Sequence)
if err != nil {
return "error", err
}
tmp := clist[index]
clist[index] = clist[index+delta]
clist[index+delta] = tmp
}
ntopics := make([]int, len(clist))
nposts := make([]int, len(clist))
for i, c := range clist {