% layout 'admin';
% title 'Organisations';
<div class="row">
<div class="col-12">
<h3 class="float-left">Merging <%= $org_result->name %> into <%= $target_result->name %></h3>
<a href="<%= url_for '/admin/organisations/' . $org_result->id . '/merge' %>" class="btn btn-success float-right">Back</a>
</div>
% for my $org ( $org_result, $target_result ) {
<div class="col-6">
<div class="card">
<h3 class="card-header">
<%= $org->name %>
</h3>
<div class="card-body">
Street Name
%= $org->street_name
Town/City
%= $org->town
Sector
%= $org->sector
Postcode
%= $org->postcode
Validated
%= $org->pending ? 'no' : 'yes'
Is Local
%= $org->is_local ? 'yes' : 'no'
<div class="list-group list-group-flush">
<div class="list-group-item">
Transaction Count: <%= $org->entity->sales->count %>
% }
<h1 class="card-title">
Warning: Cannot be undone!
</h1>
<p>
This will discard all basic information about this organisation, and
merge all transactions into the target organisation. This process has
no way of being undone.
</p>
<form action="<%= url_for %>" method="POST">
<input type="checkbox" name="confirm" value="checked">
<label>I confirm that I want this to happen</label>
<button type="submit" class="btn btn-danger">Confirm Merge</button>
</form>