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 %> |
||||||
@ -1,11 +1,19 @@ |
|||||||
<%= render partial: "organisations/headings", locals: { main: "What is the name of your housing provider?", sub: nil } %> |
|
||||||
<%= render RelatedOrganisationSearchComponent.new(current_user:, search_label: "Start typing to search for your housing provider", value: @searched) %> |
<%= form_with model: nil, url: housing_providers_add_organisation_path, method: "post", local: true do |f| %> |
||||||
<%= govuk_details(summary_text: "Can't find the housing provider you're looking for?") do %> |
<%# remove_other_page_errors(@log, @page) %> |
||||||
<ul class="govuk-list govuk-list--bullet"> |
<%#= f.govuk_error_summary %> |
||||||
<li>Double check the spelling and try again</li> |
<%= render partial: "organisations/headings", locals: { main: "What is the name of your housing provider?", sub: nil } %> |
||||||
<li>Type the first few letters to see the suggestions</li> |
<%#= render partial: "form/#{question.type}_question", locals: { question:, caption_text: @subsection.label, page_header: @page.header, lettings_log: @log, f:, conditional: false } %> |
||||||
<li>If you still can't find it, |
<%= f.govuk_submit "Add" %> |
||||||
<%= govuk_link_to("contact the DLUHC service desk", "https://digital.dclg.gov.uk/jira/servicedesk/customer/portal/4/group/21", rel: "noreferrer noopener", target: "_blank") %> |
<%= govuk_details(summary_text: "Can't find the housing provider you're looking for?") do %> |
||||||
</li> |
<ul class="govuk-list govuk-list--bullet"> |
||||||
</ul> |
<li>Double check the spelling and try again</li> |
||||||
|
<li>Type the first few letters to see the suggestions</li> |
||||||
|
<li>If you still can't find it, |
||||||
|
<%= govuk_link_to("contact the DLUHC service desk", "https://digital.dclg.gov.uk/jira/servicedesk/customer/portal/4/group/21", rel: "noreferrer noopener", target: "_blank") %> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in new issue