5 changed files with 34 additions and 26 deletions
@ -1,14 +0,0 @@ |
|||||||
<%= form_with model: @user, url: path(current_user), method: "get", local: true do |f| %> |
|
||||||
<div class="app-search govuk-!-margin-bottom-4"> |
|
||||||
<%= f.govuk_text_field :search, |
|
||||||
form_group: { |
|
||||||
class: "app-search__form-group", |
|
||||||
}, |
|
||||||
label: { text: search_label }, |
|
||||||
type: "search", |
|
||||||
value:, |
|
||||||
autocomplete: "off", |
|
||||||
class: "app-search__input" %> |
|
||||||
</div> |
|
||||||
<%= f.govuk_submit "Add" %> |
|
||||||
<% end %> |
|
||||||
@ -1,2 +0,0 @@ |
|||||||
class RelatedOrganisationSearchComponent < SearchComponent |
|
||||||
end |
|
||||||
@ -0,0 +1,15 @@ |
|||||||
|
<% answers = [OpenStruct.new(id: 1, name: "test1", resource: nil), OpenStruct.new(id: 2, name: "test2", resource: nil)] %> |
||||||
|
<%= f.govuk_select(question.id.to_sym, |
||||||
|
label: legend(question, page_header, conditional), |
||||||
|
"data-controller": "accessible-autocomplete", |
||||||
|
caption: caption(caption_text, page_header, conditional), |
||||||
|
hint: { text: question.hint_text&.html_safe }) do %> |
||||||
|
<% answers.each do |answer| %> |
||||||
|
<option value="<%= answer.id %>" |
||||||
|
data-synonyms="<%= question.answer_option_synonyms(answer.resource) %>" |
||||||
|
data-append="<%= question.answer_option_append(answer.resource) %>" |
||||||
|
data-hint="<%= question.answer_option_hint(answer.resource) %>" |
||||||
|
<%= question.answer_selected?(@log, answer) ? "selected" : "" %> |
||||||
|
<%= answer.id == "" ? "disabled" : "" %>><%= answer.name || answer.resource %></option> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
Loading…
Reference in new issue