From 258b1332863d3de9bdef8bcf805e528cb1347caf Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 20 Jun 2024 12:37:30 +0100 Subject: [PATCH] Update styling and lint --- app/frontend/styles/_button.scss | 8 ++ app/frontend/styles/application.scss | 8 -- .../confirm_clear_answer.html.erb | 2 +- app/views/form/check_errors.html.erb | 89 ++++++++++--------- app/views/form/page.html.erb | 2 +- 5 files changed, 56 insertions(+), 53 deletions(-) diff --git a/app/frontend/styles/_button.scss b/app/frontend/styles/_button.scss index 5975da0cb..789f2d4ad 100644 --- a/app/frontend/styles/_button.scss +++ b/app/frontend/styles/_button.scss @@ -29,3 +29,11 @@ $app-button-inverse-hover-background-colour: govuk-tint($app-button-inverse-fore background-color: $app-button-inverse-hover-background-colour; box-shadow: inset 0 0 0 2px $govuk-focus-colour; } + +.submit-button-link { + background: none; + border: none; + color: #1d70b8; + text-decoration: underline; + cursor: pointer; +} diff --git a/app/frontend/styles/application.scss b/app/frontend/styles/application.scss index 1367e78e9..a81214894 100644 --- a/app/frontend/styles/application.scss +++ b/app/frontend/styles/application.scss @@ -81,11 +81,3 @@ $govuk-breakpoints: ( .govuk-footer { border-top: govuk-spacing(2) solid $govuk-brand-colour; } - -.submit-button-link { - background: none; - border: none; - color: #1d70b8; - text-decoration: underline; - cursor: pointer; -} \ No newline at end of file diff --git a/app/views/check_errors/confirm_clear_answer.html.erb b/app/views/check_errors/confirm_clear_answer.html.erb index 8549eae78..08ca98119 100644 --- a/app/views/check_errors/confirm_clear_answer.html.erb +++ b/app/views/check_errors/confirm_clear_answer.html.erb @@ -17,7 +17,7 @@ <%= f.hidden_field :clear_question_id, value: @question.id %> <%= f.hidden_field :page, value: @page.id %> - +
<%= f.govuk_submit "Confirm and continue", name: "check_errors" %> <%= govuk_button_link_to( diff --git a/app/views/form/check_errors.html.erb b/app/views/form/check_errors.html.erb index 94852618b..6e7cc47ea 100644 --- a/app/views/form/check_errors.html.erb +++ b/app/views/form/check_errors.html.erb @@ -1,63 +1,66 @@
- <%= form_with model: @log, url: lettings_log_confirm_clear_answer_path(@log), method: "post", local: true do |f| %> <%= f.govuk_error_summary %> <%= f.hidden_field :page_id, value: @page.id %> -

- - Make sure these answers are correct: - - - <%= govuk_link_to "Clear all", lettings_log_confirm_clear_all_answers_path(@log) %> - +

+
+ + Make sure these answers are correct: + + + <%= govuk_link_to "Clear all", lettings_log_confirm_clear_all_answers_path(@log) %> + +

-
- <% applicable_questions = @questions.reject { |q| q.hidden_in_check_answers?(@log, current_user) }%> - <% applicable_questions.each do |question| %> - <%= f.hidden_field question.id, value: @log[question.id] %> +
+
+ <% applicable_questions = @questions.reject { |q| q.hidden_in_check_answers?(@log, current_user) } %>
-
-
- <%= get_question_label(question) %> -
-
- <%= simple_format( - get_answer_label(question, @log), - wrapper_tag: "span", - class: "govuk-!-margin-right-4", - ) %> - - <% extra_value = question.get_extra_check_answer_value(@log) %> - - <% if extra_value && question.answer_label(@log).present? %> - <%= simple_format( - extra_value, + <% applicable_questions.each do |question| %> + <%= f.hidden_field question.id, value: @log[question.id] %> +
+
+ <%= get_question_label(question) %> +
+
+ <%= simple_format( + get_answer_label(question, @log), 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| %> - <%= inferred_answer %> + <% extra_value = question.get_extra_check_answer_value(@log) %> + + <% 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| %> + <%= inferred_answer %> + <% end %> +
+
+ <% if question.displayed_as_answered?(@log) %> + 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 %> -
-
- <% if question.displayed_as_answered?(@log) %> - 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 %> - <% end %> +
<% end %> - + <%= govuk_button_link_to "Confirm and continue", "/" %>
diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index 5453de7f7..dbfae1b6f 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -78,7 +78,7 @@ <% if all_questions_with_errors.count > 1 %>
- <%= f.govuk_submit "See all related answers", :name => "check_errors", secondary: true %> + <%= f.govuk_submit "See all related answers", name: "check_errors", secondary: true, class: "govuk-body govuk-link submit-button-link" %>
<% end %>