mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
31 lines
823 B
JavaScript
31 lines
823 B
JavaScript
Template.user_account.helpers({
|
|
user: function () {
|
|
return this;
|
|
},
|
|
userFields: function () {
|
|
var fields = Meteor.users.simpleSchema().getEditableFields(Meteor.user());
|
|
return fields;
|
|
},
|
|
isUsingPassword: function () {
|
|
return this.services && !!this.services.password;
|
|
}
|
|
});
|
|
|
|
|
|
AutoForm.hooks({
|
|
editUserForm: {
|
|
|
|
onSuccess: function(operation, result) {
|
|
this.template.$('button[type=submit]').removeClass('loading');
|
|
Messages.flash(i18n.t("user_profile_saved"), 'success');
|
|
Messages.clearSeen();
|
|
},
|
|
|
|
onError: function(operation, error) {
|
|
this.template.$('button[type=submit]').removeClass('loading');
|
|
Messages.flash(error.message.split('|')[0], 'error'); // workaround because error.details returns undefined
|
|
Messages.clearSeen();
|
|
}
|
|
|
|
}
|
|
});
|