2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2015-08-19 14:55:40 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
const {Mixin} = Ember;
|
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
|
|
|
});
|