New: Optionally disable notifications for upgraded episode files

This commit is contained in:
Mark McDowall 2014-02-10 17:09:31 -08:00
parent bc908e0440
commit 3d3390187e
10 changed files with 86 additions and 13 deletions

View file

@ -24,10 +24,11 @@ define([
}
this.model.set({
id: undefined,
name: this.model.get('implementationName'),
onGrab: true,
onDownload: true
id : undefined,
name : this.model.get('implementationName'),
onGrab : true,
onDownload : true,
onUpgrade : true
});
var editView = new EditView({ model: this.model, notificationCollection: this.notificationCollection });

View file

@ -16,18 +16,28 @@ define(
var model = Marionette.ItemView.extend({
template: 'Settings/Notifications/NotificationEditViewTemplate',
ui: {
onDownloadToggle: '.x-on-download',
onUpgradeSection: '.x-on-upgrade'
},
events: {
'click .x-save' : '_saveNotification',
'click .x-save-and-add': '_saveAndAddNotification',
'click .x-delete' : '_deleteNotification',
'click .x-back' : '_back',
'click .x-test' : '_test'
'click .x-test' : '_test',
'change .x-on-download': '_onDownloadChanged'
},
initialize: function (options) {
this.notificationCollection = options.notificationCollection;
},
onRender: function () {
this._onDownloadChanged();
},
_saveNotification: function () {
var self = this;
var promise = this.model.saveSettings();
@ -71,6 +81,18 @@ define(
});
CommandController.Execute(testCommand, properties);
},
_onDownloadChanged: function () {
var checked = this.ui.onDownloadToggle.prop('checked');
if (checked) {
this.ui.onUpgradeSection.show();
}
else {
this.ui.onUpgradeSection.hide();
}
}
});

View file

@ -30,9 +30,9 @@
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Do you want to get notifications when episodes are grabbed?"/>
</span>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Do you want to get notifications when episodes are grabbed?"/>
</span>
</div>
</div>
@ -41,7 +41,7 @@
<div class="controls">
<label class="checkbox toggle well">
<input type="checkbox" name="onDownload"/>
<input type="checkbox" name="onDownload" class="x-on-download"/>
<p>
<span>Yes</span>
<span>No</span>
@ -50,9 +50,29 @@
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Do you want to get notifications when episodes are downloaded?"/>
</span>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Do you want to get notifications when episodes are downloaded?"/>
</span>
</div>
</div>
<div class="control-group x-on-upgrade">
<label class="control-label">On Upgrade</label>
<div class="controls">
<label class="checkbox toggle well">
<input type="checkbox" name="onUpgrade"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-nd-form-info" title="Do you want to get notifications when episodes are upgraded to a better quality?"/>
</span>
</div>
</div>

View file

@ -66,7 +66,7 @@ define(
'click .x-notifications-tab' : '_showNotifications',
'click .x-general-tab' : '_showGeneral',
'click .x-save-settings' : '_save',
'change .x-advanced-settings' : '_toggleAdvancedSettings'
'change .x-advanced-settings' : '_toggleAdvancedSettings'
},
initialize: function (options) {