From fd2b8dd12f44e30ac4c6ef12b2fe3c42bac2c713 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 12 Apr 2016 14:19:08 -0400 Subject: [PATCH] FIX: Edge case. Don't show "Others with this badge" when just you --- .../javascripts/discourse/controllers/badges/show.js.es6 | 5 +++++ app/assets/javascripts/discourse/templates/badges/show.hbs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 index 5df73481acd..086e353c07b 100644 --- a/app/assets/javascripts/discourse/controllers/badges/show.js.es6 +++ b/app/assets/javascripts/discourse/controllers/badges/show.js.es6 @@ -48,6 +48,11 @@ export default Ember.Controller.extend({ return grantCount > (userBadgeLength || 0); }, + @computed('user', 'model.grant_count') + canShowOthers(user, grantCount) { + return !!user && grantCount > 1; + }, + @observes('canLoadMore') _showFooter() { this.set("controllers.application.showFooter", !this.get("canLoadMore")); diff --git a/app/assets/javascripts/discourse/templates/badges/show.hbs b/app/assets/javascripts/discourse/templates/badges/show.hbs index 9a0bd1e0598..9ba1115e0eb 100644 --- a/app/assets/javascripts/discourse/templates/badges/show.hbs +++ b/app/assets/javascripts/discourse/templates/badges/show.hbs @@ -33,7 +33,7 @@ {{/load-more}} {{#unless canLoadMore}} - {{#if user}} + {{#if canShowOthers}}
{{i18n 'badges.others_count' count=model.grant_count}}