diff --git a/conference_ops.go b/conference_ops.go index 43ac483..70ea838 100644 --- a/conference_ops.go +++ b/conference_ops.go @@ -165,6 +165,25 @@ func ConfManage(ctxt ui.AmContext) (string, any, error) { return "framed_template", "manage_conf.jet", nil } +/* SetPseud sets the user's default pseud for the conference. + * 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 SetPseud(ctxt ui.AmContext) (string, any, error) { + comm := ctxt.CurrentCommunity() + conf := ctxt.GetScratch("currentConference").(*database.Conference) + pseud := ctxt.FormField("pseud") + err := conf.SetDefaultPseud(ctxt.Ctx(), ctxt.CurrentUser(), pseud) + if err != nil { + return ui.ErrorPage(ctxt, err) + } + return "redirect", fmt.Sprintf("/comm/%s/conf/%s/manage", comm.Alias, ctxt.GetScratch("currentAlias")), nil +} + /* AddToHotlist adds the current community and conference to the user's hotlist.. * Parameters: * ctxt - The AmContext for the request. diff --git a/main.go b/main.go index 24119f2..1c62441 100644 --- a/main.go +++ b/main.go @@ -104,6 +104,7 @@ func setupEcho() *echo.Echo { confGroup.GET("/new_topic", ui.AmWrap(NewTopicForm)) confGroup.POST("/new_topic", ui.AmWrap(NewTopic)) confGroup.GET("/manage", ui.AmWrap(ConfManage)) + confGroup.POST("/pseud", ui.AmWrap(SetPseud)) confGroup.GET("/hotlist", ui.AmWrap(AddToHotlist)) confGroup.GET("/invite", ui.AmWrap(InviteToConference)) confGroup.GET("/r/:topic", ui.AmWrap(ReadPosts), ui.SetTopic) diff --git a/ui/views/manage_conf.jet b/ui/views/manage_conf.jet index f4cde33..184455d 100644 --- a/ui/views/manage_conf.jet +++ b/ui/views/manage_conf.jet @@ -21,7 +21,7 @@
-
+