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