{{description}} {{#pix}}e/cancel, core, Stundenplan schließen{{/pix}}
{{#saturday}}{{/saturday}} {{#periods}} {{#days}} {{/days}} {{/periods}}
{{date}}
MoDiMiDoFrSa
{{number}} {{#lessons}} {{#status}}
---
{{/status}} {{^status}}
{{subject}}
{{class}}
{{teacher}}
{{room}}
{{/status}} {{/lessons}}
{{#pix}}i/show, core, Klassen anzeigen{{/pix}}Klassen
{{#pix}}i/hide, core, Lehrer ausblenden{{/pix}}Lehrer
{{#pix}}i/show, core, Fächer anzeigen{{/pix}}Fächer
{{#pix}}i/show, core, Räume anzeigen{{/pix}}Räume
{{# js }} require([ 'jquery','core/ajax','core/templates', 'core/notification' ] , function($, ajax, templates, notification) { function load_timetable(type, name, week, id) { //alert($("#"+id)); //alert("type: "+type); //alert("Week: "+week); var promises = ajax.call([ { methodname: 'mod_timetable_get', args: { type: type, name: name, week: week } }, ]); promises[0].done(function(response) { console.log('mod_timetable/get is' + response); templates.render('mod_timetable/timetable',response).done(function(html, js) { $("#"+id).replaceWith(html); templates.runTemplateJS(js); }).fail(notification.exception); }).fail(function(ex) { // do something with the exception }); } function select_type(type) { $(".subject").hide(); $(".class").hide(); $(".teacher").hide(); $(".room").hide(); $("."+type).show(); block_timetable_type = type; } //alert("Hi, this is a test"); $(".nextweek").click(function() { load_timetable($(event.target).data('type'), $(event.target).data('name'), $(event.target).data('week'), $(event.target).data('id')); //.parentNode.parentNode.parentNode.parentNode); }); $(".prevweek").click(function() { load_timetable($(event.target).data('type'), $(event.target).data('name'), $(event.target).data('week'), $(event.target).data('id')); //.parentNode.parentNode.parentNode); }); $(".block_timetable_select").click(function() { select_type($(event.target).data('type')); }); if (typeof block_timetable_type !== 'undefined') { console.log("block_timetable_type found:"+block_timetable_type); select_type(block_timetable_type); } else { select_type('subject'); } }); {{/ js }}