2016-06-30 13:21:47 +03:00
|
|
|
import Mixin from 'ember-metal/mixin';
|
2014-07-25 11:52:17 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
export default Mixin.create({
|
|
|
|
transitionAuthor() {
|
|
|
|
return (user) => {
|
2014-10-25 01:09:50 +04:00
|
|
|
if (user.get('isAuthor')) {
|
2015-10-28 14:36:45 +03:00
|
|
|
return this.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
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
transitionEditor() {
|
|
|
|
return (user) => {
|
2014-10-25 01:09:50 +04:00
|
|
|
if (user.get('isEditor')) {
|
2015-10-28 14:36:45 +03:00
|
|
|
return this.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
|
|
|
});
|