Submit social housing lettings and sales data (CORE)
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.

54 lines
2.0 KiB

CLDC-3541 Update sales financial validations (#2546) * CLDC-3569 Update social homebuy errors (#2541) * Split questions * Update the error message * Add guidance * Add back the headers * Refactor depends_on * Refactor further * CLDC-3569 Update missed errors (#2548) * Update some skipped error messages * Remove repeating deposit question * CLDC-3571 Discounted ownership validation (#2547) * Rename discount to deposit discount * Split about price rtb questions * Update error message * Update guidance partial * Fix top_guidance_partial method * Split about_price_not_rtb * Update guidance partial and validation * Fix bulk upload test * Update deposit routed_to and guidance * Refactor guidance links into a helper (#2551) * Refactor guidance links into a helper * Refactor discounted ownership guidance * CLDC-3570 Validations all other shared ownership types (#2550) * Update "all other shared ownership" errors * CLDC-3571 Update outright sale financial validations (#2549) * Update outright sale validation message * Add outright sale guidance * Update duplicate page id * User guidance helper * Fix up financial equations content (#2552) * Tweak shared ownership validation wording * Add top_guidance_partial to missed shared ownership questions * Update discounted ownership validation message when there's no grant * Update discounted sale guidance and errors * Lint and update test * Update BU test * Update test * CLDC-3569 Update guidance for shared ownership without mortgage (#2562) * Update how we display errors for BU * Update guidance for shared ownership * Add header to mortgage used question * Update shared ownership guidance * Update spacing (#2569) * Fix spacing again (#2570) * Update discounted ownership guidance (#2582) * Update discounted ownership guidance * Add top guidance partial to outright sale * Update outright sale guidance content * Update model test --------- Co-authored-by: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
4 months ago
<%= render partial: "form/guidance/#{question.top_guidance_partial}", locals: { log: @log } if question.top_guidance? %>
<% banner = question.notification_banner(@log) %>
<% if banner %>
<%= govuk_notification_banner(
title_text: banner[:title],
title_heading_level: 3,
) do
simple_format(banner[:heading])
end %>
<% end %>
<% input_playback = question.input_playback(@log) %>
<% if input_playback %>
<p class="govuk-body"><%= input_playback %></p>
<% end %>
<%= f.govuk_radio_buttons_fieldset question.id.to_sym,
caption: caption(caption_text, page_header, conditional),
legend: legend(question, page_header, conditional),
hint: { text: question.hint_text&.html_safe } do %>
<% question.displayed_answer_options(@log, current_user).each_with_index do |(key, options), index| %>
<% if key.starts_with?("divider") %>
<%= f.govuk_radio_divider %>
<% else %>
<% conditional_question = find_conditional_question(@page, question, key) %>
<% if conditional_question.nil? %>
<%= f.govuk_radio_button question.id.to_sym,
key,
label: { text: options["value"] },
hint: { text: options["hint"] },
link_errors: index.zero? ? true : nil,
**stimulus_html_attributes(question) %>
<% else %>
<%= f.govuk_radio_button question.id.to_sym,
key,
label: { text: options["value"] },
hint: { text: options["hint"] },
link_errors: index.zero? ? true : nil,
**stimulus_html_attributes(question) do %>
<%= render partial: "#{conditional_question.type}_question", locals: {
question: conditional_question,
caption_text:,
page_header:,
f:,
conditional: true,
} %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<%= render partial: "form/guidance/#{question.bottom_guidance_partial}" if question.bottom_guidance? %>