Skip to content

Commit

Permalink
Move missing partial to shared directory
Browse files Browse the repository at this point in the history
`autocomplete` partial is used in many places and it was outside the
shared directory.
  • Loading branch information
David Kang committed Sep 4, 2019
1 parent b8a154a commit 51ccc38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
16 changes: 16 additions & 0 deletions src/api/app/views/webui/shared/_autocomplete.html.haml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 51ccc38

Please sign in to comment.