@model LocationDetailViewModel @{ 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"), ("geography", "Geography")]; 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

Parent

@(Model.Location.ParentLocationName ?? "Top level")

Child locations

@if (!Model.ChildLocations.Any()) {

No child locations yet.

} else {
@foreach (var child in Model.ChildLocations) { @child.LocationName }
}

Relationships

@if (!Model.Relationships.Any()) {

No relationships defined yet.

} else {
@foreach (var relationship in Model.Relationships) {
@relationship.FromLocationName @relationship.RelationshipTypeName.ToLowerInvariant() @relationship.ToLocationName @if (relationship.IsBidirectional) { both ways }

@relationship.Notes

}
}

Used here

Scenes

@foreach (var scene in Model.Scenes) {

@SceneLabel(scene.ChapterNumber, scene.SceneNumber) @scene.SceneTitle

} @if (!Model.Scenes.Any()) {

No scenes set here.

}

Characters

@foreach (var character in Model.Characters) {

@character.CharacterName @SceneLabel(character.ChapterNumber, character.SceneNumber)

} @if (!Model.Characters.Any()) {

No character placements yet.

}

Assets

@foreach (var asset in Model.Assets) {

@asset.AssetName @asset.Description

} @if (!Model.Assets.Any()) {

No asset placements yet.

}

Geographical position

Loading…

@Html.AntiForgeryToken()
@functions { private static string SceneLabel(decimal chapterNumber, decimal sceneNumber) => chapterNumber > 0 ? $"Chapter {chapterNumber:g}, Scene {sceneNumber:g}" : $"Scene {sceneNumber:g}"; } @section Scripts { }