From b0063b7e55c08a5a7a3ee15fd3cccdecff8921ef Mon Sep 17 00:00:00 2001 From: JG Date: Thu, 9 Jun 2022 13:15:44 +0100 Subject: [PATCH] partial for schemes --- app/views/schemes/_scheme_list.html.erb | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 app/views/schemes/_scheme_list.html.erb diff --git a/app/views/schemes/_scheme_list.html.erb b/app/views/schemes/_scheme_list.html.erb new file mode 100644 index 000000000..259d83ff9 --- /dev/null +++ b/app/views/schemes/_scheme_list.html.erb @@ -0,0 +1,39 @@ +
+ <%= govuk_table do |table| %> + <%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> + + <% if searched.present? %> + <%= pagy.count %> <%= item_label %> found matching ‘<%= searched %>’ of <%= total_count %> total schemes. <%= govuk_link_to("Clear search", request.path) %> + <% else %> + <%= pagy.count %> total schemes. + <% end %> + + <% end %> + <%= table.head do |head| %> + <%= head.row do |row| %> + <% row.cell(header: true, text: "Code", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Service", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Managing agent", html_attributes: { + scope: "col", + }) %> + <% row.cell(header: true, text: "Created", html_attributes: { + scope: "col", + }) %> + <% end %> + <% end %> + <% @schemes.each do |scheme| %> + <%= table.body do |body| %> + <%= body.row do |row| %> + <% row.cell(text: scheme.code) %> + <% row.cell(text: scheme.service) %> + <% row.cell(text: scheme.organisation.name) %> + <% row.cell(text: scheme.created_at.to_formatted_s(:govuk_date)) %> + <% end %> + <% end %> + <% end %> + <% end %> +