Commit 79c3469c authored by Ad Schellevis's avatar Ad Schellevis

(cron) add controller for opening a single job

parent 3a889431
......@@ -29,6 +29,40 @@ POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript">
$( document ).ready(function() {
/**
* inline open dialog, go back to previous page on exit
*/
function openDialog(uuid) {
var editDlg = "DialogEdit";
var setUrl = "/api/cron/settings/setJob/";
var getUrl = "/api/cron/settings/getJob/";
var urlMap = {};
urlMap['frm_' + editDlg] = getUrl + uuid;
mapDataToFormUI(urlMap).done(function () {
// update selectors
$('.selectpicker').selectpicker('refresh');
// clear validation errors (if any)
clearFormValidation('frm_' + editDlg);
// show
$('#'+editDlg).modal({backdrop: 'static', keyboard: false});
$('#'+editDlg).on('hidden.bs.modal', function () {
// go back to previous page on exit
parent.history.back();
});
});
// define save action
$("#btn_"+editDlg+"_save").unbind('click').click(function(){
saveFormToEndpoint(url=setUrl+uuid,
formid='frm_' + editDlg, callback_ok=function(){
$("#"+editDlg).modal('hide');
$("#grid-jobs").bootgrid("reload");
}, true);
// go back to where we came from.
});
}
/*************************************************************************************************************
* link grid actions
*************************************************************************************************************/
......@@ -43,6 +77,10 @@ POSSIBILITY OF SUCH DAMAGE.
}
);
{% if (selected_uuid|default("") != "") %}
openDialog(uuid='{{selected_uuid}}');
{% endif %}
/*************************************************************************************************************
* Commands
*************************************************************************************************************/
......
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