diff --git a/app/components/log_summary_component.html.erb b/app/components/log_summary_component.html.erb
new file mode 100644
index 000000000..a273ac31d
--- /dev/null
+++ b/app/components/log_summary_component.html.erb
@@ -0,0 +1,67 @@
+
+
+
+
+
+ <% if log.needstype? or log.startdate? %>
+
+ <% if log.needstype? %>
+ <%= log.is_general_needs? ? "General needs" : "Supported housing" %>
+ <% end %>
+ <% if log.startdate? %>
+ Tenancy starts <%= log.startdate.to_formatted_s(:govuk_date) %>
+ <% end %>
+
+ <% end %>
+
+ <% if current_user.support? %>
+ <% if log.owning_organisation or log.managing_organisation %>
+
+
+
Owned by
+ <%= log.owning_organisation&.name %>
+
+
+
Managed by
+ <%= log.managing_organisation&.name %>
+
+
+ <% end %>
+ <% end %>
+
+
+
+
+
diff --git a/app/components/log_summary_component.rb b/app/components/log_summary_component.rb
new file mode 100644
index 000000000..bbd504e5d
--- /dev/null
+++ b/app/components/log_summary_component.rb
@@ -0,0 +1,13 @@
+class LogSummaryComponent < ViewComponent::Base
+ attr_reader :current_user, :log
+
+ def initialize(current_user:, log:)
+ @current_user = current_user
+ @log = log
+ super
+ end
+
+ def log_status
+ helpers.status_tag(log.status)
+ end
+end
diff --git a/app/frontend/styles/_log.scss b/app/frontend/styles/_log.scss
new file mode 100644
index 000000000..f24f92a3f
--- /dev/null
+++ b/app/frontend/styles/_log.scss
@@ -0,0 +1,23 @@
+.app-log-summary {
+ border-top: 1px solid $govuk-border-colour;
+ padding-top: govuk-spacing(3);
+}
+
+.app-log-summary__header {
+ align-items: baseline;
+ display: flex;
+}
+
+.app-log-summary__title {
+ margin: 0 govuk-spacing(3) govuk-spacing(2) 0;
+}
+
+@include govuk-media-query(tablet) {
+ .app-log-summary__footer {
+ text-align: right;
+ }
+
+ .app-log-summary__footer--actor {
+ display: block;
+ }
+}
diff --git a/app/frontend/styles/_metadata.scss b/app/frontend/styles/_metadata.scss
new file mode 100644
index 000000000..7dc18d9b7
--- /dev/null
+++ b/app/frontend/styles/_metadata.scss
@@ -0,0 +1,23 @@
+.app-metadata {
+ @include govuk-font($size: 16, $tabular: true);
+ color: $govuk-secondary-text-colour;
+ margin-top: 0;
+
+ &--inline {
+ display: flex;
+ gap: govuk-spacing(3);
+ margin: 0;
+ }
+
+ &__item {
+ display: flex;
+ }
+
+ &__term {
+ margin-right: govuk-spacing(1);
+ }
+
+ &__definition {
+ margin-left: 0;
+ }
+}
diff --git a/app/frontend/styles/application.scss b/app/frontend/styles/application.scss
index 4b26044d1..e862aec23 100644
--- a/app/frontend/styles/application.scss
+++ b/app/frontend/styles/application.scss
@@ -30,6 +30,8 @@ $govuk-breakpoints: (
@import "filter-layout";
@import "header";
@import "input";
+@import "log";
+@import "metadata";
@import "related-navigation";
@import "section-skip-link";
@import "table-group";
diff --git a/app/views/case_logs/_log_list.html.erb b/app/views/case_logs/_log_list.html.erb
index 43a0bc701..6dab48bbc 100644
--- a/app/views/case_logs/_log_list.html.erb
+++ b/app/views/case_logs/_log_list.html.erb
@@ -1,68 +1,8 @@
-
- <%= govuk_table do |table| %>
- <%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular], id: title.dasherize) do |caption| %>
- <%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", path: request.path)) %>
- <%= govuk_link_to "Download (CSV)", "#{request.path}.csv", type: "text/csv" %>
- <% end %>
- <%= table.head do |head| %>
- <%= head.row do |row| %>
- <% row.cell(header: true, text: "Log", html_attributes: {
- scope: "col",
- }) %>
- <% row.cell(header: true, text: "Tenant", html_attributes: {
- scope: "col",
- }) %>
- <% row.cell(header: true, text: "Property", html_attributes: {
- scope: "col",
- }) %>
- <% row.cell(header: true, text: "Tenancy starts", html_attributes: {
- scope: "col",
- }) %>
- <% row.cell(header: true, text: "Log created", html_attributes: {
- scope: "col",
- }) %>
- <% row.cell(header: true, text: "Log status", html_attributes: {
- scope: "col",
- }) %>
- <% if current_user.support? %>
- <% row.cell(header: true, text: "Owning organisation", html_attributes: {
- scope: "col",
- }) %>
- <% row.cell(header: true, text: "Managing organisation", html_attributes: {
- scope: "col",
- }) %>
- <% end %>
- <% end %>
- <% end %>
- <%= table.body do |body| %>
- <% case_logs.map do |log| %>
- <%= body.row do |row| %>
- <% row.cell(header: true, html_attributes: {
- scope: "row",
- }) do %>
- <%= govuk_link_to case_log_path(log) do %>
- Log <%= log.id %>
- <% end %>
- <% end %>
- <% row.cell(
- text: log.tenancycode? ? log.tenancycode : "–",
- classes: "app-!-font-tabular",
- ) %>
- <% row.cell(
- text: log.propcode? ? log.propcode : "–",
- classes: "app-!-font-tabular",
- ) %>
- <% row.cell(text: log.startdate.present? ? log.startdate.to_formatted_s(:govuk_date) : "–") %>
- <% row.cell(text: log.created_at.to_formatted_s(:govuk_date)) %>
- <% row.cell do %>
- <%= status_tag(log.status) %>
- <% end %>
- <% if current_user.support? %>
- <% row.cell(text: log.owning_organisation&.name) %>
- <% row.cell(text: log.managing_organisation&.name) %>
- <% end %>
- <% end %>
- <% end %>
- <% end %>
- <% end %>
-
+
+ <%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "logs", path: request.path)) %>
+ <%= govuk_link_to "Download (CSV)", "#{request.path}.csv", type: "text/csv" %>
+
+
+<% case_logs.map do |log| %>
+ <%= render(LogSummaryComponent.new(current_user:, log:)) %>
+<% end %>
diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb
index eef4744d4..30007fc4d 100644
--- a/spec/requests/case_logs_controller_spec.rb
+++ b/spec/requests/case_logs_controller_spec.rb
@@ -172,10 +172,10 @@ RSpec.describe CaseLogsController, type: :request do
sign_in user
end
- it "does have organisation columns" do
+ it "does have organisation values" do
get "/logs", headers: headers, params: {}
- expect(page).to have_content("Owning organisation")
- expect(page).to have_content("Managing organisation")
+ expect(page).to have_content("Owned by")
+ expect(page).to have_content("Managed by")
end
it "shows case logs for all organisations" do
@@ -449,7 +449,7 @@ RSpec.describe CaseLogsController, type: :request do
end
it "shows a table of logs" do
- expect(CGI.unescape_html(response.body)).to match(//)
+ expect(CGI.unescape_html(response.body)).to match(//)
expect(CGI.unescape_html(response.body)).to match(/logs/)
end