-
- <%= form_with url: "/logs/filter", html: { method: :post }, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
- <%= f.govuk_check_boxes_fieldset :status do %>
- <% statuses = {in_progress: "In progress", submitted: "Completed", archived: "Not started"} %>
- <% statuses.map do |key, option| %>
- <%= f.govuk_check_box "status", "#{key}",
- label: { text: option },
- checked: filter_selected?(key),
- class: "govuk-checkboxes govuk-checkboxes--small" %>
- <% end %>
- <% end %>
- <%= f.govuk_submit "Apply filters"%>
+
+
+
+ <%= pagy.count %> total <%= title.downcase %>
+
+ Download (CSV)
+
+
+
+
+
+
+
+
+
+
+
+ <% if current_user.support? %>
+
+
<% end %>
-
-
-
-
-
-
-
-
- <%= pagy.count %> total <%= title.downcase %>
-
- Download (CSV)
-
-
-
-
-
-
-
-
-
-
-
- <% if current_user.support? %>
-
-
- <% end %>
-
-
-
- <% case_logs.map do |log| %>
-
-
-
- <%= log.tenant_code? ? log.tenant_code : '–' %>
-
-
- <%= log.propcode? ? log.propcode : '–' %>
-
-
- <%= log.startdate.present? ? log.startdate.to_formatted_s(:govuk_date) : '–' %>
-
-
- <%= log.created_at.to_formatted_s(:govuk_date) %>
-
-
- <%= govuk_tag(
- colour: log.status == 'completed' ? 'blue' : 'grey',
- text: log.status.humanize
- ) %>
-
- <% if current_user.support? %>
-
- <%= log.owning_organisation.name %>
-
-
- <%= log.managing_organisation.name %>
-
- <% end %>
-
- <% end %>
-
-
-
-
-
-
+
+
+
+ <% case_logs.map do |log| %>
+
+
+
+ <%= log.tenant_code? ? log.tenant_code : '–' %>
+
+
+ <%= log.propcode? ? log.propcode : '–' %>
+
+
+ <%= log.startdate.present? ? log.startdate.to_formatted_s(:govuk_date) : '–' %>
+
+
+ <%= log.created_at.to_formatted_s(:govuk_date) %>
+
+
+ <%= govuk_tag(
+ colour: log.status == 'completed' ? 'blue' : 'grey',
+ text: log.status.humanize
+ ) %>
+
+ <% if current_user.support? %>
+
+ <%= log.owning_organisation.name %>
+
+
+ <%= log.managing_organisation.name %>
+
+ <% end %>
+
+ <% end %>
+
+
+
+
+
diff --git a/app/views/case_logs/index.html.erb b/app/views/case_logs/index.html.erb
index b1d40c173..5f1040274 100644
--- a/app/views/case_logs/index.html.erb
+++ b/app/views/case_logs/index.html.erb
@@ -5,11 +5,18 @@
+ <%= govuk_button_link_to 'Hide filters', "", secondary: true %>
<%= govuk_button_to "Create a new lettings log", case_logs_path %>
<%#= govuk_link_to "Upload logs", bulk_upload_case_logs_path %>
-<% if @case_logs.present? %>
- <%= render partial: "log_list", locals: { case_logs: @case_logs, title: "Logs", pagy: @pagy } %>
- <%== render partial: 'pagy/nav', locals: { pagy: @pagy, item_name: "logs" } %>
-<% end %>
+
+ <%= render partial: "log_filters"%>
+ <% if @case_logs.present? %>
+
+ <%= render partial: "log_list", locals: { case_logs: @case_logs, title: "Logs", pagy: @pagy } %>
+ <%== render partial: 'pagy/nav', locals: { pagy: @pagy, item_name: "logs" } %>
+
+ <% end %>
+
+
diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb
index 1ef323ab0..1d44e4fa9 100644
--- a/spec/helpers/filters_helper_spec.rb
+++ b/spec/helpers/filters_helper_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe FiltersHelper do
end
end
- context "one filter is selected" do
+ context "when one filter is selected" do
before do
cookies[:case_logs_filters] = { "status": "in_progress" }.to_json
end