78 lines
7.8 KiB
Plaintext
78 lines
7.8 KiB
Plaintext
@model WritingContextPageViewModel
|
|
@using System.Text.Json
|
|
@{
|
|
Layout = "_WritingCompanionLayout";
|
|
ViewData["Title"] = "Context";
|
|
var position = Model.Display?.Context?.Position;
|
|
var tabs = new[] {
|
|
new { id = "overview", displayName = "Overview", endpoint = Url.Action("ContextScene", "Writing"), scope = "Scene", contentRefresh = "relevant-scope", lifecycle = "reference", refreshGuard = "defer-while-dirty-or-busy", actions = new[] { "scene.focus" } },
|
|
new { id = "characters", displayName = "Characters in Scene", endpoint = Url.Action("ContextCharacters", "Writing"), scope = "Scene", contentRefresh = "relevant-scope", lifecycle = "characters", refreshGuard = "defer-while-dirty-or-busy", actions = new[] { "character.focus" } },
|
|
new { id = "names", displayName = "Names", endpoint = Url.Action("ContextNamesTab", "Writing"), scope = "Book", contentRefresh = "relevant-scope", lifecycle = "names", refreshGuard = "defer-while-dirty-or-busy", actions = Array.Empty<string>() },
|
|
new { id = "relationships", displayName = "Relationships", endpoint = Url.Action("ContextRelationships", "Writing"), scope = "Scene", contentRefresh = "relevant-scope", lifecycle = "relationships", refreshGuard = "defer-while-dirty-or-busy", actions = new[] { "relationship.focus" } },
|
|
new { id = "locations", displayName = "Locations", endpoint = Url.Action("ContextLocations", "Writing"), scope = "Scene", contentRefresh = "relevant-scope", lifecycle = "spatial", refreshGuard = "defer-while-dirty-or-busy", actions = Array.Empty<string>() },
|
|
new { id = "maps", displayName = "Maps", endpoint = Url.Action("ContextMaps", "Writing"), scope = "Scene", contentRefresh = "relevant-scope", lifecycle = "spatial", refreshGuard = "defer-while-dirty-or-busy", actions = Array.Empty<string>() },
|
|
new { id = "floorplans", displayName = "Floor Plans", endpoint = Url.Action("ContextFloorPlans", "Writing"), scope = "Scene", contentRefresh = "relevant-scope", lifecycle = "spatial", refreshGuard = "defer-while-dirty-or-busy", actions = Array.Empty<string>() }
|
|
};
|
|
}
|
|
<link rel="stylesheet" href="~/css/context-workspace.css" asp-append-version="true" />
|
|
<link rel="stylesheet" href="~/css/location-picker.css" asp-append-version="true" />
|
|
<link rel="stylesheet" href="~/css/context-spatial.css" asp-append-version="true" />
|
|
<main class="context-workspace" data-context-workspace data-user="@User.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value"
|
|
data-scope-project-id="@Model.ProjectID" data-scope-book-id="@Model.BookID"
|
|
data-chapter-id="@(position?.ChapterId ?? Model.ChapterID)" data-scene-id="@(position?.SceneId ?? Model.SceneID)"
|
|
data-follow-mode="@(ViewData["NativeSnapshot"] is true ? "snapshot" : "live")"
|
|
data-word-instance="@ViewData["WordInstance"]" data-word-session="@ViewData["WordSession"]">
|
|
<script type="application/json" data-context-tabs>@Html.Raw(JsonSerializer.Serialize(tabs))</script>
|
|
<header class="context-toolbar">
|
|
<h1>Context</h1>
|
|
<label>Layout <select data-context-layout class="form-select form-select-sm"><option value="single">Single pane</option><option value="columns">Side by side</option><option value="rows">Stacked</option></select></label>
|
|
<partial name="_FocusFollowControl"/>
|
|
<button type="button" class="btn btn-outline-secondary btn-sm" data-context-new>New Context window</button>
|
|
<button type="button" class="btn btn-outline-secondary btn-sm" data-context-refresh>Refresh saved data</button>
|
|
<button type="button" class="btn btn-outline-secondary btn-sm" data-context-windows>My Windows</button>
|
|
<p data-context-status role="status" hidden></p>
|
|
</header>
|
|
<nav class="context-navigation" aria-label="Saved manuscript scenes">
|
|
<label>Scene <select data-context-scene class="form-select form-select-sm"><option value="">Choose a saved scene</option>@foreach(var item in Model.Display?.SceneOptions ?? []){<option value="@item.Value" selected="@item.Selected">@item.Text</option>}</select></label>
|
|
<button type="button" class="btn btn-outline-secondary btn-sm" data-context-previous>Previous</button>
|
|
<button type="button" class="btn btn-outline-secondary btn-sm" data-context-next>Next</button><button type="button" class="btn btn-outline-secondary btn-sm" data-context-go-focus>Go to Focus</button>
|
|
<a data-context-editor data-context-workspace-target="scene" data-context-entity="@Model.SceneID" class="btn btn-outline-secondary btn-sm" href="@(Model.SceneID.HasValue ? $"/Scenes/Edit/{Model.SceneID}" : "/Writer")" target="_blank" rel="noopener">Open scene editor</a>
|
|
</nav>
|
|
<div class="context-panes" data-context-panes data-layout="single">
|
|
@for(var pane = 0; pane < 2; pane++) {
|
|
@if(pane == 1){<div data-context-divider role="separator" tabindex="0" aria-label="Resize Context panes" aria-controls="context-pane-0 context-pane-1" aria-orientation="vertical" aria-valuemin="20" aria-valuemax="80" aria-valuenow="50" hidden></div>}
|
|
<section id="context-pane-@pane" class="context-pane" data-context-pane="@pane" aria-label="Context pane @(pane+1)" hidden="@(pane==1)">
|
|
<div class="context-pane-toolbar"><label>Tool <select data-context-tab class="form-select form-select-sm">@foreach(var tab in tabs){<option value="@tab.id">@tab.displayName</option>}</select></label></div>
|
|
<p data-context-pane-status class="context-pane-status" role="status"></p>
|
|
<div data-context-pane-content class="context-pane-content" tabindex="0" aria-label="Pane @(pane+1) reference content"></div>
|
|
</section>
|
|
}
|
|
</div>
|
|
<dialog data-context-edit-dialog class="context-windows-dialog"><h2 class="h5">Focused correction</h2><div data-context-edit-content></div><p data-context-edit-status role="status"></p><button type="button" data-context-edit-close class="btn btn-outline-secondary" hidden>Cancel</button></dialog>
|
|
<dialog data-context-windows-dialog class="context-windows-dialog">
|
|
<h2 class="h5">My Context windows</h2><p>Only your connected windows for this book appear. Commands focus a reference tool; they do not navigate Word.</p>
|
|
<div data-context-window-list></div>
|
|
<label>Destination <select data-context-window-target class="form-select"><option value="">Choose automatically</option></select></label>
|
|
<button type="button" data-context-demonstrate class="btn btn-outline-primary mt-2">Focus this scene in an Overview pane</button>
|
|
<p data-context-window-status role="status"></p>
|
|
<button type="button" data-context-windows-close class="btn btn-outline-secondary">Close</button>
|
|
</dialog>
|
|
</main>
|
|
@section Scripts {
|
|
<script src="~/js/writing-workspace.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-tools.js" asp-append-version="true"></script>
|
|
<script src="~/js/names-workspace.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-names.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-relationship-layout.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-relationships.js" asp-append-version="true"></script>
|
|
<script src="~/js/location-picker.js" asp-append-version="true"></script>
|
|
<script src="~/js/location-types.js" asp-append-version="true"></script>
|
|
<script src="~/js/floor-plan-renderer.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-spatial.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-workspace.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-environment.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-windows.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-main-window.js" asp-append-version="true"></script>
|
|
<script src="~/js/context-editing.js" asp-append-version="true"></script>
|
|
}
|