From 76b8b006fa3fb1c4feee9483d46ec04616e1d0a3 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 13 Mar 2013 17:26:30 -0700 Subject: [PATCH] Download Client settings and QualityProfiles --- NzbDrone.Backbone/Content/form.css | 5 +- .../Quality/qualityProfileModel.js | 2 +- .../DownloadClientTemplate.html | 296 +++++++++++++++++- .../DownloadClient/DownloadClientView.js | 8 + .../Settings/Naming/NamingView.js | 1 - .../Profile/EditQualityProfileTemplate.html | 54 ++++ .../Quality/Profile/EditQualityProfileView.js | 38 +++ .../Profile/QualityProfileTemplate.html | 5 +- .../Quality/Profile/QualityProfileView.js | 7 +- NzbDrone.ncrunchsolution | 1 - 10 files changed, 404 insertions(+), 13 deletions(-) create mode 100644 NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileTemplate.html create mode 100644 NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileView.js diff --git a/NzbDrone.Backbone/Content/form.css b/NzbDrone.Backbone/Content/form.css index 7c2750c51..30d0d8f02 100644 --- a/NzbDrone.Backbone/Content/form.css +++ b/NzbDrone.Backbone/Content/form.css @@ -1,6 +1,7 @@ .form-horizontal .controls i { - font-size: 25px; - color: #3A87AD; + font-size: 16px; + /*color: #3A87AD;*/ /* Info blue */ + color: #595959; cursor: default; } diff --git a/NzbDrone.Backbone/Quality/qualityProfileModel.js b/NzbDrone.Backbone/Quality/qualityProfileModel.js index 6781fe306..2e26fa7be 100644 --- a/NzbDrone.Backbone/Quality/qualityProfileModel.js +++ b/NzbDrone.Backbone/Quality/qualityProfileModel.js @@ -14,7 +14,7 @@ defaults: { id: null, name: '', - //allowed: {}, + //'qualities.allowed': false, cutoff: null } }); diff --git a/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientTemplate.html b/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientTemplate.html index 86ac9ebf4..70c60e335 100644 --- a/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientTemplate.html +++ b/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientTemplate.html @@ -1,3 +1,293 @@ -
- Download Client settings will go here -
\ No newline at end of file +
+ General + +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+
+ +
+ + + +
+
+
+ +
+ SABnzbd + +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+
+ +
+ Blackhole + +
+ +
+ + + + +
+
+
+ +
+ Pneumatic + +
+ +
+ + + + +
+
+
+ +
+ NZBGet +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ + + + +
+
+
diff --git a/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientView.js b/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientView.js index 2d782b873..2ea5a20e0 100644 --- a/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientView.js +++ b/NzbDrone.Backbone/Settings/DownloadClient/DownloadClientView.js @@ -7,9 +7,17 @@ define([ NzbDrone.Settings.DownloadClient.DownloadClientView = Backbone.Marionette.ItemView.extend({ template: 'Settings/DownloadClient/DownloadClientTemplate', + className: 'form-horizontal', + + ui: { + switch: '.switch', + tooltip: '[class^="help-inline"] i' + }, onRender: function () { NzbDrone.ModelBinder.bind(this.model, this.el); + this.ui.switch.bootstrapSwitch(); + this.ui.tooltip.tooltip({ placement: 'right', html: true }); } }); }); diff --git a/NzbDrone.Backbone/Settings/Naming/NamingView.js b/NzbDrone.Backbone/Settings/Naming/NamingView.js index cfc60b81e..0ce43ef00 100644 --- a/NzbDrone.Backbone/Settings/Naming/NamingView.js +++ b/NzbDrone.Backbone/Settings/Naming/NamingView.js @@ -16,7 +16,6 @@ define([ initialize: function(){ //Listen to save event - this.bind }, onRender: function () { diff --git a/NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileTemplate.html b/NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileTemplate.html new file mode 100644 index 000000000..36a9c6f4f --- /dev/null +++ b/NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileTemplate.html @@ -0,0 +1,54 @@ + + + \ No newline at end of file diff --git a/NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileView.js b/NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileView.js new file mode 100644 index 000000000..f85a29d8f --- /dev/null +++ b/NzbDrone.Backbone/Settings/Quality/Profile/EditQualityProfileView.js @@ -0,0 +1,38 @@ +'use strict'; +define(['app', 'Quality/QualityProfileModel'], function () { + + NzbDrone.Settings.Quality.Profile.EditQualityProfileView = Backbone.Marionette.ItemView.extend({ + template: 'Settings/Quality/Profile/EditQualityProfileTemplate', + tagName: 'div', + className: "modal", + + ui: { + switch: '.switch' + }, + + events: { + 'click .x-save': 'saveQualityProfile', + //'click .x-remove': 'removeSeries' + }, + + onRender: function () { + NzbDrone.ModelBinder.bind(this.model, this.el); + this.ui.switch.bootstrapSwitch(); + }, + + + saveQualityProfile: function () { + //Todo: Make sure model is updated with Allowed, Cutoff, Name + + this.model.save(); + this.trigger('saved'); + this.$el.parent().modal('hide'); + }, + +// removeSeries: function () { +// var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model }); +// NzbDrone.modalRegion.show(view); +// } + }); + +}); \ No newline at end of file diff --git a/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileTemplate.html b/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileTemplate.html index f2b0d8a6f..74d91c901 100644 --- a/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileTemplate.html +++ b/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileTemplate.html @@ -5,4 +5,7 @@ {{/each}} -Edit | Delete \ No newline at end of file + + + | Delete + \ No newline at end of file diff --git a/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileView.js b/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileView.js index 8d72a8910..4cfb00164 100644 --- a/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileView.js +++ b/NzbDrone.Backbone/Settings/Quality/Profile/QualityProfileView.js @@ -2,7 +2,8 @@ define([ 'app', - 'Quality/QualityProfileCollection' + 'Quality/QualityProfileCollection', + 'Settings/Quality/Profile/EditQualityProfileView' ], function () { @@ -20,16 +21,14 @@ define([ }, initialize: function () { - var test = 1; }, onRender: function () { NzbDrone.ModelBinder.bind(this.model, this.el); }, - editSeries: function () { - var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model}); + var view = new NzbDrone.Settings.Quality.Profile.EditQualityProfileView({ model: this.model}); NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, { view: view diff --git a/NzbDrone.ncrunchsolution b/NzbDrone.ncrunchsolution index 969da6dd4..c725a019c 100644 --- a/NzbDrone.ncrunchsolution +++ b/NzbDrone.ncrunchsolution @@ -2,7 +2,6 @@ 1 True true - true UseDynamicAnalysis Disabled Disabled