PlotDirector/PlotLine/Views/Writer/_ReviewContext.cshtml

26 lines
3.9 KiB
Plaintext

@model PlotLine.Services.Writer.ReviewPanel
@{var data=Model.Intentions;var goal=data.Sections.First(x=>x.Kind=="Goals");var scene=data.Sections.FirstOrDefault(x=>x.Kind=="Scene");string Compact(string value)=>value.Length>360?value[..360]+"…":value;}
<div data-review-panel><p class="writer3-caption">@Model.ReferenceMessage</p>
<section class="writer3-inset" data-review-intentions><h3>Chapter and scene intentions</h3>
@if(scene!=null){<h4>@data.Scene?.SceneTitle</h4><p class="review-recorded">@(string.IsNullOrWhiteSpace(scene.Value("ScenePurposeNotes"))?"No scene intention recorded.":Compact(scene.Value("ScenePurposeNotes")))</p><p class="review-recorded">@Compact(scene.Value("SceneOutcomeNotes"))</p><p class="writer3-caption">Recorded scene state: @data.Scene?.RevisionStatusName</p>}
<p class="review-recorded">@(string.IsNullOrWhiteSpace(goal.Value("GoalSummary"))?"No chapter intention recorded. You can review without one.":Compact(goal.Value("GoalSummary")))</p>
<details><summary>Chapter details, reminders &amp; editing</summary>
@foreach(var section in data.Sections.Where(x=>x.Kind is "Chapter" or "Goals")){@foreach(var field in section.Fields){var value=section.Value(field.Name);if(field.Type=="purpose"&&!string.IsNullOrWhiteSpace(value))value=section.Purposes.FirstOrDefault(p=>p.Value==value).Label??"Recorded purpose is unavailable";@if(!string.IsNullOrWhiteSpace(value)){<p><strong>@field.Label</strong><span class="review-recorded">@value</span></p>}}}
@foreach(var note in data.Sections.Where(x=>x.Kind=="Note"&&x.Value("IsResolved")!="true"||x.Kind=="Checklist"&&x.Value("IsCompleted")!="true").Take(10)){<p class="review-recorded">@(note.Kind=="Note"?note.Value("NoteText"):note.Value("ItemText"))</p>}
@{var flow=data.Sections.FirstOrDefault(x=>x.Kind=="Workflow");}@if(flow!=null){<p>Priority: @flow.Value("Priority"). @flow.Value("BlockedReason")</p>}
<a asp-controller="Chapters" asp-action="Edit" asp-route-id="@data.ChapterID" target="_blank" rel="noopener">Edit chapter intentions in the existing editor</a>
@if(data.SceneID.HasValue){<a asp-controller="Scenes" asp-action="Edit" asp-route-id="@data.SceneID" target="_blank" rel="noopener">Edit scene intentions, notes and working details</a>}
</details></section>
<section class="writer3-inset"><div class="writer3-authoring-heading"><h3>Your observations</h3><button type="button" class="btn btn-sm btn-link" data-review-reload>Reload</button></div>
@if(Model.Observations.Count==0){<p>No observations on this page. Record something when it helps your review.</p>}
@foreach(var row in Model.Observations){
<article class="writer3-authoring-card" data-observation data-id="@row.ID" data-version="@row.Version" data-first="@row.StartParagraph" data-anchor="@row.AnchorState">
<p class="writer3-focus-kind">@(row.Status=="Open"?"Needs attention":row.Status=="Working"?"Working on it":"Resolved")</p>
<p class="review-recorded" data-observation-text>@row.Observation</p><p class="review-recorded" data-decision-text>@row.Decision</p>
<p class="writer3-caption">@row.AnchorState reference · @(row.SnapshotRevision<0?"No accepted version at capture":"Accepted version "+row.SnapshotRevision) · created @row.CreatedUtc.ToString("dd MMM yyyy HH:mm:ss") UTC · updated @row.UpdatedUtc.ToString("dd MMM yyyy HH:mm:ss") UTC</p>
<div class="button-row"><button type="button" class="btn btn-sm btn-outline-secondary" data-review-edit data-state="@row.Status">Edit / change decision</button>@if(row.StartParagraph.HasValue){<button type="button" class="btn btn-sm btn-outline-secondary" data-review-revisit>Revisit reference</button>}</div>
</article>}
<div class="button-row">@if(Model.Page>1){<button type="button" class="btn btn-sm btn-link" data-review-page="@(Model.Page-1)">Previous observations</button>}@if(Model.HasMore){<button type="button" class="btn btn-sm btn-link" data-review-page="@(Model.Page+1)">More observations</button>}</div>
</section>
</div>