You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.5 KiB
29 lines
1.5 KiB
1 month ago
|
<% selected = @log.public_send(question.id) || "" %>
|
||
|
<% answers = question.displayed_answer_options(@log, current_user).map { |key, value| OpenStruct.new(id: key, name: select_option_name(value), resource: value) } %>
|
||
|
<%= render partial: "form/guidance/#{question.top_guidance_partial}" if question.top_guidance? %>
|
||
|
|
||
|
<%= f.govuk_select(question.id.to_sym,
|
||
|
label: legend(question, page_header, conditional),
|
||
1 week ago
|
"data-controller": "address-search",
|
||
|
"data-info": { search_url: address_search_url }.to_json,
|
||
1 month ago
|
caption: caption(caption_text, page_header, conditional),
|
||
|
hint: { text: question.hint_text&.html_safe }) do %>
|
||
|
<% if answers.any? %>
|
||
|
<% answers.each do |answer| %>
|
||
|
<option value="<%= answer.id %>"
|
||
|
data-synonyms="<%= answer_option_synonyms(answer.resource) %>"
|
||
|
data-append="<%= answer_option_append(answer.resource) %>"
|
||
|
data-hint="<%= answer_option_hint(answer.resource) %>"
|
||
|
<%= question.answer_selected?(@log, answer) ? "selected" : "" %>><%= answer.name || answer.resource %></option>
|
||
|
<% end %>
|
||
|
<% else %>
|
||
|
<option value="" disabled></option>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
|
||
|
<%= render partial: "form/guidance/#{question.bottom_guidance_partial}" if question.bottom_guidance? %>
|
||
1 week ago
|
|
||
|
<div class="govuk-button-group">
|
||
1 week ago
|
<%= govuk_link_to "Enter the address manually instead", address_manual_input_path(@log.log_type, @log.id), class: "govuk-button govuk-button--secondary" %>
|
||
1 week ago
|
</div>
|