42 lines
3.2 KiB
Plaintext
42 lines
3.2 KiB
Plaintext
@model PlotLineWorkspaceViewModel
|
||
@using System.Text.Json
|
||
@{
|
||
var scenes = Model.AssociationScenes.OrderBy(s => s.NarrativeOrder).ToArray();
|
||
var payload = new {
|
||
scenes = scenes.Select(s => new { id = s.SceneID, chapter = s.ChapterNumber, number = s.SceneNumber, title = s.SceneTitle }),
|
||
lines = Model.PlotLines.Select(l => new { id = l.Line.PlotLineID, name = l.Line.PlotLineName, description = l.Line.Description, colour = l.Line.Colour }),
|
||
memberships = Model.Scenes.SelectMany(s => s.Memberships.Select(m => new {
|
||
scene = s.SceneID, line = m.PlotLineID,
|
||
developments = m.Contributions.Select(c => new { id = c.ThreadEventID, thread = c.ThreadTitle, title = c.CanonicalTitle, detail = c.CanonicalDescription, role = c.CanonicalRole })
|
||
}))
|
||
};
|
||
}
|
||
<div data-writing-component-fragment data-context-plot-cards class="writing-plot-context">
|
||
<div class="writing-plot-toolbar">
|
||
<p>Plot line context for the current scene, showing the previous, current and next developments.</p>
|
||
<div class="writing-plot-categories" role="group" aria-label="Show plot lines">
|
||
<span>Show:</span>
|
||
<button type="button" class="btn btn-sm btn-outline-secondary" data-plot-category="active" aria-pressed="true">Active here <span data-plot-count="active">0</span></button>
|
||
<button type="button" class="btn btn-sm btn-outline-secondary" data-plot-category="nearby" aria-pressed="true">Nearby <span data-plot-count="nearby">0</span></button>
|
||
<button type="button" class="btn btn-sm btn-outline-secondary" data-plot-category="elsewhere" aria-pressed="false">Elsewhere <span data-plot-count="elsewhere">0</span></button>
|
||
<button type="button" class="btn btn-link btn-sm" data-plot-all>Show all</button>
|
||
</div>
|
||
</div>
|
||
@if (scenes.Length > 0)
|
||
{
|
||
<div class="writing-plot-explore">
|
||
<label>Explore scenes <input type="range" min="0" max="@(scenes.Length - 1)" value="0" data-plot-scrubber /></label>
|
||
<button type="button" class="btn btn-sm btn-outline-secondary" data-plot-return>Show current scene</button>
|
||
</div>
|
||
<div class="writing-plot-scene-nav" aria-label="Explore manuscript scenes">
|
||
<button type="button" class="btn btn-outline-secondary" data-plot-step="-1" aria-label="Previous scene">‹</button>
|
||
<div class="writing-plot-scene-strip" data-plot-scene-strip tabindex="0" aria-label="Nearby scenes in manuscript order"></div>
|
||
<button type="button" class="btn btn-outline-secondary" data-plot-step="1" aria-label="Next scene">›</button>
|
||
</div>
|
||
<div class="writing-plot-position"><p class="small text-muted" role="status" data-plot-position></p><button type="button" class="btn btn-sm btn-outline-primary" data-context-go-scene>Go to scene in Word</button></div>
|
||
}
|
||
<div data-plot-rows aria-label="Plot line developments"></div>
|
||
<button type="button" class="btn btn-link btn-sm" data-context-refresh title="Read updated saved information; does not request AI">Refresh saved data</button>
|
||
<script type="application/json" data-plot-context-data>@Html.Raw(JsonSerializer.Serialize(payload))</script>
|
||
</div>
|