mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
ad9997e995
Fixes #3078 - new "users" resource, with matching controller and template - fetching real data from /ghost/api/v0.1/users/ - updated "user" route to accept a :slug as a URL parameter - updated labels everywhere (from "user" to "users") - updated "profile" link to header to point to proper "users/:slug" route - updated core/client/.jshintrc to recognize moment as a valid global function - adjusted DOM selector used in Casper to properly identify the new screen - adding "slug" as a new property of the user data used during the Casper functional tests
21 lines
515 B
JavaScript
21 lines
515 B
JavaScript
var SettingsUserRoute = Ember.Route.extend({
|
|
model: function () {
|
|
return this.session.get('user').then(function (user) {
|
|
user.reload();
|
|
return user;
|
|
});
|
|
},
|
|
|
|
deactivate: function () {
|
|
this._super();
|
|
|
|
// we want to revert any unsaved changes on exit
|
|
this.session.get('user').then(function (user) {
|
|
if (user.get('isDirty')) {
|
|
user.rollback();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
export default SettingsUserRoute;
|