hook up the "delete conference" link on the "manage conference" page
This commit is contained in:
@@ -733,6 +733,42 @@ func ConferenceExport(ctxt ui.AmContext) (string, any) {
|
|||||||
return "stream", r
|
return "stream", r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DeleteConference handles the deletion of a conference from its operations menu.
|
||||||
|
* Parameters:
|
||||||
|
* ctxt - The AmContext for the request.
|
||||||
|
* Returns:
|
||||||
|
* Command string dictating what to be rendered.
|
||||||
|
* Data as a parameter for the command string.
|
||||||
|
*/
|
||||||
|
func DeleteConference(ctxt ui.AmContext) (string, any) {
|
||||||
|
comm := ctxt.CurrentCommunity()
|
||||||
|
conf := ctxt.GetScratch("currentConference").(*database.Conference)
|
||||||
|
myLevel := ctxt.GetScratch("levelInConference").(uint16)
|
||||||
|
if !conf.TestPermission("Conference.Delete", myLevel) {
|
||||||
|
return "error", ENOPERM
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the message box, and, if we have a valid "yes," then perform the delete
|
||||||
|
mbox, err := ui.AmLoadMessageBox("deleteConf")
|
||||||
|
if err != nil {
|
||||||
|
return "error", err
|
||||||
|
}
|
||||||
|
if mbox.Validate(ctxt, "yes") {
|
||||||
|
err := conf.Delete(ctxt.Ctx(), comm, ctxt.CurrentUser(), ctxt.RemoteIP(), ampool)
|
||||||
|
if err != nil {
|
||||||
|
return "error", err
|
||||||
|
}
|
||||||
|
return "redirect", fmt.Sprintf("/comm/%s/conf", ctxt.CurrentCommunity().Alias)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up to display the message box.
|
||||||
|
mbox.SetMessage(fmt.Sprintf(`You are about to delete the conference <span class="font-bold text-red-600">"%s"</span>
|
||||||
|
from the <span class="font-bold text-red-600">"%s"</span> community!`, conf.Name, comm.Name))
|
||||||
|
mbox.SetLink("no", fmt.Sprintf("/comm/%s/conf/%s/manage", ctxt.CurrentCommunity().Alias, ctxt.GetScratch("currentAlias")))
|
||||||
|
mbox.SetLink("yes", fmt.Sprintf("/comm/%s/conf/%s/delete", ctxt.CurrentCommunity().Alias, ctxt.GetScratch("currentAlias")))
|
||||||
|
return mbox.Render(ctxt)
|
||||||
|
}
|
||||||
|
|
||||||
/* CreateConferenceForm displays the dialog for creating a new conference.
|
/* CreateConferenceForm displays the dialog for creating a new conference.
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ctxt - The AmContext for the request.
|
* ctxt - The AmContext for the request.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ _(italicized items can be deferred)_
|
|||||||
- ~~User Account Management~~
|
- ~~User Account Management~~
|
||||||
- System Audit Logs
|
- System Audit Logs
|
||||||
- Import User Accounts
|
- Import User Accounts
|
||||||
- Conferences list:
|
- ~~Conferences list:~~
|
||||||
- ~~Find~~
|
- ~~Find~~
|
||||||
- ~~Manage (reorder/show/hide/delete)~~
|
- ~~Manage (reorder/show/hide/delete)~~
|
||||||
- ~~Create New~~
|
- ~~Create New~~
|
||||||
@@ -70,7 +70,7 @@ _(italicized items can be deferred)_
|
|||||||
- ~~E-mail~~
|
- ~~E-mail~~
|
||||||
- ~~Export Messages~~
|
- ~~Export Messages~~
|
||||||
- Import Messages
|
- Import Messages
|
||||||
- Delete Conference
|
- ~~Delete Conference~~
|
||||||
- ~~Add to Hotlist/Remove from Hotlist~~
|
- ~~Add to Hotlist/Remove from Hotlist~~
|
||||||
- Related to bugs in Export Messages caused by bad data:
|
- Related to bugs in Export Messages caused by bad data:
|
||||||
- Provide a per-conference flag that will set BuggyAttachment behavior
|
- Provide a per-conference flag that will set BuggyAttachment behavior
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ func setupEcho() *echo.Echo {
|
|||||||
confGroup.POST("/email", ui.AmWrap(ConferenceEmail))
|
confGroup.POST("/email", ui.AmWrap(ConferenceEmail))
|
||||||
confGroup.GET("/export", ui.AmWrap(ConferenceExportForm))
|
confGroup.GET("/export", ui.AmWrap(ConferenceExportForm))
|
||||||
confGroup.POST("/export", ui.AmWrap(ConferenceExport))
|
confGroup.POST("/export", ui.AmWrap(ConferenceExport))
|
||||||
|
confGroup.GET("/delete", ui.AmWrap(DeleteConference))
|
||||||
confGroup.GET("/hotlist", ui.AmWrap(AddToHotlist))
|
confGroup.GET("/hotlist", ui.AmWrap(AddToHotlist))
|
||||||
confGroup.GET("/invite", ui.AmWrap(InviteToConference))
|
confGroup.GET("/invite", ui.AmWrap(InviteToConference))
|
||||||
confGroup.GET("/r/:topic", ui.AmWrap(ReadPosts), ui.SetTopic)
|
confGroup.GET("/r/:topic", ui.AmWrap(ReadPosts), ui.SetTopic)
|
||||||
|
|||||||
+1
-1
@@ -108,5 +108,5 @@ menudefs:
|
|||||||
- text: "Import Messages"
|
- text: "Import Messages"
|
||||||
link: "/TODO/comm/[CID]/conf/[CONFID]/import"
|
link: "/TODO/comm/[CID]/conf/[CONFID]/import"
|
||||||
- text: "Delete Conference"
|
- text: "Delete Conference"
|
||||||
link: "/TODO/comm/[CID]/conf/[CONFID]/delete"
|
link: "/comm/[CID]/conf/[CONFID]/delete"
|
||||||
hazard: true
|
hazard: true
|
||||||
|
|||||||
Reference in New Issue
Block a user