diff --git a/conferenceadmin.go b/conferenceadmin.go index 9ac1a44..9a8c9e0 100644 --- a/conferenceadmin.go +++ b/conferenceadmin.go @@ -436,6 +436,34 @@ func ConfCustom(ctxt ui.AmContext) (string, any) { return "redirect", fmt.Sprintf("/comm/%s/conf/%s/manage", comm.Alias, ctxt.GetScratch("currentAlias")) } +/* ConfReports displays conference activity reports. + * Parameters: + * ctxt - The AmContext for the request. + * Returns: + * Command string dictating what to be rendered. + * Data as a parameter for the command string. + */ +func ConfReports(ctxt ui.AmContext) (string, any) { + comm := ctxt.CurrentCommunity() + conf := ctxt.GetScratch("currentConference").(*database.Conference) + ctxt.VarMap().Set("confName", conf.Name) + ctxt.VarMap().Set("selfLink", fmt.Sprintf("/comm/%s/conf/%s/activity", comm.Alias, ctxt.GetScratch("currentAlias"))) + + if ctxt.HasParameter("r") { + // TODO: generate report here + return "error", nil + } else { + topicList, err := database.AmListTopics(ctxt.Ctx(), conf.ConfId, ctxt.CurrentUserId(), database.TopicViewAll, database.TopicSortNumber, true) + if err != nil { + return "error", err + } + ctxt.VarMap().Set("topics", topicList) + ctxt.VarMap().Set("backLink", fmt.Sprintf("/comm/%s/conf/%s/manage", comm.Alias, ctxt.GetScratch("currentAlias"))) + ctxt.SetFrameTitle(fmt.Sprintf("Conference Reports: %s", conf.Name)) + return "framed", "conf_reports.jet" + } +} + /* CreateConferenceForm displays the dialog for creating a new conference. * Parameters: * ctxt - The AmContext for the request. diff --git a/main.go b/main.go index 9e3f978..08d0fab 100644 --- a/main.go +++ b/main.go @@ -121,6 +121,7 @@ func setupEcho() *echo.Echo { confGroup.POST("/members", fn) confGroup.GET("/custom", ui.AmWrap(ConfCustomForm)) confGroup.POST("/custom", ui.AmWrap(ConfCustom)) + confGroup.GET("/activity", ui.AmWrap(ConfReports)) 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/menudefs.yaml b/ui/menudefs.yaml index f64d595..3fde818 100644 --- a/ui/menudefs.yaml +++ b/ui/menudefs.yaml @@ -100,7 +100,7 @@ menudefs: - text: "Customize Conference Appearance" link: "/comm/[CID]/conf/[CONFID]/custom" - text: "Conference Activity Reports" - link: "/TODO/comm/[CID]/conf/[CONFID]/activity" + link: "/comm/[CID]/conf/[CONFID]/activity" - text: "Conference E-Mail" link: "/TODO/comm/[CID]/conf/[CONFID]/email" - text: "Export Messages" diff --git a/ui/views/conf_aliases.jet b/ui/views/conf_aliases.jet index 127ecaa..2f4643f 100644 --- a/ui/views/conf_aliases.jet +++ b/ui/views/conf_aliases.jet @@ -32,7 +32,10 @@
About Activity Reports:
+View detailed activity reports for each topic in this conference. The Posters report shows who has posted messages, + while the Readers/Lurkers report shows who has read topics.
+| # | +Topic Name | +Reports | +|
|---|---|---|---|
| + | (Entire conference) | ++ + 👥 + Posters + + | ++ + 👀 + Readers/Lurkers + + | +
| {{ top.Number }} | +{{ top.Name | raw }} | ++ + 👥 + Posters + + | ++ + 👀 + Readers/Lurkers + + | +