|
|
@@ -135,29 +135,11 @@ $(document).ready(function(){
|
|
|
|
|
|
% if is_embeddable:
|
|
|
$editUserComponents.find('#editForm').attr('action', window.location.pathname.substr(4).replace(/\/$/, ''));
|
|
|
-
|
|
|
- function renderErrors(errors) {
|
|
|
- $('.control-group').removeClass('error');
|
|
|
- $('.errorlist').remove();
|
|
|
- if (errors && errors.length > 0){
|
|
|
- errors.forEach(function(e){
|
|
|
- var $el = $('#' + e.id);
|
|
|
- $el.closest('.control-group').addClass('error');
|
|
|
- var html = '<span class="help-inline"><ul class="errorlist">';
|
|
|
- e.message.forEach(function(message){
|
|
|
- html += '<li>' + message + '</li>';
|
|
|
- });
|
|
|
- html += '</ul></span>';
|
|
|
- $el.after(html);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
$editUserComponents.find('#editForm').ajaxForm({
|
|
|
dataType: 'json',
|
|
|
success: function(data) {
|
|
|
if (data && data.status == -1) {
|
|
|
- renderErrors(data.errors);
|
|
|
+ renderUseradminErrors(data.errors);
|
|
|
}
|
|
|
else if (data && data.url) {
|
|
|
huePubSub.publish('open.link', data.url);
|