Ajaxify booth responsibles selectize interface

No need to load *all* users into a select input...
This commit is contained in:
Henne Vogelsang 2022-02-16 14:07:23 +01:00
parent 800bb28c34
commit 2e21079991
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
4 changed files with 77 additions and 29 deletions

View file

@ -115,14 +115,6 @@ module ApplicationHelper
user_selector_input(:speakers, form, '', true)
end
def responsibles_selector_input(form)
user_selector_input(
:responsibles,
form,
"The people responsible for the #{t 'booth'}. You can only select existing users."
)
end
def user_selector_input(field, form, hint = '', multiple = true)
users = User.where(is_disabled: false).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(