diff options
Diffstat (limited to 'www/js/todo.js')
-rw-r--r-- | www/js/todo.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/www/js/todo.js b/www/js/todo.js index 259c123..88b8aa4 100644 --- a/www/js/todo.js +++ b/www/js/todo.js @@ -37,6 +37,7 @@ rh.ShowList = function(d) { } else { this.current = d; } + this.current_week = get_rd_week(this.current.valueOf()); }; rh.ShowList.prototype.fetch = function() { @@ -83,7 +84,24 @@ rh.ShowListView = function(model) { rh.ShowListView.prototype.render = function() { var hdr = $('#header'); - $('div.date', hdr).text(format_date(this.model.current)); + $('span.date', hdr).text(format_date(this.model.current)); + var weekspan = $('span.week', hdr).removeClass().addClass('week').addClass('label'); + switch(this.model.current_week) { + case 1: + weekspan.addClass('label-info').text('Woche 1'); + break; + case 2: + weekspan.addClass('label-warning').text('Woche 2'); + break; + case 3: + weekspan.addClass('label-success').text('Woche 3'); + break; + case 4: + weekspan.addClass('label-danger').text('Woche 4'); + break; + default: + weekspan.addClass('label-default').text('Fehler'); + } var list = $('#shows'); $('div.show', list).remove(); |