178 lines
9.5 KiB
Plaintext

@model PlotLineWorkspaceViewModel
@{
ViewData["Title"] = "Plot Lines";
ViewData["ProjectSection"] = "Plot Lines";
var selectedThreads = Model.PlotLines.Where(x => x.IsSelected).SelectMany(x => x.Threads).ToList();
}
<nav 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>
<span>Plot Lines</span>
</nav>
<div class="page-heading plot-workspace-heading">
<div>
<p class="eyebrow">Story map · @Model.Mode mode</p>
<h1>Plot Lines <help-icon key="plotLines.workspace" /></h1>
<p class="muted">Follow one line in Focus mode or select several to inspect the weave.</p>
</div>
<div class="button-row">
<a class="btn btn-outline-secondary" asp-controller="PlotLines" asp-action="Index" asp-route-projectId="@Model.Project.ProjectID">Manage lines</a>
<a class="btn btn-outline-secondary" asp-controller="PlotThreads" asp-action="Index" asp-route-projectId="@Model.Project.ProjectID">Manage threads</a>
</div>
</div>
<form method="get" asp-action="Index" class="plot-workspace-controls" id="plot-workspace-form">
<input type="hidden" name="projectId" value="@Model.Project.ProjectID" />
<div class="plot-control-row">
<label>Book
<select name="bookId" class="form-select" data-plot-submit>
<option value="">All books</option>
@foreach (var book in Model.Books)
{
<option value="@book.BookID" selected="@(book.BookID == Model.SelectedBookID)">@book.BookDisplayTitle</option>
}
</select>
</label>
<label>Order
<select name="scenarioId" class="form-select" data-plot-submit>
<option value="">Canonical manuscript</option>
@foreach (var scenario in Model.Scenarios)
{
<option value="@scenario.ScenarioID" selected="@(scenario.ScenarioID == Model.SelectedScenarioID)">Scenario: @scenario.ScenarioName</option>
}
</select>
</label>
<label>Find a scene
<input class="form-control" type="search" id="plot-scene-search" placeholder="Title, chapter, POV…" />
</label>
<label class="plot-toggle"><input type="checkbox" name="showSuggestions" value="true" checked="@Model.ShowSuggestions" data-plot-submit /> Show pending suggestions</label>
</div>
<fieldset class="plot-line-picker">
<legend>Plot lines</legend>
@foreach (var item in Model.PlotLines)
{
<label class="plot-line-choice" style="--line-colour:@item.Line.Colour">
<input type="checkbox" name="plotLineId" value="@item.Line.PlotLineID" checked="@item.IsSelected" data-line-choice />
<span class="plot-line-dot"></span>
<span>@item.Line.PlotLineName</span>
<small>@item.Line.ContributionSceneCount scenes</small>
</label>
}
<a class="plot-unattributed-link" asp-action="Unattributed" asp-route-projectId="@Model.Project.ProjectID" asp-route-bookId="@Model.SelectedBookID" asp-route-scenarioId="@Model.SelectedScenarioID">Unattributed scenes</a>
</fieldset>
@if (!Model.IsUnattributedMode && selectedThreads.Count > 0)
{
<details class="plot-thread-filter" open="@(Model.SelectedThreadIDs.Count > 0)">
<summary>Thread filter @(Model.SelectedThreadIDs.Count > 0 ? $"({Model.SelectedThreadIDs.Count})" : "")</summary>
<div>
@foreach (var thread in selectedThreads)
{
<label><input type="checkbox" name="threadId" value="@thread.PlotThreadID" checked="@Model.SelectedThreadIDs.Contains(thread.PlotThreadID)" data-plot-submit /> @thread.ThreadTitle <small>@thread.ContributionCount</small></label>
}
</div>
</details>
}
</form>
@if (Model.IsUnattributedMode)
{
<section class="plot-attribution-audit">
<div class="plot-audit-column">
<h2>Proposed only <span>@Model.ProposedOnlyScenes.Count</span></h2>
<p class="muted">No canonical plot-line contribution; one or more pending suggestions exist.</p>
@foreach (var scene in Model.ProposedOnlyScenes)
{
<button class="plot-audit-scene" type="button" data-scene-inspector="@scene.SceneID">
<strong>Ch @scene.ChapterNumber.ToString("0.##") · Scene @scene.SceneNumber.ToString("0.##")</strong>
<span>@scene.SceneTitle</span><small>@scene.ProposedCandidateNames</small>
</button>
}
</div>
<div class="plot-audit-column">
<h2>No known attribution <span>@Model.NoKnownAttributionScenes.Count</span></h2>
<p class="muted">Neither a canonical contribution nor a pending suggestion is known.</p>
@foreach (var scene in Model.NoKnownAttributionScenes)
{
<button class="plot-audit-scene" type="button" data-scene-inspector="@scene.SceneID">
<strong>Ch @scene.ChapterNumber.ToString("0.##") · Scene @scene.SceneNumber.ToString("0.##")</strong>
<span>@scene.SceneTitle</span>
</button>
}
</div>
</section>
}
else if (Model.Scenes.Count == 0)
{
<section class="empty-state"><h2>No contributions in this view</h2><p>Choose another plot line, book, scenario, or thread filter.</p></section>
}
else
{
<section class="plot-story-map" aria-label="Plot-line scene contribution map">
@foreach (var scene in Model.Scenes)
{
if (scene.GapBefore > 0)
{
<div class="plot-gap" title="Scenes without a selected-line contribution">
<span>@scene.GapBefore scene@(scene.GapBefore == 1 ? "" : "s") between contributions</span>
@if (scene.ChapterGapBefore > 0) { <small>@scene.ChapterGapBefore whole chapter@(scene.ChapterGapBefore == 1 ? "" : "s")</small> }
</div>
}
<article class="plot-scene-card @(scene.IsShared ? "is-shared" : "")" data-plot-scene data-search-text="@($"{scene.SceneTitle} {scene.ChapterTitle} {scene.PovCharacterName} {scene.LocationName}")">
<button type="button" class="plot-scene-open" data-scene-inspector="@scene.SceneID" aria-label="Inspect @scene.SceneTitle">
<span class="plot-scene-kicker">Ch @scene.ChapterNumber.ToString("0.##") · Scene @scene.SceneNumber.ToString("0.##")</span>
<strong>@scene.SceneTitle</strong>
@if (!string.IsNullOrWhiteSpace(scene.Summary)) { <span class="plot-scene-summary">@scene.Summary</span> }
</button>
<div class="plot-scene-memberships">
@foreach (var membership in scene.Memberships)
{
<div class="plot-membership" style="--line-colour:@membership.Colour">
<span class="plot-route"></span>
<div><strong>@membership.PlotLineName</strong>
@foreach (var contribution in membership.Contributions)
{
<span class="plot-contribution-role">@contribution.CanonicalRole · @contribution.ThreadTitle</span>
}
</div>
</div>
}
</div>
<footer>
@if (scene.IsShared) { <span class="badge text-bg-primary">Shared junction</span> }
@if (!string.IsNullOrWhiteSpace(scene.PovCharacterName)) { <span>POV @scene.PovCharacterName</span> }
@if (!string.IsNullOrWhiteSpace(scene.LocationName)) { <span>@scene.LocationName</span> }
@if (scene.WarningCount > 0) { <span class="text-warning">@scene.WarningCount warning@(scene.WarningCount == 1 ? "" : "s")</span> }
@if (scene.DependencyCount > 0) { <span>@scene.DependencyCount connection@(scene.DependencyCount == 1 ? "" : "s")</span> }
@if (scene.StructuralTargetCount > 0) { <span>@scene.StructuralTargetCount cross-line connection@(scene.StructuralTargetCount == 1 ? "" : "s")</span> }
</footer>
</article>
}
</section>
}
@if (Model.ShowSuggestions && Model.SuggestedScenes.Count > 0)
{
<section class="plot-suggestion-panel">
<h2>Pending suggestions <span>@Model.SuggestedScenes.Count scenes</span></h2>
<p class="muted">Suggestions are review context, not canonical plot-line contributions.</p>
@foreach (var item in Model.SuggestedScenes.Take(60))
{
<button type="button" data-scene-inspector="@item.Scene.SceneID"><strong>@item.Scene.SceneTitle</strong><span>@string.Join(" · ", item.Suggestions.Select(x => x.CandidateTitle).Distinct())</span></button>
}
@if (Model.SuggestedScenes.Count > 60) { <p class="muted">Showing the first 60 scenes. Narrow to a book for a smaller review set.</p> }
</section>
}
<div class="plot-inspector-backdrop" id="plot-inspector-backdrop" hidden></div>
<aside class="plot-inspector" id="plot-inspector" aria-label="Scene inspector" aria-hidden="true">
<div id="plot-inspector-content"></div>
</aside>
@section Scripts {
<script src="~/js/plot-line-workspace.js" asp-append-version="true"></script>
}