Browse Source
* CLDC-3187: Display org id on stock owner / managing agent pages * Fix indentation * Refactor stock owner / managing agent list partials into one shared partial * Fix linting * Use managing agents instead of agents in search component display * Update tests to reflect agents -> managing agents changepull/2279/head^2
Rachael Booth
10 months ago
committed by
GitHub
6 changed files with 59 additions and 49 deletions
@ -1,22 +0,0 @@ |
|||||||
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> |
|
||||||
<%= govuk_table do |table| %> |
|
||||||
<%= 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)) %> |
|
||||||
<% end %> |
|
||||||
<% @managing_agents.each do |managing_agent| %> |
|
||||||
<%= table.with_body do |body| %> |
|
||||||
<%= body.with_row do |row| %> |
|
||||||
<% row.with_cell(text: managing_agent.name) %> |
|
||||||
<% 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 %> |
|
||||||
</section> |
|
@ -0,0 +1,36 @@ |
|||||||
|
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> |
||||||
|
<%= govuk_table do |table| %> |
||||||
|
<%= 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: search_item, filters_count: 0)) %> |
||||||
|
<% end %> |
||||||
|
<%= table.with_head do |head| %> |
||||||
|
<%= 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| %> |
||||||
|
<% related_orgs.each do |org| %> |
||||||
|
<%= body.with_row do |row| %> |
||||||
|
<% if current_user.support? %> |
||||||
|
<% row.with_cell(text: simple_format(govuk_link_to(org.name, organisation_path(org)), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> |
||||||
|
<% else %> |
||||||
|
<% row.with_cell(text: org.name) %> |
||||||
|
<% end %> |
||||||
|
<% row.with_cell(text: "ORG#{org.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", remove_path.call(org.id)) %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
</section> |
@ -1,22 +0,0 @@ |
|||||||
<section class="app-table-group" tabindex="0" aria-labelledby="<%= title.dasherize %>"> |
|
||||||
<%= govuk_table do |table| %> |
|
||||||
<%= 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)) %> |
|
||||||
<% end %> |
|
||||||
<% @stock_owners.each do |stock_owner| %> |
|
||||||
<%= table.with_body do |body| %> |
|
||||||
<%= body.with_row do |row| %> |
|
||||||
<% row.with_cell(text: stock_owner.name) %> |
|
||||||
<% 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", stock_owners_remove_organisation_path(target_organisation_id: stock_owner.id)) %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
<% end %> |
|
||||||
</section> |
|
Loading…
Reference in new issue