diff options
author | Christian Pointner <equinox@helsinki.at> | 2017-01-14 03:30:22 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2017-01-14 03:30:22 (GMT) |
commit | deaa31e2269b4f13ddf777a4c05a57dc26d7bba1 (patch) | |
tree | fc87d180d9d3ec933d49abbda7c7af6b3433bc35 /www/js | |
parent | 39e95df6f4a2677bb0023c1b787c7cef0ebaee25 (diff) |
add week badge
Diffstat (limited to 'www/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(); |