summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2017-04-08 11:06:10 (GMT)
committerChristian Pointner <equinox@helsinki.at>2017-04-08 11:06:10 (GMT)
commitb2ef257d0ec95f98d447309e8f3b60ebc90a2da0 (patch)
tree944492e7dd4c59e8a11fe7cef4c0189b5c80752c /www/js
parentc4e22d6740e53e837fec63ccf27cb1043982dd93 (diff)
improved html5 element usage
Diffstat (limited to 'www/js')
-rw-r--r--www/js/specials.js27
1 files changed, 17 insertions, 10 deletions
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 = $('<span>').addClass('show-start').text(this.model.id);
- var pvstr = "unused";
+ var id = $('<span>').addClass('show-id').text(this.model.id);
+
+ var showlink = $('<a>').attr('href', "https://import.helsinki.at/shows/" + this.model.id)
+ .attr('target', "import").text(this.model.title);
+ var title = $('<span>').addClass('show-title').append(showlink);
+
if(this.model.pv_id >= 0) {
+ var pvlink = $('<a>').attr('href', "https://pv.helsinki.at/admin/program/show/" + this.model.pv_id)
+ .attr('target', "import").text(this.model.pv_name);
+
+ var pvtitle = $('<span>').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 = $('<span>').addClass('show-len').text(pvstr);
-
- var showlink = $('<a>').attr('href', "https://import.helsinki.at/shows/" + this.model.id)
- .attr('target', "import").text(this.model.title);
- var title = $('<span>').addClass('show-title').append(showlink);
+ var pvtimes = $('<span>').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 = $('<span>').addClass('pv-unused').text("unused");
+ this.$el.empty().addClass('show').append(id).append(title).append(pv);
+ }
}