mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-30 15:37:55 +02:00
More backbone
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
urlRoot: '/api/qualityprofiles',
|
||||
|
||||
idAttribute: 'id',
|
||||
idAttribute: 'Id',
|
||||
|
||||
initialize: function () {
|
||||
this.validators = {};
|
||||
@@ -11,9 +11,9 @@
|
||||
return value.length > 0 ? { isValid: true } : { isValid: false, message: 'You must enter a name' };
|
||||
};
|
||||
|
||||
this.validators.allowed = function (value) {
|
||||
return value.length > 0 ? { isValid: true } : { isValid: false, message: 'You must have allowed qualities' };
|
||||
};
|
||||
//this.validators.allowed = function (value) {
|
||||
// return value.length > 0 ? { isValid: true } : { isValid: false, message: 'You must have allowed qualities' };
|
||||
//};
|
||||
|
||||
this.validators.cutoff = function (value) {
|
||||
return value != null ? { isValid: true } : { isValid: false, message: 'You must have a valid cutoff' };
|
||||
@@ -42,9 +42,9 @@
|
||||
},
|
||||
|
||||
defaults: {
|
||||
id: null,
|
||||
name: '',
|
||||
allowed: {},
|
||||
cutoff: null
|
||||
Id: null,
|
||||
Name: '',
|
||||
//allowed: {},
|
||||
Cutoff: null
|
||||
}
|
||||
});
|
@@ -1,7 +1,17 @@
|
||||
QualityProfileView = Backbone.Marionette.ItemView.extend({
|
||||
tagName: "div",
|
||||
className: "quality-profile",
|
||||
template: "#QualityProfileTemplate"
|
||||
template: "#QualityProfileTemplate",
|
||||
events: {
|
||||
'click .quality-selectee': 'toggleAllowed'
|
||||
},
|
||||
toggleAllowed: function (e) {
|
||||
//Add to cutoff
|
||||
//Update model
|
||||
|
||||
var checked = $(e.target).attr('checked') != undefined;
|
||||
this.model.set({ });
|
||||
}
|
||||
});
|
||||
|
||||
QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
|
Reference in New Issue
Block a user