diff --git a/UI/Episode/Layout.js b/UI/Episode/Layout.js index 585f43dd8..8634d6b46 100644 --- a/UI/Episode/Layout.js +++ b/UI/Episode/Layout.js @@ -2,9 +2,9 @@ define( [ 'marionette', - 'Episode/Summary/View', + 'Episode/Summary/Layout', 'Episode/Search/Layout' - ], function (Marionette, SummaryView, SearchLayout) { + ], function (Marionette, SummaryLayout, SearchLayout) { return Marionette.Layout.extend({ template: 'Episode/LayoutTemplate', @@ -43,8 +43,7 @@ define( } this.ui.summary.tab('show'); - this.summary.show(new SummaryView({model: this.model})); - + this.summary.show(new SummaryLayout({model: this.model})); }, _showActivity: function (e) { @@ -92,7 +91,5 @@ define( this.ui.monitored.removeClass('icon-bookmark'); } } - }); - }); diff --git a/UI/Episode/Summary/Layout.js b/UI/Episode/Summary/Layout.js new file mode 100644 index 000000000..72f0c08b0 --- /dev/null +++ b/UI/Episode/Summary/Layout.js @@ -0,0 +1,55 @@ +'use strict'; +define( + [ + 'marionette', + 'backgrid', + 'Cells/FileSizeCell', + 'Cells/QualityCell', + 'Episode/Summary/NoFileView' + ], function (Marionette, Backgrid, FileSizeCell, QualityCell, NoFileView) { + + return Marionette.Layout.extend({ + template: 'Episode/Summary/LayoutTemplate', + + regions: { + overview: '.episode-overview', + activity: '.episode-file-info' + }, + + columns: + [ + { + name : 'path', + label : 'Path', + cell : 'string', + sortable: false + }, + { + name : 'size', + label : 'Size', + cell : FileSizeCell, + sortable: false + }, + { + name : 'quality', + label : 'Quality', + cell : QualityCell, + sortable: false + } + ], + + onShow: function () { + if (this.model.get('episodeFile')) { + this.activity.show(new Backgrid.Grid({ + collection: new Backbone.Collection(this.model.get('episodeFile')), + columns : this.columns, + className : 'table table-bordered' + })); + } + + else { + this.activity.show(new NoFileView()); + } + } + }); + }); diff --git a/UI/Episode/Summary/LayoutTemplate.html b/UI/Episode/Summary/LayoutTemplate.html new file mode 100644 index 000000000..fe5ad02c9 --- /dev/null +++ b/UI/Episode/Summary/LayoutTemplate.html @@ -0,0 +1,4 @@ +
+ {{overview}} +
+
diff --git a/UI/Episode/Summary/View.js b/UI/Episode/Summary/NoFileView.js similarity index 71% rename from UI/Episode/Summary/View.js rename to UI/Episode/Summary/NoFileView.js index 193e9bd7c..dafa72f98 100644 --- a/UI/Episode/Summary/View.js +++ b/UI/Episode/Summary/NoFileView.js @@ -5,7 +5,7 @@ define( ], function (Marionette) { return Marionette.ItemView.extend({ - template: 'Episode/Summary/ViewTemplate' + template: 'Episode/Summary/NoFileViewTemplate' }); }); diff --git a/UI/Episode/Summary/NoFileViewTemplate.html b/UI/Episode/Summary/NoFileViewTemplate.html new file mode 100644 index 000000000..62acb5499 --- /dev/null +++ b/UI/Episode/Summary/NoFileViewTemplate.html @@ -0,0 +1,3 @@ +

+ No file available for this episode. +

\ No newline at end of file diff --git a/UI/Episode/Summary/ViewTemplate.html b/UI/Episode/Summary/ViewTemplate.html deleted file mode 100644 index ebeedf1d0..000000000 --- a/UI/Episode/Summary/ViewTemplate.html +++ /dev/null @@ -1,29 +0,0 @@ -
- {{overview}} -
-
- {{#if episodeFile}} - {{#with episodeFile}} - - - - - - - - - - - - - - - -
PathSizeQuality
{{path}}{{Bytes size}}{{quality.quality.name}}
- {{/with}} - {{else}} -

- No file available for this episode. -

- {{/if}} -