PlotDirector/PlotLine/Views/Writing/_WritingIntentContent.cshtml

112 lines
5.3 KiB
Plaintext

@model WritingIntentDisplayViewModel
@{
var scene = Model.Context?.Scene;
var position = Model.Context?.Position;
var workflow = Model.ChapterWorkflow;
var chapter = workflow?.Chapter ?? Model.Context?.Chapter;
var book = workflow?.Book ?? Model.Context?.Book;
var project = workflow?.Project ?? Model.Context?.Project;
var projectId = position?.ProjectId ?? project?.ProjectID;
var bookId = position?.BookId ?? book?.BookID;
var chapterId = position?.ChapterId ?? chapter?.ChapterID;
var sceneId = position?.SceneId;
}
<div class="writing-context-content"
data-writing-intent-fragment
data-project-id="@projectId"
data-book-id="@bookId"
data-chapter-id="@chapterId"
data-scene-id="@sceneId"
data-follow-status="@Model.FollowStatus">
@if (!Model.HasChapter && scene is null)
{
<section class="writing-context-empty">
<p class="eyebrow">Waiting</p>
<h2>Waiting for Word...</h2>
<p>Open a linked manuscript or choose a planned chapter or scene once intent is available.</p>
</section>
}
else
{
<header class="writing-context-scene-header">
<div>
<p class="eyebrow">@project?.ProjectName</p>
<h2>@(scene?.SceneTitle ?? $"Chapter {chapter?.ChapterNumber:g}: {chapter?.ChapterTitle}")</h2>
<p>
@book?.BookDisplayTitle
@if (chapter is not null)
{
<span aria-hidden="true">/</span>
<span>Chapter @chapter.ChapterNumber:g</span>
}
@if (scene is not null)
{
<span aria-hidden="true">/</span>
<span>Scene @scene.SceneNumber:g</span>
}
</p>
@if (Model.IsChapterOnly)
{
<p>No current scene. Showing chapter intent.</p>
}
else if (scene is not null && string.IsNullOrWhiteSpace(scene.Summary) && string.IsNullOrWhiteSpace(scene.ScenePurposeNotes) && !scene.ChecklistItems.Any())
{
<p>No scene-specific plan. Showing chapter intent.</p>
}
</div>
<div class="writing-context-scene-actions">
@if (chapter is not null)
{
<label for="writing-intent-chapter-select">Jump to chapter</label>
<select id="writing-intent-chapter-select" class="form-select form-select-sm" data-writing-intent-chapter-select>
<option value="@chapter.ChapterID" selected>Chapter @chapter.ChapterNumber:g: @chapter.ChapterTitle</option>
</select>
}
<label for="writing-intent-scene-select">Jump to scene</label>
<select id="writing-intent-scene-select" class="form-select form-select-sm" data-writing-intent-scene-select>
<option value="">No current scene</option>
@foreach (var option in Model.SceneOptions)
{
<option value="@option.Value" selected="@option.Selected">@option.Text</option>
}
</select>
@if (scene is not null)
{
<a class="btn btn-outline-secondary btn-sm" asp-controller="Scenes" asp-action="Edit" asp-route-id="@scene.SceneID">Edit Scene</a>
}
else if (chapter is not null)
{
<a class="btn btn-outline-secondary btn-sm" asp-controller="Writer" asp-action="Chapter" asp-route-id="@chapter.ChapterID">Edit Chapter Plan</a>
}
</div>
</header>
<nav class="writing-context-tabs" aria-label="Writing intent tabs">
<button type="button" class="active" data-writing-intent-tab="plan">Plan</button>
<button type="button" data-writing-intent-tab="must-include">Must Include</button>
<button type="button" data-writing-intent-tab="notes">Notes</button>
<button type="button" data-writing-intent-tab="threads">Threads</button>
<button type="button" data-writing-intent-tab="checklist">Checklist</button>
</nav>
<div class="writing-context-tab-panels">
<section class="writing-context-tab-panel active" data-writing-intent-panel="plan">
<partial name="_WritingIntentPlan" model="Model" />
</section>
<section class="writing-context-tab-panel" data-writing-intent-panel="must-include" hidden>
<partial name="_WritingIntentMustInclude" model="Model" />
</section>
<section class="writing-context-tab-panel" data-writing-intent-panel="notes" hidden>
<partial name="_WritingIntentNotes" model="Model" />
</section>
<section class="writing-context-tab-panel" data-writing-intent-panel="threads" hidden>
<partial name="_WritingIntentThreads" model="Model" />
</section>
<section class="writing-context-tab-panel" data-writing-intent-panel="checklist" hidden>
<partial name="_WritingIntentChecklist" model="Model" />
</section>
</div>
}
</div>