From 32a034606958e93d92c02502127b9a862b2a4666 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 8 Apr 2019 16:39:37 -0400 Subject: [PATCH] UX: Don't show the username of the first user in the conversation --- .../discourse/components/reviewable-conversation-post.js.es6 | 3 +++ .../templates/components/reviewable-conversation-post.hbs | 5 ++++- .../discourse/templates/components/reviewable-score.hbs | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 app/assets/javascripts/discourse/components/reviewable-conversation-post.js.es6 diff --git a/app/assets/javascripts/discourse/components/reviewable-conversation-post.js.es6 b/app/assets/javascripts/discourse/components/reviewable-conversation-post.js.es6 new file mode 100644 index 00000000000..b57e6aa5de4 --- /dev/null +++ b/app/assets/javascripts/discourse/components/reviewable-conversation-post.js.es6 @@ -0,0 +1,3 @@ +export default Ember.Component.extend({ + showUsername: Ember.computed.gte("index", 1) +}); diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-conversation-post.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-conversation-post.hbs index 3b57076c19d..1bdcd280ff1 100644 --- a/app/assets/javascripts/discourse/templates/components/reviewable-conversation-post.hbs +++ b/app/assets/javascripts/discourse/templates/components/reviewable-conversation-post.hbs @@ -1,5 +1,8 @@ {{#if post}}
- {{#link-to 'user' post.user class="username"}}@{{post.user.username}}{{/link-to}} {{{post.excerpt}}} + {{#if showUsername}} + {{#link-to 'user' post.user class="username"}}@{{post.user.username}}{{/link-to}} + {{/if}} + {{{post.excerpt}}}
{{/if}} diff --git a/app/assets/javascripts/discourse/templates/components/reviewable-score.hbs b/app/assets/javascripts/discourse/templates/components/reviewable-score.hbs index 162e15aafe9..1647ac718a8 100644 --- a/app/assets/javascripts/discourse/templates/components/reviewable-score.hbs +++ b/app/assets/javascripts/discourse/templates/components/reviewable-score.hbs @@ -22,8 +22,8 @@
- {{#each rs.reviewable_conversation.conversation_posts as |p|}} - {{reviewable-conversation-post post=p}} + {{#each rs.reviewable_conversation.conversation_posts as |p index|}} + {{reviewable-conversation-post post=p index=index}} {{/each}}