From 5a4c393231460629442b37aa2b69b1aef2caf64b Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 8 Feb 2017 15:27:07 -0500 Subject: [PATCH] UX: Include the username and link of the user for get_a_room --- config/locales/server.en.yml | 4 ++-- lib/composer_messages_finder.rb | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 699891ff881..44920dad6e5 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -317,13 +317,13 @@ en: Are you sure you’re providing adequate time for other people to share their points of view, too? get_a_room: | - ### You’re replying a lot to the same person + ### You’re replying a lot to @%{reply_username} You’ve already replied %{count} times to this person in this particular topic. Have you considered replying to *other* people in the discussion, too? A great discussion involves many voices and perspectives. - If you’d like to continue your conversation with this particular user at length, consider sending them a personal message. + If you’d like to continue your conversation with this particular user at length, consider [sending them a personal message](/users/%{reply_username}). too_many_replies: | ### You have reached the reply limit for this topic diff --git a/lib/composer_messages_finder.rb b/lib/composer_messages_finder.rb index ac2a03d3b25..af738f4e867 100644 --- a/lib/composer_messages_finder.rb +++ b/lib/composer_messages_finder.rb @@ -156,13 +156,19 @@ class ComposerMessagesFinder target_user_id: @user.id, topic_id: @details[:topic_id]) + reply_username = User.where(id: last_x_replies[0]).pluck(:username).first + { id: 'get_a_room', templateName: 'education', wait_for_typing: true, extraClass: 'education-message', body: PrettyText.cook( - I18n.t('education.get_a_room', count: SiteSetting.get_a_room_threshold) + I18n.t( + 'education.get_a_room', + count: SiteSetting.get_a_room_threshold, + reply_username: reply_username + ) ) } end