Skip to content

Commit

Permalink
Closes openSUSE#1884
Browse files Browse the repository at this point in the history
  • Loading branch information
anmoliiitd823 committed Dec 21, 2017
1 parent 8f6eeaa commit c0d5c53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,17 @@ def speaker_links(event)
safe_join(event.speakers.map{ |speaker| link_to speaker.name, admin_user_path(speaker) }, ',')
end

def speaker_selector_input(form)
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 }
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[2]} #{user[3]}", user[0]]}, @event.speakers.map(&:id)),
include_blank: false, label: 'Speakers', input_html: { class: 'select-help-toggle', multiple: 'true' }
end

def responsibles_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 }
form.input :responsibles, as: :select,
collection: options_for_select(users.map {|user| ["#{user[1]} (#{user[2]}) #{user[3]}", user[0]]}, @booth.responsibles.map(&:id)),
collection: options_for_select(users.map {|user| ["#{user[2]} #{user[3]}", user[0]]}, @booth.responsibles.map(&:id)),
include_blank: false, label: 'Responsibles', input_html: { class: 'select-help-toggle', multiple: 'true' },
hint: 'The people responsible for the booth. You can only select existing users.'
end
Expand Down

0 comments on commit c0d5c53

Please sign in to comment.