Browse Source

CLDC-3187: Display org id on stock owner / managing agent pages

pull/2274/head
Rachael Booth 2 years ago
parent
commit
e87dda36b3
  1. 34
      app/views/organisation_relationships/_managing_agent_list.erb
  2. 20
      app/views/organisation_relationships/_stock_owner_list.erb

34
app/views/organisation_relationships/_managing_agent_list.erb

@ -3,20 +3,34 @@
<%= table.with_caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> <%= table.with_caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %>
<%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "agents", filters_count: 0)) %> <%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "agents", filters_count: 0)) %>
<% end %> <% end %>
<% @managing_agents.each do |managing_agent| %> <%= table.with_head do |head| %>
<%= table.with_body do |body| %> <%= head.with_row do |row| %>
<%= body.with_row do |row| %> <% row.with_cell(header: true, text: "Organisation name", html_attributes: { scope: "col", class: "govuk-!-width-one-half" }) %>
<% row.with_cell(text: managing_agent.name) %> <% row.with_cell(header: true, text: "Organisation ID", html_attributes: { scope: "col", class: "govuk-!-width-one-half" }) %>
<% if current_user.data_coordinator? || current_user.support? %> <% if current_user.data_coordinator? || current_user.support? %>
<% row.with_cell(html_attributes: { <% row.with_cell %>
scope: "row", <% end %>
class: "govuk-!-text-align-right", <% end %>
}) do %> <% end %>
<%= govuk_link_to("Remove", managing_agents_remove_organisation_path(target_organisation_id: managing_agent.id)) %> <%= table.with_body do |body| %>
<% @managing_agents.each do |managing_agent| %>
<%= body.with_row do |row| %>
<% if current_user.support? %>
<% row.with_cell(text: simple_format(govuk_link_to(managing_agent.name, organisation_path(managing_agent)), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% else %>
<% row.with_cell(text: managing_agent.name) %>
<% end %>
<% row.with_cell(text: "ORG#{managing_agent.id}") %>
<% if current_user.data_coordinator? || current_user.support? %>
<% row.with_cell(html_attributes: {
scope: "row",
class: "govuk-!-text-align-right",
}) do %>
<%= govuk_link_to("Remove", managing_agents_remove_organisation_path(target_organisation_id: managing_agent.id)) %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %>
</section> </section>

20
app/views/organisation_relationships/_stock_owner_list.erb

@ -3,10 +3,24 @@
<%= table.with_caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %> <%= table.with_caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular]) do |caption| %>
<%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "stock owners", filters_count: 0)) %> <%= render(SearchResultCaptionComponent.new(searched:, count: pagy.count, item_label:, total_count:, item: "stock owners", filters_count: 0)) %>
<% end %> <% end %>
<% @stock_owners.each do |stock_owner| %> <%= table.with_head do |head| %>
<%= table.with_body do |body| %> <%= head.with_row do |row| %>
<% row.with_cell(header: true, text: "Organisation name", html_attributes: { scope: "col", class: "govuk-!-width-one-half" }) %>
<% row.with_cell(header: true, text: "Organisation ID", html_attributes: { scope: "col", class: "govuk-!-width-one-half" }) %>
<% if current_user.data_coordinator? || current_user.support? %>
<% row.with_cell %>
<% end %>
<% end %>
<% end %>
<%= table.with_body do |body| %>
<% @stock_owners.each do |stock_owner| %>
<%= body.with_row do |row| %> <%= body.with_row do |row| %>
<% row.with_cell(text: stock_owner.name) %> <% if current_user.support? %>
<% row.with_cell(text: simple_format(govuk_link_to(stock_owner.name, organisation_path(stock_owner)), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% else %>
<% row.with_cell(text: stock_owner.name) %>
<% end %>
<% row.with_cell(text: "ORG#{stock_owner.id}") %>
<% if current_user.data_coordinator? || current_user.support? %> <% if current_user.data_coordinator? || current_user.support? %>
<% row.with_cell(html_attributes: { <% row.with_cell(html_attributes: {
scope: "row", scope: "row",

Loading…
Cancel
Save