UX: show pending invites tab by default

This commit is contained in:
Arpit Jalan 2015-07-23 18:22:43 +05:30
parent df8d47bdb6
commit d2867aa138
3 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,5 @@
export default Discourse.Route.extend({
beforeModel: function() {
this.replaceWith('userInvited.show', 'redeemed');
this.replaceWith('userInvited.show', 'pending');
}
});

View File

@ -8,6 +8,12 @@ export default Discourse.Route.extend(ShowFooter, {
return Discourse.Invite.findInvitedBy(this.modelFor('user'), params.filter);
},
afterModel: function(model) {
if (!model.can_see_invite_details) {
this.replaceWith('userInvited.show', 'redeemed');
}
},
setupController(controller, model) {
controller.setProperties({
model: model,

View File

@ -6,8 +6,8 @@
<div class='user-invite-controls'>
<div class='span15'>
<ul class="nav nav-pills">
{{nav-item route='userInvited.show' routeParam='redeemed' label='user.invited.redeemed_tab'}}
{{nav-item route='userInvited.show' routeParam='pending' label='user.invited.pending_tab'}}
{{nav-item route='userInvited.show' routeParam='redeemed' label='user.invited.redeemed_tab'}}
</ul>
</div>