5 changed files with 56 additions and 53 deletions
@ -1,63 +1,66 @@ |
|||||||
<div class="govuk-grid-row"> |
<div class="govuk-grid-row"> |
||||||
<div class="govuk-grid-column-three-quarters-from-desktop"> |
<div class="govuk-grid-column-three-quarters-from-desktop"> |
||||||
|
|
||||||
|
|
||||||
<%= form_with model: @log, url: lettings_log_confirm_clear_answer_path(@log), method: "post", local: true do |f| %> |
<%= form_with model: @log, url: lettings_log_confirm_clear_answer_path(@log), method: "post", local: true do |f| %> |
||||||
<%= f.govuk_error_summary %> |
<%= f.govuk_error_summary %> |
||||||
<%= f.hidden_field :page_id, value: @page.id %> |
<%= f.hidden_field :page_id, value: @page.id %> |
||||||
|
|
||||||
<h1 class="govuk-heading-m govuk-!-margin-bottom-6"> |
<h1 class="govuk-heading-m"> |
||||||
<span class="govuk-grid-column-two-thirds"> |
<div class="govuk-grid-row"> |
||||||
Make sure these answers are correct: |
<span class="govuk-grid-column-two-thirds"> |
||||||
</span> |
Make sure these answers are correct: |
||||||
<span class="govuk-body govuk-!-text-align-right govuk-grid-column-one-third"> |
</span> |
||||||
<%= govuk_link_to "Clear all", lettings_log_confirm_clear_all_answers_path(@log) %> |
<span class="govuk-body govuk-!-text-align-right govuk-grid-column-one-third"> |
||||||
</span> |
<%= govuk_link_to "Clear all", lettings_log_confirm_clear_all_answers_path(@log) %> |
||||||
|
</span> |
||||||
|
</div> |
||||||
</h1> |
</h1> |
||||||
|
|
||||||
<div class="govuk-summary-card__content"> |
<div class="govuk-summary-card"> |
||||||
<% applicable_questions = @questions.reject { |q| q.hidden_in_check_answers?(@log, current_user) }%> |
<div class="govuk-summary-card__content"> |
||||||
<% applicable_questions.each do |question| %> |
<% applicable_questions = @questions.reject { |q| q.hidden_in_check_answers?(@log, current_user) } %> |
||||||
<%= f.hidden_field question.id, value: @log[question.id] %> |
|
||||||
<dl class="govuk-summary-list"> |
<dl class="govuk-summary-list"> |
||||||
<div class="govuk-summary-list__row"> |
<% applicable_questions.each do |question| %> |
||||||
<dt class="govuk-summary-list__key"> |
<%= f.hidden_field question.id, value: @log[question.id] %> |
||||||
<%= get_question_label(question) %> |
<div class="govuk-summary-list__row"> |
||||||
</dt> |
<dt class="govuk-summary-list__key"> |
||||||
<dd class="govuk-summary-list__value"> |
<%= get_question_label(question) %> |
||||||
<%= simple_format( |
</dt> |
||||||
get_answer_label(question, @log), |
<dd class="govuk-summary-list__value"> |
||||||
wrapper_tag: "span", |
<%= simple_format( |
||||||
class: "govuk-!-margin-right-4", |
get_answer_label(question, @log), |
||||||
) %> |
|
||||||
|
|
||||||
<% extra_value = question.get_extra_check_answer_value(@log) %> |
|
||||||
|
|
||||||
<% if extra_value && question.answer_label(@log).present? %> |
|
||||||
<%= simple_format( |
|
||||||
extra_value, |
|
||||||
wrapper_tag: "span", |
wrapper_tag: "span", |
||||||
class: "govuk-!-font-weight-regular app-!-colour-muted", |
class: "govuk-!-margin-right-4", |
||||||
) %> |
) %> |
||||||
<% end %> |
|
||||||
|
|
||||||
<% question.get_inferred_answers(@log).each do |inferred_answer| %> |
<% extra_value = question.get_extra_check_answer_value(@log) %> |
||||||
<span class="govuk-!-font-weight-regular app-!-colour-muted"><%= inferred_answer %></span> |
|
||||||
|
<% if extra_value && question.answer_label(@log).present? %> |
||||||
|
<%= simple_format( |
||||||
|
extra_value, |
||||||
|
wrapper_tag: "span", |
||||||
|
class: "govuk-!-font-weight-regular app-!-colour-muted", |
||||||
|
) %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<% question.get_inferred_answers(@log).each do |inferred_answer| %> |
||||||
|
<span class="govuk-!-font-weight-regular app-!-colour-muted"><%= inferred_answer %></span> |
||||||
|
<% end %> |
||||||
|
</dd> |
||||||
|
<dd class="govuk-summary-list__actions"> |
||||||
|
<% if question.displayed_as_answered?(@log) %> |
||||||
|
<input type="submit" value="Clear" name=<%= question.id %> class="govuk-body govuk-link submit-button-link" > |
||||||
|
<% else %> |
||||||
|
<%= govuk_link_to "Answer", send("#{@log.model_name.param_key}_#{question.page.id}_path", @log, referrer: "check_errors", original_page_id: @page.id, related_question_ids: applicable_questions.map(&:id)) %> |
||||||
<% end %> |
<% end %> |
||||||
</dd> |
</dd> |
||||||
<dd class="govuk-summary-list__actions"> |
</div> |
||||||
<% if question.displayed_as_answered?(@log) %> |
<% end %> |
||||||
<input type="submit" value="Clear" name=<%= question.id %> class="govuk-body govuk-link submit-button-link" > |
|
||||||
<% else %> |
|
||||||
<%= govuk_link_to "Answer", send("#{@log.model_name.param_key}_#{question.page.id}_path", @log, referrer: "check_errors", original_page_id: @page.id, related_question_ids: applicable_questions.map(&:id)) %> |
|
||||||
<% end %> |
|
||||||
</dd> |
|
||||||
</div> |
|
||||||
</dl> |
</dl> |
||||||
<% end %> |
</div> |
||||||
</div> |
</div> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
<%= govuk_button_link_to "Confirm and continue", "/" %> |
<%= govuk_button_link_to "Confirm and continue", "/" %> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
|
Loading…
Reference in new issue