Skip to content

Commit

Permalink
Don't show emails or real-names in speaker-select-input
Browse files Browse the repository at this point in the history
- Fixes openSUSE#1884
- Decided to remove real names as well, because the profile page
  calls out the username field as "how others users see you"
  • Loading branch information
captn3m0 committed Mar 21, 2018
1 parent b9be152 commit de9ab86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit de9ab86

Please sign in to comment.