diff --git a/src/api/app/views/webui/groups/_add_group_user_modal.html.haml b/src/api/app/views/webui/groups/_add_group_user_modal.html.haml index 734cdd3e8c9..36237e0d8a3 100644 --- a/src/api/app/views/webui/groups/_add_group_user_modal.html.haml +++ b/src/api/app/views/webui/groups/_add_group_user_modal.html.haml @@ -6,7 +6,7 @@ .modal-header %h5.modal-title#add-group-user-modal-label Add Member .modal-body - = render partial: 'webui/autocomplete', locals: { html_id: 'user_login', label: 'User:', + = render partial: 'webui/shared/autocomplete', locals: { html_id: 'user_login', label: 'User:', data: { source: autocomplete_users_path } } .modal-footer = render partial: 'webui/shared/dialog_action_buttons' diff --git a/src/api/app/views/webui/shared/_autocomplete.html.haml b/src/api/app/views/webui/shared/_autocomplete.html.haml new file mode 100644 index 00000000000..3516b23ac85 --- /dev/null +++ b/src/api/app/views/webui/shared/_autocomplete.html.haml @@ -0,0 +1,16 @@ +:ruby + required = local_assigns.fetch(:required, true) + value = local_assigns.fetch(:value, '') + disabled = local_assigns.fetch(:disabled, false) + data = local_assigns.fetch(:data, {}) + +.form-group.ui-front + = label_tag(html_id, label) + - if required + %abbr.text-danger{ title: 'required' } * + .input-group + .input-group-prepend + %span.input-group-text + %i.fas.fa-search + = text_field_tag(html_id, value, required: required, disabled: disabled, placeholder: 'Type to autocomplete...', + class: 'obs-autocomplete form-control', data: data)