From de9ab8684f9b3716c818b8657368ad76eddc81fa Mon Sep 17 00:00:00 2001 From: Nemo Date: Mon, 19 Mar 2018 00:56:39 +0530 Subject: [PATCH] Don't show emails or real-names in speaker-select-input - Fixes #1884 - Decided to remove real names as well, because the profile page calls out the username field as "how others users see you" --- app/helpers/application_helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f0311c7a5b..57b1b01a47 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -127,9 +127,13 @@ def speaker_links(event) end def speaker_selector_input(form) - users = User.active.pluck(:id, :name, :username, :email).map { |user| [user[0], user[1].blank? ? user[2] : user[1], user[2], user[3]] }.sort_by { |user| user[1].downcase } + users = User.active.pluck(:id, :username).map { |user| + [user[0], user[1]] + }.sort_by { |user| + user[1].downcase + } form.input :speakers, as: :select, - collection: options_for_select(users.map {|user| ["#{user[1]} (#{user[2]}) #{user[3]}", user[0]]}, @event.speakers.map(&:id)), + collection: options_for_select(users.map {|user| [user[1], user[0]]}, @event.speakers.map(&:id)), include_blank: false, label: 'Speakers', input_html: { class: 'select-help-toggle', multiple: 'true' } end