begin of schedule editor

This commit is contained in:
Mathieu Lagace
2019-12-21 18:40:01 -05:00
parent 90b551ad31
commit 997abf460e
19 changed files with 1954 additions and 225 deletions

38
public/js/plugins/schedule/editor.js vendored Normal file
View File

@@ -0,0 +1,38 @@
function initScheduleEditor(id, periode, niveau)
{
$.ajax({
type: 'GET',
url: '/api/schedule/editor/init?api_token='+api_token,
success: function (template) {
$("#"+id).html(template);
for (let pniveau = 1; pniveau <= 3; pniveau++) {
for (let pperiode = 1; pperiode <= 3; pperiode++) {
loadCourse(pniveau,pperiode);
}
}
initAutoComplete("AutoComplete");
},
error: function () {
showNotification('error','Impossible d\'initialiser l\'éditeur d\'horaire ...','top', 'center')
}
})
}
function loadTemplate(id)
{
$.get('/api/schedule/editor/init?api_token='+api_token, function ( data ) {$("#"+id).html(data);});
}
function loadCourse(periode,niveau)
{
$.ajax({
type: 'GET',
url: '/api/schedule/editor/course/'+niveau+'/'+periode+'?api_token='+api_token,
success: function (course) {
$("#container-"+niveau+"-"+periode).html(course);
},
error: function () {
showNotification('error','Impossible de charger les cours ...','top', 'center')
}
})
}