75 lines
3.0 KiB
Plaintext
75 lines
3.0 KiB
Plaintext
@model WritingContextDisplayViewModel
|
|
@{
|
|
var scene = Model.Context!.Scene!;
|
|
var pov = 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())
|
|
{
|
|
<ul class="writing-context-list">
|
|
@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>
|