Commit 5bba6f08 authored by Corey Jepperson's avatar Corey Jepperson

mtc-1341 confirmation dialog on deactivation

parent b3764b19
......@@ -198,11 +198,32 @@ function isCollection(path){
/***************************************************************************************/
module.exports.deactivate=function(baseUrl, blProxyPrefix){
var $dialog = buildDialog({
saveText: "Deactivate Page"
});
var $dialogBody = $dialog.find(".modal-content");
var titleBar=$dialog.titleBar("Deactivate");
var html=[titleBar,
`<form>
<div class="row">
<div class="col s12" style="margin:24px; width:calc(100% - 48px);">
`];
html.push("<h5>Dectivate this page?</h5>");
html.push(`</div></div></form>`);
$dialogBody.html(html.join(" "));
////////////////////////////////////////////////////////////////////////////////////
$dialog.find(".bl-save-button").click(function(){
// if this is a collection item, then after deactivation show a list of stubs which could be deactivated
activateOrDeactivate("Deactivate", [baseUrl], blProxyPrefix, (err)=>{
$dialog.closeModal();
if(err){Materialize.toast("Error deactivating. See web console for details."); console.error("Error deactivating " + baseUrl, err); return;}
Materialize.toast("Page deactivation successful", 4000, "rounded")
});
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment