59 lines
2.4 KiB
Plaintext
59 lines
2.4 KiB
Plaintext
@model WritingContextDisplayViewModel
|
|
@{
|
|
var scene = Model.Context!.Scene!;
|
|
var sceneCharacterIds = scene.SceneCharacters.Select(x => x.CharacterID).ToHashSet();
|
|
var relationshipEvents = scene.RelationshipEvents;
|
|
var relationships = (Model.RelationshipMap?.Relationships ?? [])
|
|
.Where(x => !sceneCharacterIds.Any() || sceneCharacterIds.Contains(x.CharacterAID) || sceneCharacterIds.Contains(x.CharacterBID))
|
|
.ToList();
|
|
static string TextOr(string? value, string fallback) => string.IsNullOrWhiteSpace(value) ? fallback : value.Trim();
|
|
}
|
|
|
|
<div class="writing-context-grid">
|
|
<article class="writing-context-card">
|
|
<p class="eyebrow">Changes In This Scene</p>
|
|
@if (!relationshipEvents.Any())
|
|
{
|
|
<p>No relationship changes recorded.</p>
|
|
}
|
|
else
|
|
{
|
|
<ul class="writing-context-list">
|
|
@foreach (var item in relationshipEvents)
|
|
{
|
|
<li>
|
|
<strong>@item.CharacterAName - @item.CharacterBName</strong>
|
|
<span>@item.RelationshipStateName@(item.Intensity.HasValue ? $" / intensity {item.Intensity}" : string.Empty)</span>
|
|
<p>@TextOr(item.Description, item.RelationshipTypeName)</p>
|
|
</li>
|
|
}
|
|
</ul>
|
|
}
|
|
</article>
|
|
|
|
<article class="writing-context-card writing-context-card--wide">
|
|
<p class="eyebrow">State At This Point</p>
|
|
@if (!relationships.Any())
|
|
{
|
|
<p>No visible relationships at this point.</p>
|
|
}
|
|
else
|
|
{
|
|
<div class="writing-context-relationship-list">
|
|
@foreach (var relationship in relationships.Take(12))
|
|
{
|
|
<div>
|
|
<strong>@relationship.CharacterAName - @relationship.CharacterBName</strong>
|
|
<span>@relationship.CurrentStateName</span>
|
|
<span class="status-pill @relationship.CssClass">@relationship.RelationshipCategoryName</span>
|
|
@if (relationship.CurrentIntensity.HasValue)
|
|
{
|
|
<small>Intensity @relationship.CurrentIntensity</small>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
</article>
|
|
</div>
|