mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
38 lines
1.2 KiB
JavaScript
Vendored
38 lines
1.2 KiB
JavaScript
Vendored
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')
|
|
}
|
|
})
|
|
} |