From 08298703d0f387dc5376af9380938b7dd64a212a Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 25 Nov 2016 23:23:29 +0100 Subject: use newly introduced show type when displaying show title diff --git a/www/js/shows.js b/www/js/shows.js index d58aa66..328181a 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -99,7 +99,13 @@ Rdxport.ShowListView.prototype.updateSelector = function() { $(this.model.groups).sort(function(a, b) { var atitle = a.title.toLowerCase(); + if(a.type == "r") { + atitle += " (Wiederholung)"; + } var btitle = b.title.toLowerCase(); + if(b.type == "r") { + btitle += " (Wiederholung)"; + } if(atitle == btitle) { if(b.rhythm == a.rhythm) { if(a.dayofweek == b.dayofweek) { @@ -118,7 +124,11 @@ Rdxport.ShowListView.prototype.updateSelector = function() { if(atitle > btitle) return 1; return -1; }).each(function(index, show) { - var name = show.id + ' | ' + show.title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; + var title = show.title; + if(show.type == "r") { + title += " (Wiederholung)"; + } + var name = show.id + ' | ' + title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; var link = $('').attr('href', '#').html(name).click(function() { self.setCurrentShowId(show.id); self.getCurrentShowView().model.fetchCarts(); @@ -143,7 +153,7 @@ Rdxport.ShowListView.prototype.updateSelector = function() { }; Rdxport.Show = function(groupName, description, lowcart, highcart, normlevel, trimlevel, - id, title, log, rhythm, dayofweek, starttime, length) { + id, title, log, rhythm, dayofweek, starttime, length, type) { if (arguments.length = 1) { Rdxport.Group.call(this, groupName); this.id = parseInt($('show-id', this.xml).text()); @@ -153,6 +163,7 @@ Rdxport.Show = function(groupName, description, lowcart, highcart, normlevel, tr this.dayofweek = parseInt($('show-dayofweek', this.xml).text()); this.starttime = $('show-starttime', this.xml).text(); this.length = parseInt($('show-length', this.xml).text()); + this.type = $('show-type', this.xml).text(); } else { Rdxport.Group.call(this, groupName, description, lowcart, highcart, normlevel, trimlevel); this.id = id; @@ -162,6 +173,7 @@ Rdxport.Show = function(groupName, description, lowcart, highcart, normlevel, tr this.dayofweek = dayofweek; this.starttime = starttime; this.length = length; + this.type = type; } this.logs = []; @@ -223,7 +235,11 @@ Rdxport.ShowView = function(model) { }; Rdxport.ShowView.prototype.render = function() { - $('#show-title').text(this.model.title); + if(this.model.type == 'r') { + $('#show-title').text(this.model.title + " (Wiederholung)"); + } 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.'); -- cgit v0.10.2