PlotDirector/PlotLine/Views/Characters/_WorkspaceTab.cshtml

67 lines
14 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model CharacterWorkspacePage
@{var c=Model.Profile.Character;var q=Model.Query;var totalPages=Math.Max(1,(Model.Total+24)/25);}
<div data-character-tab-content="@q.Tab" data-page="@q.Page" data-total="@Model.Total" data-scene="@q.SceneID">
@if(q.Tab=="overview"){
<partial name="/Views/Characters/_WorkspaceProfile.cshtml" model="Model.Profile"/>
<section class="plain-card"><h2>Recent recorded changes</h2>@if(!Model.Entries.Any()){<p class="muted">No changes recorded yet.</p>}else{foreach(var entry in Model.Entries){<p><strong>@entry.Heading</strong> · @entry.State <span class="small">@entry.BookDisplayTitle · @entry.SceneTitle</span></p>}}<a data-workspace-go="evolution" href="?tab=evolution">Explore evolution</a></section>
<details id="character-gallery" data-workspace-gallery><summary>Portraits and reference gallery (@Model.Profile.WorkspaceCounts.Images)</summary><div data-gallery-content>@{Model.Profile.Images=Model.Images;}<partial name="/Views/Characters/_WorkspaceGallery.cshtml" model="Model.Profile"/>@if(Model.Profile.WorkspaceCounts.Images>25){<button type="button" class="btn btn-outline-secondary" data-gallery-page="2">More gallery images</button>}</div></details>
}else if(q.Tab=="gallery"){
Model.Profile.Images=Model.Images;<partial name="/Views/Characters/_WorkspaceGallery.cshtml" model="Model.Profile"/>
<div class="button-row">@if(q.Page>1){<button type="button" class="btn btn-outline-secondary" data-gallery-page="@(q.Page-1)">Previous images</button>}<span>Page @q.Page of @totalPages</span>@if(q.Page<totalPages){<button type="button" class="btn btn-outline-secondary" data-gallery-page="@(q.Page+1)">Next images</button>}</div>
}else{
<div class="character-tab-heading"><div><h2>@(q.Tab=="history"?"Relationship history":q.Tab=="scenes"?"Choose a narrative position":q.Tab=="relationships"?"Relationships":q.Tab=="evolution"?"Evolution":q.Tab=="appearances"?"Appearances":"Knowledge")</h2><p class="small">@(q.Tab=="knowledge"?"Canonical knowledge classifications and sources. Records through the selected point are author reference to this character; they are not proof of another viewpoint’s knowledge.":q.Tab=="relationships"?"Author definitions and recorded developments remain distinct. Family is author-reference truth; Story shows the selected narrative point.":"Recorded narrative order, grouped by book, chapter and scene.")</p></div>
@if(q.Tab=="evolution"){<a class="btn btn-outline-secondary" asp-controller="Dynamics" asp-action="Character" asp-route-id="@c.CharacterID">Advanced arc, charts and continuity</a>}
@if(q.Tab=="knowledge"){<a class="btn btn-outline-secondary" asp-controller="Dynamics" asp-action="Knowledge" asp-route-id="@c.CharacterID">Knowledge timeline and continuity</a>}
@if(q.Tab=="relationships"&&Model.Profile.WorkspaceCanEdit){<button class="btn btn-primary" type="button" data-workspace-add>Add initial relationship</button>}
</div>
@if(q.Tab is "relationships" or "knowledge"){
<div class="character-position"><strong>@(q.SceneID.HasValue?Model.PointLabel:"Latest recorded author reference")</strong><button type="button" class="btn btn-outline-secondary btn-sm" data-workspace-position>Choose story point</button>@if(q.SceneID.HasValue){<button type="button" class="btn btn-outline-secondary btn-sm" data-workspace-clear-position>All recorded / latest</button>}</div>
}
<form data-workspace-filter class="character-workspace-filters" action="@Url.Action("Tab","CharacterWorkspace",new{id=c.CharacterID})" method="get">
<input type="hidden" name="Tab" value="@q.Tab"/><input type="hidden" name="SceneID" value="@q.SceneID"/><input type="hidden" name="RelationshipID" value="@q.RelationshipID"/>
<label>Search<input class="form-control" name="Search" value="@q.Search" maxlength="120" placeholder="Recorded names, values or notes"/></label>
@if(q.Tab=="relationships"){<label>Recorded category<select name="Category" class="form-select"><option value="">Family and Story</option><option value="family" selected="@(q.Category=="family")">Family definitions</option><option value="story" selected="@(q.Category=="story")">Story definitions</option></select></label>@if(q.OtherCharacterID.HasValue){<button type="button" class="btn btn-outline-secondary" data-all-groups>All character groups</button>}}
@if(q.Tab!="relationships"){<label>Book<select class="form-select" name="BookID"><option value="">All books</option>@foreach(var book in Model.Books){<option value="@book.Value" selected="@(q.BookID?.ToString()==book.Value)">@book.Text</option>}</select></label>}
@if(q.Tab=="evolution"){<label>Category<select class="form-select" name="Category"><option value="">All recorded changes</option>@foreach(var category in new[]{"attributes","relationships","knowledge","appearances"}){<option value="@category" selected="@(q.Category==category)">@category</option>}</select></label>}
@if(q.Tab=="knowledge"){<label>Canonical state<input class="form-control" name="Category" value="@q.Category" placeholder="Exact recorded state, or blank" list="knowledge-states"/><datalist id="knowledge-states">@foreach(var state in Model.Entries.Select(e=>e.State).Where(s=>!string.IsNullOrEmpty(s)).Distinct()){<option value="@state"/>}</datalist></label>}
<button class="btn btn-outline-primary">Apply filters</button></form>
@if(q.Tab=="relationships"){
<div class="character-relationship-lenses" role="group" aria-label="Relationship lens"><button class="btn btn-outline-primary" type="button" data-character-lens="family" aria-pressed="true">Family</button><button class="btn btn-outline-primary" type="button" data-character-lens="story" aria-pressed="false">Story</button></div>
<div class="character-graph-toolbar"><button type="button" class="btn btn-outline-secondary" data-character-zoom="in" aria-label="Zoom in">+</button><button type="button" class="btn btn-outline-secondary" data-character-zoom="out" aria-label="Zoom out">−</button><button type="button" class="btn btn-outline-secondary" data-character-graph-centre>Centre selected person</button><button type="button" class="btn btn-outline-secondary" data-character-graph-reset>Centre this character</button><span data-character-graph-status role="status"></span></div>
<div data-character-graph tabindex="0" role="group" aria-label="Character relationship diagram. Drag to pan; zoom with buttons. Arrow keys pan; plus and minus zoom."></div><div data-character-graph-selection class="small"></div><div class="character-graph-legend">Family: parent · biological · adoptive (dashed) · step (dotted) · partnership. Story: friendship (green), hostility (red), romance (purple), professional/social (blue).</div>
<p class="small">Only recorded connections are shown. A relationship does not establish a first meeting, mutual trust or viewpoint knowledge.</p>
<section data-character-relationship-records aria-label="Relationship records">
@foreach(var group in Model.Relationships.GroupBy(x=>x.Relationship.CharacterAID==c.CharacterID?x.Relationship.CharacterBID:x.Relationship.CharacterAID)){
var first=group.First();var other=group.Key;var name=first.Relationship.CharacterAID==c.CharacterID?first.Relationship.CharacterBName:first.Relationship.CharacterAName;var count=first.Relationship.WorkspaceDefinitionCount;
<details class="character-relationship-group plain-card" data-relationship-group="@other" open="@(q.OtherCharacterID==other)"><summary><strong>@name</strong> @if(count>1){<span class="status-pill">@count definitions</span>}<span>@string.Join(" · ",group.Select(x=>x.Relationship.RelationshipTypeName).Distinct().Take(3))</span><span class="small">@string.Join(" · ",group.Select(x=>x.CurrentStateName).Distinct().Take(2))</span></summary>
<div class="character-group-definitions"><a asp-controller="Characters" asp-action="Details" asp-route-id="@other" data-character-link>Open @name</a>
@foreach(var current in group){var r=current.Relationship;
<article class="character-record" tabindex="0" aria-label="Select definition @r.CharacterRelationshipID: @r.RelationshipTypeName" data-workspace-relationship="@r.CharacterRelationshipID"><p><strong>@r.CharacterAName @(r.IsReciprocal?"↔":"→") @r.CharacterBName · @r.RelationshipTypeName</strong> <span class="status-pill">@r.RelationshipCategoryName</span></p><p>@(q.SceneID.HasValue?"Selected-point state":"Latest recorded state"): @current.CurrentStateName @if(current.CurrentIntensity.HasValue&&current.LatestEvent?.RelationshipStateName!="Not established / ended at this point"){<span>· Intensity @current.CurrentIntensity</span>}</p><p class="character-long-text">@current.CurrentNotes</p><p class="small">Definition #@r.CharacterRelationshipID · @(r.IsInitialRelationship?"Initial author definition":"Scene-established definition") · @(r.IsReciprocal?"One reciprocal record covers both directions":"Independent directional record")</p>
@if(r.StartSceneID.HasValue){<a asp-controller="Scenes" asp-action="Edit" asp-route-id="@r.StartSceneID">Start scene #@r.StartSceneID</a>}@if(r.EndSceneID.HasValue){<a asp-controller="Scenes" asp-action="Edit" asp-route-id="@r.EndSceneID">End scene #@r.EndSceneID</a>}
<div class="button-row">@if(Model.Profile.WorkspaceCanEdit){<button class="btn btn-outline-primary btn-sm" type="button" data-workspace-operation="definition" data-relationship="@r.CharacterRelationshipID">Edit</button>}
<a class="btn btn-outline-secondary btn-sm" asp-controller="Dynamics" asp-action="Relationship" asp-route-id="@r.CharacterRelationshipID" asp-route-returnCharacterId="@c.CharacterID" asp-route-returnSceneId="@q.SceneID">History</a>
@if(Model.Profile.WorkspaceCanEdit){<button class="btn btn-outline-danger btn-sm" type="button" data-workspace-operation="archive" data-relationship="@r.CharacterRelationshipID">Remove</button>}</div></article>}
@if(!q.OtherCharacterID.HasValue&&count>3){<button type="button" class="btn btn-outline-secondary" data-group-page="1" data-other-character="@other">View all @count definitions for @name</button>}
@if(q.OtherCharacterID.HasValue&&count>25){<p>Showing definitions @((q.DefinitionPage-1)*25+1)–@Math.Min(q.DefinitionPage*25,count) of @count.</p><div class="button-row">@if(q.DefinitionPage>1){<button type="button" class="btn btn-outline-secondary" data-group-page="@(q.DefinitionPage-1)" data-other-character="@other">Previous definitions</button>}@if(q.DefinitionPage*25<count){<button type="button" class="btn btn-outline-secondary" data-group-page="@(q.DefinitionPage+1)" data-other-character="@other">More definitions for @name</button>}</div>}
</div></details>}
@if(!Model.Relationships.Any()){<p class="muted">No matching relationship definitions recorded. Add an initial relationship or use the scene editor for a scene-based development.</p>}
</section><p class="small">Select a definition to highlight its diagram connection. <a asp-controller="RelationshipMap" asp-action="Index" asp-route-projectId="@c.ProjectID" asp-route-focusCharacterId="@c.CharacterID">Full Relationships Editor</a></p>
}else{
@if(!Model.Entries.Any()){<p class="muted">No matching records at this point. Change the filters or record information in its scene/source editor.</p>}
@foreach(var group in Model.Entries.GroupBy(e=>new{e.BookID,e.BookDisplayTitle,e.ChapterNumber,e.SceneID,e.SceneTitle,e.SceneNumber})){
<section class="character-history-group"><h3>@group.Key.BookDisplayTitle · Chapter @group.Key.ChapterNumber · Scene @group.Key.SceneNumber: @group.Key.SceneTitle</h3>
@foreach(var item in group){<article class="character-record" data-workspace-entry="@item.ID" data-kind="@item.Kind"><details><summary><strong>@item.Heading</strong> · @item.State @if(item.IsPov){<span class="status-pill">POV</span>}<span class="small"> · @item.Kind · @item.EvidenceState</span></summary><div class="character-record-detail">
@if(!string.IsNullOrWhiteSpace(item.Previous)){<p>Previous recorded value: @item.Previous</p>}<p class="character-long-text">@item.Notes</p>
@if(item.EvidenceState is not (null or "Verified" or "Author record")){<p class="text-warning">Source evidence needs review; this is not established knowledge or a verified relationship development.</p>}
@if(item.SceneID.HasValue){<a asp-controller="Scenes" asp-action="Edit" asp-route-id="@item.SceneID">Open scene / source editor</a><a asp-controller="Timeline" asp-action="Index" asp-route-ProjectID="@c.ProjectID" asp-route-SelectedSceneID="@item.SceneID" asp-route-FocusType="character" asp-route-FocusID="@c.CharacterID" asp-route-navigateFocus="true">Timeline</a>}
@if(item.RelatedCharacterID.HasValue){<a asp-controller="Characters" asp-action="Details" asp-route-id="@item.RelatedCharacterID" data-character-link>Related character</a>}
@if(item.Kind=="relationships"&&Model.Profile.WorkspaceCanEdit&&item.RelationshipID.HasValue){<button type="button" class="btn btn-outline-secondary btn-sm" data-workspace-operation="event-edit" data-relationship="@item.RelationshipID" data-event="@item.ID">Edit this event</button><button type="button" class="btn btn-outline-danger btn-sm" data-workspace-operation="event-remove" data-relationship="@item.RelationshipID" data-event="@item.ID">Remove this event</button>}
@if(q.Tab=="scenes"){<button type="button" class="btn btn-primary btn-sm" data-workspace-set-position="@item.SceneID">Use this story point</button>}
</div></details></article>}
</section>}
}
<div class="character-workspace-pagination"><span>@Model.Total @(q.Tab=="relationships"?"character groups":"recorded results") · page @q.Page of @totalPages</span>@if(q.Page>1){<button type="button" class="btn btn-outline-secondary" data-workspace-page="@(q.Page-1)">Previous</button>}@if(q.Page<totalPages){<button type="button" class="btn btn-outline-secondary" data-workspace-page="@(q.Page+1)">Next</button>}</div>
}
</div>