{{description}} x
{{#saturday}} {{/saturday}} {{#periods}} {{#days}} {{/days}} {{/periods}}
{{date}}
Mo Di Mi Do FrSamstag
{{number}} {{#lessons}} {{#status}}
---
{{/status}} {{^status}}
{{subject}}
{{class}}
{{teacher}}
{{room}}
{{/status}} {{/lessons}}
{{# 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 }); } //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); }); }); {{/ js }}