Browse Source

fixed views

pull/608/head
JG 3 years ago
parent
commit
3efdf5058e
  1. 6
      app/views/case_logs/_log_list.html.erb
  2. 16
      app/views/case_logs/index.html.erb

6
app/views/case_logs/_log_list.html.erb

@ -1,9 +1,11 @@
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> <section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>">
<%= govuk_table do |table| %> <%= govuk_table do |table| %>
<%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular], id: title.dasherize) do |caption| %> <%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular], id: title.dasherize) do |caption| %>
<span class="govuk-!-margin-right-4"> <% if searched.present? %>
<strong><%= pagy.count %></strong> <%= item_label %> found matching ‘<%= searched %>’ of <strong><%= total_count %></strong> total <%= title.downcase %>. <%= govuk_link_to("Clear search", request.path) %>
<% else %>
<strong><%= pagy.count %></strong> total <%= title.downcase %> <strong><%= pagy.count %></strong> total <%= title.downcase %>
</span> <% end %>
<%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %> <%= govuk_link_to "Download (CSV)", "/logs.csv", type: "text/csv" %>
<% end %> <% end %>
<%= table.head do |head| %> <%= table.head do |head| %>

16
app/views/case_logs/index.html.erb

@ -1,10 +1,22 @@
<% item_label = @pagy.count > 1 ? "logs" : "log" %>
<% if @searched.present? %>
<% title = "Your organisation (#{@pagy.count} #{item_label} matching ‘#{@searched}’ of #{@total_count} total logs)" %>
<% else %>
<% title = "Your organisation (Logs)" %>
<% end %>
<% content_for :title, "Logs" %> <% content_for :title, "Logs" %>
<h1 class="govuk-heading-l"> <h1 class="govuk-heading-l">
<%= content_for(:title) %> <%= content_for(:title) %>
</h1> </h1>
<%= render LogSearchComponent.new(current_user:, label: "Search by log ID, tenant code, property reference or postcode") %> <%= render SearchComponent.new(current_user:, search_label: "Search by log ID, tenant code, property reference or postcode", value: @searched) %>
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m">
<div class="app-filter-layout" data-controller="filter-layout"> <div class="app-filter-layout" data-controller="filter-layout">
<div class="govuk-button-group app-filter-toggle"> <div class="govuk-button-group app-filter-toggle">
@ -15,7 +27,7 @@
<%= render partial: "log_filters" %> <%= render partial: "log_filters" %>
<% if @case_logs.present? %> <% if @case_logs.present? %>
<div class="app-filter-layout__content"> <div class="app-filter-layout__content">
<%= render partial: "log_list", locals: { case_logs: @case_logs, title: "Logs", pagy: @pagy } %> <%= render partial: "log_list", locals: { case_logs: @case_logs, title: "Logs", pagy: @pagy, searched: @searched, item_label:, total_count: @total_count } %>
<%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "logs" } %> <%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "logs" } %>
</div> </div>
<% end %> <% end %>

Loading…
Cancel
Save