From 95a6dfc34e55cd1bba73796e10c5340b12ad54fb Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 20 May 2013 17:17:33 -0700 Subject: [PATCH] added episode detail modal summary tab is working. --- Gruntfile.js | 6 +-- UI/Content/Bootstrap/modals.less | 4 +- UI/Episode/Layout.js | 58 ++++++++++++++++++++++++-- UI/Episode/LayoutTemplate.html | 21 ++++++++++ UI/Episode/Search/LayoutTemplate.html | 13 +----- UI/Episode/Summary/View.js | 8 ++++ UI/Episode/Summary/ViewTemplate.html | 29 +++++++++++++ UI/Index.html | 2 +- UI/Series/Details/EpisodeStatusCell.js | 8 ---- UI/Series/Details/EpisodeTitleCell.js | 17 ++++++++ UI/Series/Details/SeasonLayout.js | 4 +- UI/Series/details.less | 30 +++++++++++++ UI/Series/series.less | 15 +------ UI/app.js | 6 ++- 14 files changed, 174 insertions(+), 47 deletions(-) create mode 100644 UI/Episode/LayoutTemplate.html create mode 100644 UI/Episode/Summary/View.js create mode 100644 UI/Episode/Summary/ViewTemplate.html create mode 100644 UI/Series/Details/EpisodeTitleCell.js create mode 100644 UI/Series/details.less diff --git a/Gruntfile.js b/Gruntfile.js index 5c1cfd0a0..2d2076623 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -91,8 +91,8 @@ module.exports = function (grunt) { copy: { index : { - src : 'UI/index.html', - dest: '_output/UI/index.html' + src : 'UI/**/index.html', + dest: '_output/' }, scripts: { src : 'UI/**/*.js', @@ -114,7 +114,7 @@ module.exports = function (grunt) { watch: { bootstrap : { - files: ['<%= less.bootstrap.src %>', 'UI/**/FontAwesome/**'], + files: ['UI/**/Bootstrap/**', 'UI/**/FontAwesome/**'], tasks: ['less:bootstrap'] }, generalLess: { diff --git a/UI/Content/Bootstrap/modals.less b/UI/Content/Bootstrap/modals.less index 8e272d409..f264fe15f 100644 --- a/UI/Content/Bootstrap/modals.less +++ b/UI/Content/Bootstrap/modals.less @@ -26,8 +26,8 @@ top: 10%; left: 50%; z-index: @zindexModal; - width: 560px; - margin-left: -280px; + width: 750px; + margin-left: -375px; background-color: @white; border: 1px solid #999; border: 1px solid rgba(0,0,0,.3); diff --git a/UI/Episode/Layout.js b/UI/Episode/Layout.js index b12afc538..80cb8cef1 100644 --- a/UI/Episode/Layout.js +++ b/UI/Episode/Layout.js @@ -1,8 +1,60 @@ "use strict"; -define(['app'], function () { +define(['app', 'Episode/Summary/View'], function () { - NzbDrone.Episode.Layout = Backbone.Marionette.ItemView.extend({ - template: 'Episode/Search/LayoutTemplate' + NzbDrone.Episode.Layout = Backbone.Marionette.Layout.extend({ + template: 'Episode/LayoutTemplate', + + + regions: { + summary : '#episode-summary', + activity: '#episode-activity', + search : '#episode-search' + }, + + ui: { + summary : '.x-episode-summary', + activity: '.x-episode-activity', + search : '.x-episode-search' + }, + + events: { + + 'click .x-episode-summary' : 'showSummary', + 'click .x-episode-activity': 'showActivity', + 'click .x-episode-search' : 'showSearch' + }, + + + onShow: function () { + this.showSummary(); + }, + + + showSummary: function (e) { + if (e) { + e.preventDefault(); + } + + this.ui.summary.tab('show'); + this.summary.show(new NzbDrone.Episode.Summary.View({model: this.model})); + + }, + + showActivity: function (e) { + if (e) { + e.preventDefault(); + } + + this.ui.activity.tab('show'); + }, + + showSearch: function (e) { + if (e) { + e.preventDefault(); + } + + this.ui.search.tab('show'); + } }); diff --git a/UI/Episode/LayoutTemplate.html b/UI/Episode/LayoutTemplate.html new file mode 100644 index 000000000..91c903cf5 --- /dev/null +++ b/UI/Episode/LayoutTemplate.html @@ -0,0 +1,21 @@ +
+ +