From 852558ff30ed71b337e35b3cf585f1cba785455e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 4 Dec 2016 00:29:14 +0100 Subject: handle special shows correctly diff --git a/www/js/shows.js b/www/js/shows.js index 328181a..c76d173 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -128,7 +128,7 @@ Rdxport.ShowListView.prototype.updateSelector = function() { if(show.type == "r") { title += " (Wiederholung)"; } - var name = show.id + ' | ' + title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; + var name = show.id + ' | ' + title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + (show.length == 0 ? '-' : show.length) + ' Min.)'; var link = $('').attr('href', '#').html(name).click(function() { self.setCurrentShowId(show.id); self.getCurrentShowView().model.fetchCarts(); @@ -175,6 +175,8 @@ Rdxport.Show = function(groupName, description, lowcart, highcart, normlevel, tr this.length = length; this.type = type; } + this.dayofweek = (this.dayofweek < 0 || this.dayofweek > 7) ? 7 : this.dayofweek; + this.length = (this.length < 0) ? 0 : this.length; this.logs = []; }; @@ -237,12 +239,14 @@ Rdxport.ShowView = function(model) { Rdxport.ShowView.prototype.render = function() { if(this.model.type == 'r') { $('#show-title').text(this.model.title + " (Wiederholung)"); + } else if(this.model.type == 's') { + $('#show-title').text(this.model.title + " (Sondersendung)"); } else { $('#show-title').text(this.model.title); } $('#show-dow').text(weekday[this.model.dayofweek]); $('#show-starttime').text(this.model.starttime); - $('#show-length').text(this.model.length + ' Min.'); + $('#show-length').text((this.model.length == 0 ? '-' : this.model.length) + ' Min.'); for(var w = 0; w < 4; w++) { if(this.model.rhythm.charAt(w) == '1') { diff --git a/www/js/utils.js b/www/js/utils.js index a5629b2..c0b006e 100644 --- a/www/js/utils.js +++ b/www/js/utils.js @@ -60,8 +60,9 @@ weekday[3] = 'Mittwoch'; weekday[4] = 'Donnerstag'; weekday[5] = 'Freitag'; weekday[6] = 'Samstag'; +weekday[7] = '-'; -var weekday_short = ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa']; +var weekday_short = ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', '-']; function format_datetime(d) { if(Object.prototype.toString.call(d) !== '[object Date]') { -- cgit v0.10.2