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) %> |
||||
<%= govuk_details(summary_text: "Can't find the housing provider you're looking for?") do %> |
||||
<ul class="govuk-list govuk-list--bullet"> |
||||
<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> |
||||
|
||||
<%= form_with model: nil, url: housing_providers_add_organisation_path, method: "post", local: true do |f| %> |
||||
<%# remove_other_page_errors(@log, @page) %> |
||||
<%#= f.govuk_error_summary %> |
||||
<%= render partial: "organisations/headings", locals: { main: "What is the name of your housing provider?", sub: nil } %> |
||||
<%#= render partial: "form/#{question.type}_question", locals: { question:, caption_text: @subsection.label, page_header: @page.header, lettings_log: @log, f:, conditional: false } %> |
||||
<%= f.govuk_submit "Add" %> |
||||
<%= govuk_details(summary_text: "Can't find the housing provider you're looking for?") do %> |
||||
<ul class="govuk-list govuk-list--bullet"> |
||||
<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 %> |
||||
|
||||
|
||||
|
Loading…
Reference in new issue