From eae414e8beaaa788d748c59b9a4237191fb4d554 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Tue, 4 Jun 2013 22:38:15 -0700 Subject: [PATCH] added files missed duo to aggresive .gitignore --- .gitignore | 4 +- UI/Release/Collection.js | 9 ++++ UI/Release/Layout.js | 83 ++++++++++++++++++++++++++++++++++ UI/Release/LayoutTemplate.html | 7 +++ UI/Release/Model.js | 14 ++++++ 5 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 UI/Release/Collection.js create mode 100644 UI/Release/Layout.js create mode 100644 UI/Release/LayoutTemplate.html create mode 100644 UI/Release/Model.js diff --git a/.gitignore b/.gitignore index db0c9967e..5bb5d00a7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,8 @@ TestResults *.sln.docstates # Build results -[Dd]ebug/ -[Rr]elease/ +bin/**/[Dd]ebug/ +bin/**/[Rr]elease/ *_i.c *_p.c *.ilk diff --git a/UI/Release/Collection.js b/UI/Release/Collection.js new file mode 100644 index 000000000..9ed5a3944 --- /dev/null +++ b/UI/Release/Collection.js @@ -0,0 +1,9 @@ +"use strict"; +define(['app', 'Release/Model'], function () { + NzbDrone.Release.Collection = Backbone.PageableCollection.extend({ + url : NzbDrone.Constants.ApiRoot + '/release', + model: NzbDrone.Release.Model, + + mode : 'client' + }); +}); diff --git a/UI/Release/Layout.js b/UI/Release/Layout.js new file mode 100644 index 000000000..d5fa38685 --- /dev/null +++ b/UI/Release/Layout.js @@ -0,0 +1,83 @@ +"use strict"; +define([ + 'app', + 'Release/Collection', + 'Shared/SpinnerView', + 'Shared/Toolbar/ToolbarLayout' +], + function () { + NzbDrone.Release.Layout = Backbone.Marionette.Layout.extend({ + template: 'Release/LayoutTemplate', + + regions: { + grid : '#x-grid', + toolbar: '#x-toolbar' + }, + + columns: [ + { + name : 'age', + label : 'Age', + sortable: true, + cell : Backgrid.IntegerCell + }, + { + name : 'size', + label : 'Size', + sortable: true, + cell : Backgrid.IntegerCell + }, + { + name : 'title', + label : 'Title', + sortable: true, + cell : Backgrid.StringCell + }, + { + name : 'seasonNumber', + label: 'season', + cell : Backgrid.IntegerCell + }, + { + name : 'episodeNumber', + label: 'episode', + cell : Backgrid.StringCell + }, + { + name : 'approved', + label: 'Approved', + cell : Backgrid.BooleanCell + } + ], + + showTable: function () { + if (!this.isClosed) { + this.grid.show(new Backgrid.Grid( + { + row : Backgrid.Row, + columns : this.columns, + collection: this.collection, + className : 'table table-hover' + })); + } + }, + + initialize: function () { + this.collection = new NzbDrone.Release.Collection(); + this.fetchPromise = this.collection.fetch(); + }, + + onShow: function () { + + var self = this; + + this.grid.show(new NzbDrone.Shared.SpinnerView()); + + this.fetchPromise.done(function () { + self.showTable(); + }); + //this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this})); + } + + }); + }); diff --git a/UI/Release/LayoutTemplate.html b/UI/Release/LayoutTemplate.html new file mode 100644 index 000000000..3420ec2ad --- /dev/null +++ b/UI/Release/LayoutTemplate.html @@ -0,0 +1,7 @@ +
+
+
+
+
+
+ diff --git a/UI/Release/Model.js b/UI/Release/Model.js new file mode 100644 index 000000000..1c0a2f94a --- /dev/null +++ b/UI/Release/Model.js @@ -0,0 +1,14 @@ +"use strict"; +define(['app'], function (app) { + NzbDrone.Release.Model = Backbone.Model.extend({ + /* mutators: { + seasonNumber: function () { + return this.get('episode').seasonNumber; + }, + + paddedEpisodeNumber: function () { + return this.get('episode').episodeNumber.pad(2); + } + }*/ + }); +});