-
+
+
-
-
+
+
{{#if items}}
Recent Folders
diff --git a/UI/AddSeries/RootFolders/Model.js b/UI/AddSeries/RootFolders/Model.js
index 13e20a7f0..2c54f6ae3 100644
--- a/UI/AddSeries/RootFolders/Model.js
+++ b/UI/AddSeries/RootFolders/Model.js
@@ -4,6 +4,7 @@ define(
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
+ urlRoot : window.ApiRoot + '/rootfolder',
defaults: {
freeSpace: 0
}
diff --git a/UI/AddSeries/SearchResultView.js b/UI/AddSeries/SearchResultView.js
index 5fb6101f0..e7d16631a 100644
--- a/UI/AddSeries/SearchResultView.js
+++ b/UI/AddSeries/SearchResultView.js
@@ -38,7 +38,7 @@ define(
this.listenTo(App.vent, Config.Events.ConfigUpdatedEvent, this._onConfigUpdated);
this.listenTo(this.model, 'change', this.render);
- this.listenTo(RootFolders, 'change', this.render);
+ this.listenTo(RootFolders, 'all', this.render);
this.rootFolderLayout = new RootFolderLayout();
this.listenTo(this.rootFolderLayout, 'folderSelected', this._setRootFolder);
@@ -108,6 +108,7 @@ define(
_setRootFolder: function (options) {
App.vent.trigger(App.Commands.CloseModalCommand);
this.ui.rootFolder.val(options.model.id);
+ this._rootFolderChanged();
},
_addSeries: function () {
diff --git a/UI/Content/theme.less b/UI/Content/theme.less
index 28fc141ad..4c8c3a1e8 100644
--- a/UI/Content/theme.less
+++ b/UI/Content/theme.less
@@ -39,8 +39,6 @@
}
}
-
-
.page-toolbar {
margin-top : 10px;
margin-bottom : 30px;
@@ -78,8 +76,6 @@ th {
}
}
-
-
a, .btn {
i {
cursor : pointer;
@@ -91,7 +87,6 @@ a, .btn {
background-color : white;
}
-
body {
background-color : #1c1c1c;
background-image : url('../Content/Images/pattern.png');
@@ -146,3 +141,9 @@ footer {
background-color : transparent;
box-shadow : none;
}
+
+.validation-errors {
+ i {
+ padding-right : 5px;
+ }
+}
diff --git a/UI/Mixins/AsValidatedView.js b/UI/Mixins/AsValidatedView.js
index a8c6cf06e..d074b054e 100644
--- a/UI/Mixins/AsValidatedView.js
+++ b/UI/Mixins/AsValidatedView.js
@@ -12,36 +12,48 @@ define(
var originalOnClose = this.prototype.onClose;
var originalBeforeClose = this.prototype.onBeforeClose;
+ var errorHandler = function (response) {
+
+ if (response.status === 400) {
+
+ var view = this;
+ var validationErrors = JSON.parse(response.responseText);
+ _.each(validationErrors, function (error) {
+ view.$el.processServerError(error);
+ });
+ }
+ };
+
+
+ var validatedSync = function (method, model,options) {
+ this.$el.removeAllErrors();
+ arguments[2].isValidatedCall = true;
+ return model._originalSync.apply(this, arguments).fail(errorHandler.bind(this));
+ };
+
+ var bindToModel = function (model) {
+
+ if (!model._originalSync) {
+ model._originalSync = model.sync;
+ model.sync = validatedSync.bind(this);
+ }
+ };
this.prototype.onRender = function () {
Validation.bind(this);
-
-
- if (!this.originalSync && this.model) {
-
- var self = this;
- this.originalSync = this.model.sync;
-
-
- var boundHandler = errorHandler.bind(this);
-
- this.model.sync = function () {
- self.$el.removeAllErrors();
-
- arguments[2].isValidatedCall = true;
-
- return self.originalSync.apply(this, arguments).fail(boundHandler);
- };
- }
+ this.bindToModelValidation = bindToModel.bind(this);
if (this.model) {
- if (originalOnRender) {
- originalOnRender.call(this);
- }
+ this.bindToModelValidation(this.model);
+ }
+
+ if (originalOnRender) {
+ originalOnRender.call(this);
}
};
+
this.prototype.onBeforeClose = function () {
if (this.model) {
@@ -65,22 +77,6 @@ define(
};
- var errorHandler = function (response) {
-
- if (response.status === 400) {
-
- var view = this;
-
- var validationErrors = JSON.parse(response.responseText);
-
- _.each(validationErrors, function (error) {
- view.$el.processServerError(error);
- });
- }
- };
-
-
-
return this;
};
});
diff --git a/UI/jQuery/jquery.validation.js b/UI/jQuery/jquery.validation.js
index fda5087c5..ca03d0aa7 100644
--- a/UI/jQuery/jquery.validation.js
+++ b/UI/jQuery/jquery.validation.js
@@ -8,6 +8,10 @@ define(
var validationName = error.propertyName.toLowerCase();
+ this.find('.validation-errors')
+ .addClass('alert alert-error')
+ .append('
' + error.errorMessage + '
');
+
var input = this.find('[name]').filter(function () {
return this.name.toLowerCase() === validationName;
});
@@ -40,11 +44,12 @@ define(
};
$.fn.addFormError = function (error) {
- this.find('.control-group').parent().prepend('
'+ error.errorMessage +'
')
+ this.find('.control-group').parent().prepend('
' + error.errorMessage + '
')
};
$.fn.removeAllErrors = function () {
this.find('.error').removeClass('error');
+ this.find('.validation-errors').removeClass('alert').removeClass('alert-error').html('');
this.find('.validation-error').remove();
return this.find('.help-inline.error-message').remove();
};