6 changed files with 80 additions and 3 deletions
@ -1,3 +1,7 @@ |
|||||||
class MergeRequest < ApplicationRecord |
class MergeRequest < ApplicationRecord |
||||||
belongs_to :requesting_organisation, class_name: "Organisation" |
belongs_to :requesting_organisation, class_name: "Organisation" |
||||||
|
|
||||||
|
def merging_organisations |
||||||
|
Organisation.where(id: merging_organisation_ids) |
||||||
|
end |
||||||
end |
end |
||||||
|
|||||||
@ -0,0 +1,47 @@ |
|||||||
|
<% title = "Tell us if your organisation is merging" %> |
||||||
|
<% content_for :title, title %> |
||||||
|
<%# <%= govuk_back_link href: merge_request_organisation_path %> |
||||||
|
<h2 class="govuk-heading-l">Tell us if your organisation is merging</h2> |
||||||
|
|
||||||
|
<div class="govuk-grid-row"> |
||||||
|
<div class="govuk-grid-column-two-thirds-from-desktop"> |
||||||
|
<p class="govuk-body">Which organisations are merging?</p> |
||||||
|
|
||||||
|
<%= form_with model: @merge_request, url: merge_request_organisations_path, method: :patch do |f| %> |
||||||
|
<%= f.govuk_error_summary %> |
||||||
|
<%= render partial: "organisation_relationships/related_organisation_select_question", locals: { |
||||||
|
field: :merging_organisation, |
||||||
|
question: Form::Question.new("", { "answer_options" => @answer_options }, nil), |
||||||
|
f:, |
||||||
|
} %> |
||||||
|
<%= f.govuk_submit "Add organisation", classes: "govuk-button--secondary" %> |
||||||
|
<%= govuk_table do |table| %> |
||||||
|
<%= table.body do |body| %> |
||||||
|
<%= body.row do |row| %> |
||||||
|
<% row.cell(text: @merge_request.requesting_organisation.name) %> |
||||||
|
<% row.cell(html_attributes: { |
||||||
|
scope: "row", |
||||||
|
class: "govuk-!-text-align-right", |
||||||
|
}) %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% @merge_request.merging_organisations&.each do |merging_organisation| %> |
||||||
|
<%= table.body do |body| %> |
||||||
|
<%= body.row do |row| %> |
||||||
|
<% row.cell(text: merging_organisation.name) %> |
||||||
|
<% row.cell(html_attributes: { |
||||||
|
scope: "row", |
||||||
|
class: "govuk-!-text-align-right", |
||||||
|
}) do %> |
||||||
|
<%= govuk_link_to("Remove", merge_request_organisations_path) %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<%= govuk_details(summary_text: "Can't find the managing agent you're looking for?") do %> |
||||||
|
<p>List other organisations that are part of the merge but not registered on CORE.</li> |
||||||
|
<% end %> |
||||||
|
<% end %> |
||||||
|
<%= govuk_button_link_to "Continue", "#", button: true %> |
||||||
|
</div> |
||||||
Loading…
Reference in new issue