PlotDirector/PlotLine/Views/Writing/_WritingContextOverview.cshtml

118 lines
8.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model WritingContextDisplayViewModel
@{
var scene = Model.Context!.Scene!;
var pov = (scene.POVCharacterID.HasValue ? Model.AtPoint?.PovName : null) ?? scene.CharacterOptions.FirstOrDefault(x => x.Value == scene.POVCharacterID?.ToString())?.Text
?? scene.SceneCharacters.FirstOrDefault(x => x.CharacterID == scene.POVCharacterID)?.CharacterName
?? "No POV set";
var primaryLocation = scene.LocationOptions.FirstOrDefault(x => x.Value == scene.PrimaryLocationID?.ToString())?.Text?.Trim()
?? "No primary location";
var purposeLabels = scene.ScenePurposeTypes
.Where(x => scene.SelectedPurposeTypeIds.Contains(x.ScenePurposeTypeID))
.OrderBy(x => x.SortOrder)
.Select(x => x.PurposeName)
.ToList();
static string TextOr(string? value, string fallback) => string.IsNullOrWhiteSpace(value) ? fallback : value.Trim();
}
<div class="writing-context-grid writing-context-grid--overview">
<article class="writing-context-card writing-context-card--hero">
<p class="eyebrow">Current Scene</p>
<h3>@scene.SceneTitle</h3>
<p>@TextOr(scene.Summary, "No scene summary has been written yet.")</p>
</article>
<article class="writing-context-card">
<p class="eyebrow">Where and When</p>
<dl class="writing-context-facts">
<dt>POV</dt><dd>@pov</dd>
<dt>Date</dt><dd>@(scene.StartDateTime?.ToString("d MMM yyyy") ?? scene.RelativeTimeText ?? "Unknown")</dd>
<dt>Time</dt><dd>@(scene.StartDateTime?.ToString("HH:mm") ?? scene.TimeModeName ?? "Unknown")</dd>
<dt>Location</dt><dd>@primaryLocation</dd>
<dt>Status</dt><dd>@(scene.RevisionStatuses.FirstOrDefault(x => x.Value == scene.RevisionStatusID.ToString())?.Text ?? scene.RevisionStatusID.ToString())</dd>
</dl>
</article>
<article class="writing-context-card">
<p class="eyebrow">Purpose</p>
@if (purposeLabels.Any())
{
<div class="writing-context-chip-row">
@foreach (var purpose in purposeLabels)
{
<span>@purpose</span>
}
</div>
}
else
{
<p>No scene purpose selected.</p>
}
<p>@TextOr(scene.ScenePurposeNotes, "No purpose notes yet.")</p>
</article>
<article class="writing-context-card">
<p class="eyebrow">Outcome</p>
<p>@TextOr(scene.SceneOutcomeNotes, "No outcome notes yet.")</p>
</article>
<article class="writing-context-card">
<p class="eyebrow">Continuity</p>
@if (scene.Warnings.Any() || scene.AgeContinuityWarnings.Any() || Model.AtPoint?.Warnings.Any()==true)
{
<ul class="writing-context-list">
@foreach(var check in (Model.AtPoint?.Warnings??[]).Take(4)){<li><strong>Continuity check:</strong> @check.Message</li>}
@foreach (var warning in scene.Warnings.Concat(scene.AgeContinuityWarnings).Take(4))
{
<li><strong>@warning.SeverityName</strong> @warning.Message</li>
}
</ul>
}
else
{
<p>No continuity warnings.</p>
}
</article>
</div>
<div class="writing-context-grid writing-reference-desk">
<article class="writing-context-card"><p class="eyebrow">Earlier established scenes near this story date</p>
@if(!scene.StartDateTime.HasValue){<p>No absolute story date saved. Relative timing is shown above; no nearby dates are inferred.</p>}
else if(!Model.NearbyScenes.Any()){<p>No earlier established scenes in this book within three days.</p>}
else{<ul class="writing-context-list">@foreach(var item in Model.NearbyScenes){<li><time>@item.StartDateTime?.ToString("d MMM · HH:mm")</time> <a asp-controller="Writing" asp-action="Context" asp-route-projectId="@Model.Context.Position.ProjectId" asp-route-bookId="@item.BookID" asp-route-sceneId="@item.SceneID" asp-route-pinned="true" asp-route-embedded="true">@item.Title</a></li>}</ul>}
</article>
<article class="writing-context-card"><p class="eyebrow">People at this point</p>
@if(!scene.SceneCharacters.Any()){<p>No participants saved for this scene.</p>}else{<ul class="writing-context-list">@foreach(var person in scene.SceneCharacters.Take(5)){<li><strong>@person.CharacterName</strong> · @(person.RoleInSceneTypeName??person.PresenceTypeName??"Participant")<p>@(person.EmotionalState??"No emotional state recorded")</p></li>}</ul>}
</article>
<article class="writing-context-card"><p class="eyebrow">Active story threads</p>
@if(!scene.ThreadEvents.Any()){<p>No saved thread developments for this scene.</p>}else{<ul class="writing-context-list">@foreach(var thread in scene.ThreadEvents.Take(5)){<li><strong>@thread.PlotLineName · @thread.ThreadTitle</strong><p>@(thread.EventTitle??thread.EventTypeName)</p></li>}</ul>}
</article>
<article class="writing-context-card"><p class="eyebrow">Place and floor</p><h3>@primaryLocation</h3><p>@(Model.FloorPlan?.FloorPlan.Name??"No floor plan linked")</p>
@if(scene.InitialFloorPlanFloorID.HasValue){<p>@(Model.FloorPlan?.Floors.FirstOrDefault(f=>f.FloorPlanFloorID==scene.InitialFloorPlanFloorID)?.Name??"Saved floor is unavailable")</p>}
<p>Use Place for saved room occupancy. Story Maps opens your saved maps; a location is never guessed from manuscript text.</p></article>
</div>
<nav class="writing-context-card writing-context-tools" aria-label="Explore this scene">
<strong>Explore this scene</strong>
<a asp-controller="StoryCalendar" asp-action="Index" asp-route-projectId="@Model.Context.Position.ProjectId" asp-route-bookId="@scene.Book?.BookID" asp-route-date="@scene.StartDateTime?.ToString("yyyy-MM-dd")">Calendar @(scene.StartDateTime.HasValue?"· scene date":"· no saved date")</a>
<a asp-controller="Maps" asp-action="Index" asp-route-projectId="@Model.Context.Position.ProjectId" asp-route-mode="story" asp-route-sceneId="@scene.SceneID">Story Maps · choose a saved map</a>
@if(scene.FloorPlanID.HasValue){<a asp-controller="FloorPlans" asp-action="Edit" asp-route-id="@scene.FloorPlanID">Linked floor plan</a>}else{<span>No floor plan mapped</span>}
<a asp-controller="PlotLineWorkspace" asp-action="Index" asp-route-projectId="@Model.Context.Position.ProjectId" asp-route-bookId="@scene.Book?.BookID">Plot Lines</a>
<a data-context-workspace-target="relationships" asp-controller="RelationshipMap" asp-action="Index" asp-route-projectId="@Model.Context.Position.ProjectId" asp-route-bookId="@scene.Book?.BookID" asp-route-sceneId="@scene.SceneID">Characters and relationships</a>
</nav>
<div class="writing-context-grid">
<article class="writing-context-card">
<p class="eyebrow">Viewpoint knowledge</p>
<p class="small text-muted">Verified records through this scene in manuscript order. States may include uncertainty or lack of knowledge. Reader knowledge is not independently recorded here.</p>
@if(scene.POVCharacterID is null){<p>No viewpoint character recorded. No viewpoint knowledge is inferred.</p>}
else if(Model.AtPoint?.ViewpointKnowledge.Any()!=true){<p>No verified knowledge records for this viewpoint at this point.</p>}
else{<ul class="writing-context-list">@foreach(var fact in Model.AtPoint.ViewpointKnowledge.Take(5)){<li><strong>@fact.KnowledgeStateName:</strong> @(fact.Description??fact.AssetName??fact.ThreadTitle??"Recorded knowledge") <a data-context-workspace-target="scene" data-context-entity="@fact.SceneID" asp-controller="Scenes" asp-action="Edit" asp-route-id="@fact.SceneID">Source scene</a></li>}</ul><p>Open People for other participants’ knowledge records.</p>}
</article>
<article class="writing-context-card">
<p class="eyebrow">Relevant unresolved threads</p>
<p class="small text-muted">Established through this scene; prioritised by current events, knowledge records and this chapter. Author reference, not proof of viewpoint awareness.</p>
@if(!Model.RelevantThreads.Any()){<p>No established unresolved threads linked to this scene, its participants or this chapter.</p>}
else{<ul class="writing-context-list">@foreach(var thread in Model.RelevantThreads){<li><a asp-controller="PlotThreads" asp-action="Edit" asp-route-id="@thread.PlotThreadID">@thread.PlotLineName / @thread.Title</a> · @thread.State @if(thread.Source!=null){<a data-context-workspace-target="scene" data-context-entity="@thread.Source.SceneID" asp-controller="Scenes" asp-action="Edit" asp-route-id="@thread.Source.SceneID">Source scene</a>}</li>}</ul>}
</article>
</div>