55 lines
2.8 KiB
Plaintext

@model EntityMergeViewModel
@{
ViewData["DesktopLayout"] = "compact";
ViewData["Title"] = $"Merge {Model.SourceName}";
ViewData["ProjectSection"] = "Locations";
}
<nav data-pwa-identity class="breadcrumb-trail" aria-label="Breadcrumb">
<a asp-controller="Projects" asp-action="Index">Projects</a>
<a asp-controller="Projects" asp-action="Details" asp-route-id="@Model.Project.ProjectID">@Model.Project.ProjectName</a>
<a asp-action="Index" asp-route-projectId="@Model.Project.ProjectID">Locations</a>
<a asp-action="Details" asp-route-id="@Model.Form.SourceID">@Model.SourceName</a>
<span>Merge</span>
</nav>
<partial name="_ProjectSectionNav" model="Model.Project" />
<div data-pwa-task class="page-heading compact">
<div>
<p class="eyebrow">Location identity</p>
<h1>Merge @Model.SourceName</h1>
<p class="lead-text">Known names, scene references, child locations, relationships and floor plan links move to the selected location. The source location is archived. The selected location keeps its name, type and parent. Different descriptions are preserved together; an unclassified survivor inherits the source classification. Map links transfer without changing geometry. Original source details and geographic evidence remain archived. A location cannot be merged into one of its descendants.</p>
</div>
<a class="btn btn-outline-secondary" asp-action="Details" asp-route-id="@Model.Form.SourceID">Cancel</a>
</div>
@if (!Model.TargetOptions.Any())
{
<div class="alert alert-info">There are no other active locations in this project to merge with.</div>
}
<form asp-action="Merge" method="post" class="edit-panel">
<input asp-for="Form.SourceID" type="hidden" />
<div asp-validation-summary="All" class="text-danger"></div>
<div class="row g-3">
<div class="col-md-8">
<label asp-for="Form.TargetID" class="form-label">Canonical location</label>
<select data-location-picker data-project-id="@Model.Project.ProjectID" data-exclude-branch="@Model.Form.SourceID" data-picker-label="Choose surviving location" asp-for="Form.TargetID" asp-items="Model.TargetOptions" class="form-select">
<option value="">Choose location</option>
</select>
</div>
<div class="col-12">
<label class="form-check">
<input asp-for="Form.Confirm" class="form-check-input" />
<span class="form-check-label">I understand this will archive @Model.SourceName and move references to the selected location.</span>
</label>
</div>
</div>
<button disabled="@(!Model.TargetOptions.Any())" class="btn btn-danger mt-3" type="submit">Merge location</button>
</form>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}