From b2ef257d0ec95f98d447309e8f3b60ebc90a2da0 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 8 Apr 2017 13:06:10 +0200 Subject: improved html5 element usage diff --git a/www/js/specials.js b/www/js/specials.js index 5d8b855..51d83f1 100644 --- a/www/js/specials.js +++ b/www/js/specials.js @@ -121,24 +121,31 @@ rh.ShowView = function(model, listView) { }; rh.ShowView.prototype.render = function() { - var id = $('').addClass('show-start').text(this.model.id); - var pvstr = "unused"; + var id = $('').addClass('show-id').text(this.model.id); + + var showlink = $('').attr('href', "https://import.helsinki.at/shows/" + this.model.id) + .attr('target', "import").text(this.model.title); + var title = $('').addClass('show-title').append(showlink); + if(this.model.pv_id >= 0) { + var pvlink = $('').attr('href', "https://pv.helsinki.at/admin/program/show/" + this.model.pv_id) + .attr('target', "import").text(this.model.pv_name); + + var pvtitle = $('').addClass('pv-title').append(pvlink); + var start_end = format_datetime(this.model.pv_start) + " - "; if(compare_date(this.model.pv_start, this.model.pv_end)) { start_end += format_time(this.model.pv_end); } else { start_end += format_datetime(this.model.pv_end); } - pvstr = this.model.pv_id + " | " + this.model.pv_name + " (" + start_end + ")"; - } - var len = $('').addClass('show-len').text(pvstr); - - var showlink = $('').attr('href', "https://import.helsinki.at/shows/" + this.model.id) - .attr('target', "import").text(this.model.title); - var title = $('').addClass('show-title').append(showlink); + var pvtimes = $('').addClass('pv-time').text(start_end); - this.$el.empty().addClass('show').append(id).append(title).append(len); + this.$el.empty().addClass('show').append(id).append(title).append(pvtitle).append(pvtimes); + } else { + var pv = $('').addClass('pv-unused').text("unused"); + this.$el.empty().addClass('show').append(id).append(title).append(pv); + } } diff --git a/www/styles/specials.css b/www/styles/specials.css index 7898dc1..82fa640 100644 --- a/www/styles/specials.css +++ b/www/styles/specials.css @@ -62,18 +62,29 @@ div.show span { font-weight: bold; } +div.show span.show-id { + font-size: 0.75em; + margin-left: 5em; + margin-right: 1em; +} + div.show span.show-title { white-space:nowrap; overflow:hidden; } -div.show span.show-start { +div.show span.pv-title { + margin-left: 0.2em; + margin-right: 1em; +} + +div.show span.pv-time { font-size: 0.75em; - margin-left: 5em; + margin-left: 0.2em; margin-right: 1em; } -div.show span.show-len { +div.show span.pv-unused { font-size: 0.75em; margin-left: 0.2em; margin-right: 1em; -- cgit v0.10.2