@model LocationDetailViewModel @using System.Text.Json @using PlotLine.Models @{ ViewData["DesktopLayout"] = "details"; ViewData["Title"] = Model.Location.LocationName; ViewData["ProjectSection"] = "Locations"; IReadOnlyList<(string Id, string Label)> tabs = [("overview", "Overview"), ("reference", "Reference"), ("hierarchy", "Hierarchy"), ("relationships", "Relationships"), ("usage", "Usage"), ("spatial", "Spatial awareness")]; var requestedTab = ViewData["LocationTab"] as string; var activeTab = tabs.Any(tab => tab.Id == requestedTab) ? requestedTab! : "overview"; var knownNames = Model.Aliases .Select(x => x.Alias) .Append(Model.Location.LocationName) .Where(name => !string.IsNullOrWhiteSpace(name)) .Distinct(StringComparer.OrdinalIgnoreCase) .OrderBy(name => !string.Equals(name, Model.Location.LocationName, StringComparison.OrdinalIgnoreCase)) .ThenBy(name => name, StringComparer.OrdinalIgnoreCase) .ToList(); }
@if (TempData["LocationMessage"] is string locationMessage) { }

Type

@(Model.Location.LocationTypeName ?? "Not set")

Description

@(Model.Location.Description ?? "No description yet.")

Known names

@foreach (var name in knownNames) { var isPreferred = string.Equals(name, Model.Location.LocationName, StringComparison.OrdinalIgnoreCase);
@name @if (isPreferred) { Preferred } else {
}
}
@await Component.InvokeAsync("StoryElementReferences", new { entityType = PlotLine.Data.StoryElementType.Location, entityId = Model.Location.LocationID })

Hierarchy

Relationships

@Html.AntiForgeryToken()

Rows are the starting locations. Columns are the destinations. Select a cell to inspect both directions.

Legend

Used here

@foreach (var kind in new[] { "Scenes", "Characters", "Assets" }) {

@kind

@foreach (var book in Model.Usage.Where(entry => entry.Kind == kind).GroupBy(entry => entry.BookID)) {

@BookTitleFormatter.DisplayTitle(book.First().BookTitle, book.First().BookSubtitle)

@foreach (var chapter in book.GroupBy(entry => entry.ChapterID)) { var header = chapter.First();
Chapter @header.ChapterNumber.ToString("g") · @header.ChapterTitle
} } @if (!Model.Usage.Any(entry => entry.Kind == kind)) {

No @kind.ToLowerInvariant() recorded here.

}
}
Geographical lookup

Loading…

@Html.AntiForgeryToken()
@section Scripts { }