2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2014-07-25 11:52:17 +04:00
|
|
|
var CurrentUserSettings = Ember.Mixin.create({
|
2014-10-25 01:09:50 +04:00
|
|
|
transitionAuthor: function () {
|
|
|
|
var self = this;
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
return function (user) {
|
|
|
|
if (user.get('isAuthor')) {
|
2015-06-18 13:59:08 +03:00
|
|
|
return self.transitionTo('team.user', user);
|
2014-10-25 01:09:50 +04:00
|
|
|
}
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
return user;
|
|
|
|
};
|
|
|
|
},
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
transitionEditor: function () {
|
|
|
|
var self = this;
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
return function (user) {
|
|
|
|
if (user.get('isEditor')) {
|
2015-06-18 13:59:08 +03:00
|
|
|
return self.transitionTo('team');
|
2014-10-25 01:09:50 +04:00
|
|
|
}
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
return user;
|
|
|
|
};
|
|
|
|
}
|
2014-07-25 11:52:17 +04:00
|
|
|
});
|
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
export default CurrentUserSettings;
|