removed backbone from VS solution,

renamed NzbDrone.Backbone to UI
This commit is contained in:
kay.one 2013-03-29 12:18:44 -07:00
commit 663160c06a
230 changed files with 57 additions and 386 deletions

View file

@ -0,0 +1,54 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</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">
<span class="help-inline">
<i class="icon-question-sign" title="The name for this quality profile"></i>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">Cutoff</label>
<div class="controls">
<select class="x-cutoff" name="cutoff">
{{#each allowed}}
<option value="{{id}}">{{name}}</option>
{{/each}}
</select>
<span class="help-inline">
<i class="icon-question-sign" title="Once this quality is reached NzbDrone will no longer download episodes"></i>
</span>
</div>
</div>
<!--Todo: Why is a null allowed being treated as a true?-->
{{#each qualities}}
<div class="control-group">
<label class="control-label">{{name}}</label>
<div class="controls">
<div class="switch" data-on-label="Yes" data-off-label="No">
<input type="checkbox" name="allowed" />
</div>
</div>
</div>
{{/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>

View file

@ -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);
// }
});
});

View file

@ -0,0 +1,14 @@
<fieldset>
<legend>Quality Profiles</legend>
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>Allowed</th>
<th>Cutoff</th>
<th>Controls</th>
</tr>
</thead>
<tbody></tbody>
</table>
</fieldset>

View file

@ -0,0 +1,21 @@
'use strict';
define(['app', 'Settings/Quality/Profile/QualityProfileView'], function (app) {
NzbDrone.Settings.Quality.Profile.QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Settings.Quality.Profile.QualityProfileView,
itemViewContainer: 'tbody',
template: 'Settings/Quality/Profile/QualityProfileCollectionTemplate',
initialize: function (options) {
},
ui:{
},
onCompositeCollectionRendered: function()
{
}
});
});

View file

@ -0,0 +1,11 @@
<td name="name"></td>
<td>
{{#each allowed}}
{{name}} |
{{/each}}
</td>
<td name="cutoffName"></td>
<td>
<i class="icon-cog x-edit" title="Edit Series"></i>
| Delete
</td>

View file

@ -0,0 +1,45 @@
'use strict';
define([
'app',
'Quality/QualityProfileCollection',
'Settings/Quality/Profile/EditQualityProfileView'
], function () {
NzbDrone.Settings.Quality.Profile.QualityProfileView = Backbone.Marionette.ItemView.extend({
template: 'Settings/Quality/Profile/QualityProfileTemplate',
tagName: 'tr',
ui: {
'progressbar': '.progress .bar'
},
events: {
'click .x-edit': 'editSeries',
'click .x-remove': 'removeSeries'
},
initialize: function () {
},
onRender: function () {
NzbDrone.ModelBinder.bind(this.model, this.el);
},
editSeries: function () {
var view = new NzbDrone.Settings.Quality.Profile.EditQualityProfileView({ model: this.model});
NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, {
view: view
});
},
removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, {
view: view
});
}
});
});