From 6461021046a08af038c81cf9eb1bb708ff4f0eba Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 20 Dec 2016 15:50:12 +0800 Subject: [PATCH] FIX: Only show membership status on index page. --- .../templates/components/group-membership-button.hbs | 12 +++++++----- .../javascripts/discourse/templates/groups.hbs | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/components/group-membership-button.hbs b/app/assets/javascripts/discourse/templates/components/group-membership-button.hbs index f6294badaec..182be8af783 100644 --- a/app/assets/javascripts/discourse/templates/components/group-membership-button.hbs +++ b/app/assets/javascripts/discourse/templates/components/group-membership-button.hbs @@ -14,11 +14,13 @@ {{/if}} {{else if canRequestMembership}} {{#if model.is_group_user}} - {{d-button - class="btn-primary" - icon="user" - label="groups.is_group_user" - disabled=model.is_group_user}} + {{#if showMembershipStatus}} + {{d-button + class="btn-primary" + icon="user" + label="groups.is_group_user" + disabled=true}} + {{/if}} {{else}} {{d-button action="requestMembership" class="group-index-request" diff --git a/app/assets/javascripts/discourse/templates/groups.hbs b/app/assets/javascripts/discourse/templates/groups.hbs index 8503ac9bac5..4cd1943a0de 100644 --- a/app/assets/javascripts/discourse/templates/groups.hbs +++ b/app/assets/javascripts/discourse/templates/groups.hbs @@ -45,7 +45,10 @@ {{group.user_count}} - {{#group-membership-button model=group createNewMessageViaParams='createNewMessageViaParams'}} + {{#group-membership-button model=group + createNewMessageViaParams='createNewMessageViaParams' + showMembershipStatus=true}} + {{d-button icon="ban" label=(if group.automatic 'groups.automatic_group' 'groups.closed_group') disabled=true}}