Browse Source

Lint ERB templates

pull/498/head
Paul Robert Lloyd 3 years ago
parent
commit
6e3ee6368a
  1. 2
      app/views/case_logs/_tasklist.html.erb
  2. 2
      app/views/form/check_answers.html.erb
  3. 10
      app/views/form/review.html.erb
  4. 12
      app/views/layouts/application.html.erb

2
app/views/case_logs/_tasklist.html.erb

@ -23,4 +23,4 @@
</ul> </ul>
</li> </li>
<% end %> <% end %>
</ol> </ol>

2
app/views/form/check_answers.html.erb

@ -17,7 +17,7 @@
<% end %> <% end %>
<%= display_answered_questions_summary(subsection, @case_log) %> <%= display_answered_questions_summary(subsection, @case_log) %>
<%= render partial: 'form/check_answers_summary_list', locals: { <%= render partial: "form/check_answers_summary_list", locals: {
subsection:, subsection:,
case_log: @case_log, case_log: @case_log,
} %> } %>

10
app/views/form/review.html.erb

@ -1,8 +1,8 @@
<% content_for :title, "Review lettings log" %> <% content_for :title, "Review lettings log" %>
<% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: { <% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: {
"Logs" => "/logs", "Logs" => "/logs",
"Log #{@case_log.id.to_s}" => "/logs/" + @case_log.id.to_s, "Log #{@case_log.id}" => "/logs/#{@case_log.id}",
"Review lettings log" => "" "Review lettings log" => "",
}) %> }) %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
@ -13,15 +13,15 @@
<p class="govuk-body"> <p class="govuk-body">
You can review and make changes to this log up to 3 months after the end of the current collection year, which closes on 31 March <%= @case_log.collection_start_year.present? ? @case_log.collection_start_year + 1 : "" %>. You can review and make changes to this log up to 3 months after the end of the current collection year, which closes on 31 March <%= @case_log.collection_start_year.present? ? @case_log.collection_start_year + 1 : "" %>.
</p> </p>
<% @case_log.form.sections.map do |section| %> <% @case_log.form.sections.map do |section| %>
<h2 class="govuk-heading-m"><%= section.label %></h2> <h2 class="govuk-heading-m"><%= section.label %></h2>
<% section.subsections.map do |subsection| %> <% section.subsections.map do |subsection| %>
<div class="x-govuk-summary-card govuk-!-margin-bottom-6"> <div class="x-govuk-summary-card govuk-!-margin-bottom-6">
<div class="x-govuk-summary-card__header"> <div class="x-govuk-summary-card__header">
<h3 class="x-govuk-summary-card__title"><%= subsection.label %></h3> <h3 class="x-govuk-summary-card__title"><%= subsection.label %></h3>
</div> </div>
<div class="x-govuk-summary-card__body"> <div class="x-govuk-summary-card__body">
<%= render partial: 'form/check_answers_summary_list', locals: { <%= render partial: "form/check_answers_summary_list", locals: {
subsection:, subsection:,
case_log: @case_log, case_log: @case_log,
} %> } %>

12
app/views/layouts/application.html.erb

@ -45,7 +45,7 @@
<%= govuk_header( <%= govuk_header(
classes: "app-header", classes: "app-header",
service_url: current_user.nil? ? "/" : "/logs", service_url: current_user.nil? ? "/" : "/logs",
navigation_classes: "govuk-header__navigation--end" navigation_classes: "govuk-header__navigation--end",
) do |component| ) do |component|
component.product_name(name: t("service_name")) component.product_name(name: t("service_name"))
if current_user.nil? if current_user.nil?
@ -68,14 +68,14 @@
<% if current_user.support? %> <% if current_user.support? %>
<% items = [ <% items = [
{ name: "Organisations", url: "/organisations", comparable_urls: ["/details", "/organisations"] }, { name: "Organisations", url: "/organisations", comparable_urls: ["/details", "/organisations"] },
{ name: "Users", url: "/users", comparable_urls: ["/users", "/account"] }, { name: "Users", url: "/users", comparable_urls: ["/users", "/account"] },
{ name: "Logs", url: case_logs_path, comparable_urls: ["/logs"] }, { name: "Logs", url: case_logs_path, comparable_urls: ["/logs"] },
] %> ] %>
<% else %> <% else %>
<% items = [ <% items = [
{ name: "Logs", url: case_logs_path, comparable_urls: ["/logs"] }, { name: "Logs", url: case_logs_path, comparable_urls: ["/logs"] },
{ name: "Users", url: users_organisation_path(current_user.organisation), comparable_urls: ["/users", "/account"] }, { name: "Users", url: users_organisation_path(current_user.organisation), comparable_urls: ["/users", "/account"] },
{ name: "About your organisation", url: "/organisations/#{current_user.organisation.id}", comparable_urls: ["/details"] }, { name: "About your organisation", url: "/organisations/#{current_user.organisation.id}", comparable_urls: ["/details"] },
] %> ] %>
<% end %> <% end %>
<%= render PrimaryNavigationComponent.new(items:) %> <%= render PrimaryNavigationComponent.new(items:) %>

Loading…
Cancel
Save