From 8955bf02d89aa5bcf0cc32f4c1c9c30673824a36 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 2 Sep 2014 20:03:32 +0530 Subject: [PATCH] hide poster avatars when only two posts --- .../discourse/components/topic-map.js.es6 | 2 ++ .../templates/components/topic-map.js.handlebars | 16 +++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/components/topic-map.js.es6 b/app/assets/javascripts/discourse/components/topic-map.js.es6 index 9096c05c5e0..eed1e182388 100644 --- a/app/assets/javascripts/discourse/components/topic-map.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-map.js.es6 @@ -22,6 +22,8 @@ export default Ember.Component.extend({ this.set('mapCollapsed', Discourse.Mobile.mobileView || (!this.get('topic.has_summary'))); }, + showPosterAvatar: Em.computed.gt('topic.posts_count', 2), + toggleMapClass: function() { return this.get('mapCollapsed') ? 'fa fa-chevron-down' : 'fa fa-chevron-up'; }.property('mapCollapsed'), diff --git a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars index cb2b93f187f..aa0e30f3f5a 100644 --- a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars @@ -39,14 +39,16 @@ {{/if}} {{#if details.links.length}} -
  • - {{number details.links.length}} -

    {{i18n links_lowercase}}

    -
  • +
  • + {{number details.links.length}} +

    {{i18n links_lowercase}}

    +
  • + {{/if}} + {{#if showPosterAvatar}} +
  • + {{#grouped-each participant in details.fewParticipants}}{{topic-participant participant=participant}}{{/grouped-each}} +
  • {{/if}} -
  • - {{#grouped-each participant in details.fewParticipants}}{{topic-participant participant=participant}}{{/grouped-each}} -