mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
More notificationUI changes, start notification updates
This commit is contained in:
parent
c5376319fe
commit
63f2ba7f77
16 changed files with 188 additions and 78 deletions
|
@ -1,5 +1,12 @@
|
|||
<div class="row">
|
||||
<div class="span12">
|
||||
<div id="x-notifications" class="form-horizontal"></div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Name</th>
|
||||
<th>On Grab</th>
|
||||
<th>On Download</th>
|
||||
<th>Controls</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
|
@ -2,7 +2,7 @@
|
|||
define(['app', 'Settings/Notifications/ItemView'], function () {
|
||||
NzbDrone.Settings.Notifications.CollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
itemView : NzbDrone.Settings.Notifications.ItemView,
|
||||
itemViewContainer : '#x-notifications',
|
||||
itemViewContainer : 'tbody',
|
||||
template : 'Settings/Notifications/CollectionTemplate'
|
||||
});
|
||||
});
|
||||
|
|
67
UI/Settings/Notifications/EditTemplate.html
Normal file
67
UI/Settings/Notifications/EditTemplate.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Edit</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Name</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="text" name="name"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">On Grab</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="onGrab"/>
|
||||
<p>
|
||||
<span>On</span>
|
||||
<span>Off</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"></div>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Do you want to get notifications when episodes are grabbed?"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">On Download</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="onDownload"/>
|
||||
<p>
|
||||
<span>On</span>
|
||||
<span>Off</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"></div>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Do you want to get notifications when episodes are downloaded?"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#each fields}}
|
||||
{{debug}}
|
||||
{{order}}
|
||||
{{value}}
|
||||
{{formField}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-danger pull-left x-remove">delete</button>
|
||||
<button class="btn" data-dismiss="modal">cancel</button>
|
||||
<button class="btn btn-primary x-save">save</button>
|
||||
</div>
|
36
UI/Settings/Notifications/EditView.js
Normal file
36
UI/Settings/Notifications/EditView.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
|
||||
define([
|
||||
'app',
|
||||
'Settings/Notifications/Model'
|
||||
|
||||
], function () {
|
||||
|
||||
NzbDrone.Settings.Notifications.EditView = Backbone.Marionette.ItemView.extend({
|
||||
template : 'Settings/Notifications/EditTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-save': 'save'
|
||||
},
|
||||
|
||||
save: function () {
|
||||
this.model.save();
|
||||
|
||||
// window.alert('saving');
|
||||
// this.model.save(undefined, this.syncNotification("Notification Settings Saved", "Couldn't Save Notification Settings"));
|
||||
},
|
||||
|
||||
|
||||
syncNotification: function (success, error) {
|
||||
return {
|
||||
success: function () {
|
||||
window.alert(success);
|
||||
},
|
||||
|
||||
error: function () {
|
||||
window.alert(error);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,47 +1,9 @@
|
|||
<fieldset>
|
||||
<legend>{{name}}</legend>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">On Grab</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="onGrab"/>
|
||||
<p>
|
||||
<span>On</span>
|
||||
<span>Off</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"></div>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Do you want to get notifications when episodes are grabbed?"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">On Download</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="onDownload"/>
|
||||
<p>
|
||||
<span>On</span>
|
||||
<span>Off</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"></div>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Do you want to get notifications when episodes are downloaded?"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#each fields}}
|
||||
{{formField}}
|
||||
{{/each}}
|
||||
</fieldset>
|
||||
<td><img src="/content/images/notifications/{{implementation}}.png" alt="{{implementation}}"/></td>
|
||||
<td name="name"></td>
|
||||
<td name="onGrab"></td>
|
||||
<td name="onDownload"></td>
|
||||
<td name="cutoffName"></td>
|
||||
<td>
|
||||
<i class="icon-cog x-edit" title="Edit"></i>
|
||||
| Delete
|
||||
</td>
|
|
@ -2,32 +2,28 @@
|
|||
|
||||
define([
|
||||
'app',
|
||||
'Settings/Notifications/Collection'
|
||||
'Settings/Notifications/Collection',
|
||||
'Settings/Notifications/EditView'
|
||||
|
||||
], function () {
|
||||
|
||||
NzbDrone.Settings.Notifications.ItemView = Backbone.Marionette.ItemView.extend({
|
||||
template : 'Settings/Notifications/ItemTemplate',
|
||||
initialize: function () {
|
||||
NzbDrone.vent.on(NzbDrone.Commands.SaveSettings, this.saveSettings, this);
|
||||
tagName: 'tr',
|
||||
|
||||
events: {
|
||||
'click .x-edit' : 'edit',
|
||||
'click .x-remove': 'remove'
|
||||
},
|
||||
|
||||
saveSettings: function () {
|
||||
|
||||
//this.model.save(undefined, this.syncNotification("Naming Settings Saved", "Couldn't Save Naming Settings"));
|
||||
edit: function () {
|
||||
var view = new NzbDrone.Settings.Notifications.EditView({ model: this.model});
|
||||
NzbDrone.modalRegion.show(view);
|
||||
},
|
||||
|
||||
|
||||
syncNotification: function (success, error) {
|
||||
return {
|
||||
success: function () {
|
||||
window.alert(success);
|
||||
},
|
||||
|
||||
error: function () {
|
||||
window.alert(error);
|
||||
}
|
||||
};
|
||||
remove: function () {
|
||||
var view = new NzbDrone.Settings.Notifications.DeleteView({ model: this.model});
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -16,16 +16,16 @@ define([
|
|||
},
|
||||
|
||||
events: {
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
'click .x-edit' : 'edit',
|
||||
'click .x-remove': 'remove'
|
||||
},
|
||||
|
||||
editSeries: function () {
|
||||
edit: function () {
|
||||
var view = new NzbDrone.Settings.Quality.Profile.EditQualityProfileView({ model: this.model});
|
||||
NzbDrone.modalRegion.show(view);
|
||||
},
|
||||
|
||||
removeSeries: function () {
|
||||
remove: function () {
|
||||
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue