|
|
|
<% item_label = format_label(@pagy.count, "organisation") %>
|
|
|
|
<% title = format_title(@searched, "Organisations", current_user, item_label, @pagy.count, nil) %>
|
|
|
|
|
|
|
|
<% content_for :title, title %>
|
|
|
|
|
|
|
|
<h1 class="govuk-heading-l">
|
|
|
|
<% if current_user.support? && request.path == "/organisations" %>
|
|
|
|
Organisations
|
|
|
|
<% end %>
|
|
|
|
<% if current_user.support? && request.path != "/organisations" %>
|
|
|
|
<span class="govuk-caption-l"><%= @organisation.name %></span>
|
|
|
|
<h1 class="govuk-heading-l">Organisations</h1>
|
|
|
|
<% end %>
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
<% items = tab_items(current_user) %>
|
|
|
|
|
|
|
|
<h2 class="govuk-visually-hidden">Organisations</h2>
|
|
|
|
|
|
|
|
<% if current_user.support? %>
|
|
|
|
<%= govuk_button_link_to "Create a new organisation", new_organisation_path, html: { method: :get } %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= render SearchComponent.new(current_user:, search_label: "Search by organisation name", value: @searched) %>
|
|
|
|
|
|
|
|
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m">
|
|
|
|
|
|
|
|
<%= render partial: "organisation_list", locals: { organisations: @organisations, title: "Organisations", pagy: @pagy, searched: @searched, item_label:, total_count: @total_count } %>
|
|
|
|
<%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "organisations" } %>
|