diff --git a/conferenceadmin.go b/conferenceadmin.go index de59aed..31ef482 100644 --- a/conferenceadmin.go +++ b/conferenceadmin.go @@ -654,6 +654,33 @@ func ConferenceEmail(ctxt ui.AmContext) (string, any) { return "redirect", fmt.Sprintf("/comm/%s/conf/%s/manage", comm.Alias, ctxt.GetScratch("currentAlias")) } +/* ConferenceExportForm displays the form for exporting data from a conference. + * Parameters: + * ctxt - The AmContext for the request. + * Returns: + * Command string dictating what to be rendered. + * Data as a parameter for the command string. + */ +func ConferenceExportForm(ctxt ui.AmContext) (string, any) { + comm := ctxt.CurrentCommunity() + conf := ctxt.GetScratch("currentConference").(*database.Conference) + myLevel := ctxt.GetScratch("levelInConference").(uint16) + if !conf.TestPermission("Conference.Change", myLevel) { + return "error", ENOPERM + } + + topics, err := database.AmListTopics(ctxt.Ctx(), conf.ConfId, ctxt.CurrentUserId(), database.TopicViewAll, database.TopicSortNumber, true) + if err != nil { + return "error", err + } + + ctxt.VarMap().Set("topics", topics) + ctxt.VarMap().Set("confName", conf.Name) + ctxt.VarMap().Set("selfLink", fmt.Sprintf("/comm/%s/conf/%s/export", comm.Alias, ctxt.GetScratch("currentAlias"))) + ctxt.SetFrameTitle(fmt.Sprintf("Export Messages: %s", conf.Name)) + return "framed", "conf_export.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 2fa89f4..643e6b3 100644 --- a/main.go +++ b/main.go @@ -124,6 +124,7 @@ func setupEcho() *echo.Echo { confGroup.GET("/activity", ui.AmWrap(ConfReports)) confGroup.GET("/email", ui.AmWrap(ConferenceEmailForm)) confGroup.POST("/email", ui.AmWrap(ConferenceEmail)) + confGroup.GET("/export", ui.AmWrap(ConferenceExportForm)) 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 eda33c9..18b9a6d 100644 --- a/ui/menudefs.yaml +++ b/ui/menudefs.yaml @@ -104,7 +104,7 @@ menudefs: - text: "Conference E-Mail" link: "/comm/[CID]/conf/[CONFID]/email" - text: "Export Messages" - link: "/TODO/comm/[CID]/conf/[CONFID]/export" + link: "/comm/[CID]/conf/[CONFID]/export" - text: "Import Messages" link: "/TODO/comm/[CID]/conf/[CONFID]/import" - text: "Delete Conference" diff --git a/ui/views/conf_export.jet b/ui/views/conf_export.jet new file mode 100644 index 0000000..892b3d2 --- /dev/null +++ b/ui/views/conf_export.jet @@ -0,0 +1,101 @@ +{* + * Amsterdam Web Communities System + * Copyright (c) 2025-2026 Erbosoft Metaverse Design Solutions, All Rights Reserved + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + *} +
+ +
+
+

Export Messages

+

Conference: {{ confName }}

+
+
+
+ + +
+
+ 📦 +
+

About Message Export:

+

Select the topics you want to export. Messages from selected topics will be exported in VCIF/XML format. Use the buttons below to quickly select or deselect all topics.

+
+
+
+ + +
+
+ +
+
+

+ ☑️ + Select Topics to Export +

+
+ + +
+
+ + +
+
+ + + {{ range _, t := topics }} + + + + + + {{ end }} + +
+ + {{ t.Number }}.{{ t.Name | raw }}
+
+
+
+ + +
+ + +
+
+
+
+