89 lines
8.9 KiB
Plaintext
89 lines
8.9 KiB
Plaintext
@model PlotLine.Services.Manuscript.ManuscriptReaderModel
|
|
@{
|
|
if(!Model.IntegratedReview){ViewData["Title"] = $"Manuscript Reader · {Model.Book.BookTitle}";ViewData["DesktopLayout"] = "details";}
|
|
var routeAction=Model.IntegratedReview?"Review":"Index";var routeController=Model.IntegratedReview?"Writer":"ManuscriptReader";
|
|
var reviewToolbar = new PlotLine.Models.WriterWorkToolbar(Model.Book.BookID, Model.Chapter?.ChapterID, Model.Chapter?.ChapterTitle, DefaultKind: "Reading");
|
|
}
|
|
<link rel="stylesheet" href="~/css/writer-work.css" asp-append-version="true" />
|
|
<link rel="stylesheet" href="~/css/manuscript-reader.css" asp-append-version="true" />
|
|
<div class="manuscript-reader" data-focus="@(Model.FocusReading ? "true" : "false")"
|
|
data-book-id="@Model.Book.BookID" data-chapter-id="@Model.Chapter?.ChapterID" data-chapter-number="@Model.Chapter?.ChapterNumber"
|
|
data-revision="@Model.Revision" data-version="@Model.ContentVersion"
|
|
data-reading="@Model.ReadingMode.ToString().ToLowerInvariant()" data-integrated-review="@Model.IntegratedReview.ToString().ToLowerInvariant()" data-check-url="@Url.Action("Changes","ManuscriptReader")" data-chapter-url="@Url.Action("Chapter","ManuscriptReader")">
|
|
@if(!Model.IntegratedReview){
|
|
<nav data-pwa-identity class="breadcrumb-trail" aria-label="Breadcrumb">
|
|
<a asp-controller="Books" asp-action="Details" asp-route-id="@Model.Book.BookID">@Model.Book.BookTitle · Chapters</a>
|
|
<span>Manuscript Reader</span>
|
|
</nav>
|
|
<header data-pwa-header class="page-heading">
|
|
<div><p class="eyebrow">@Model.Book.BookTitle</p><h1>Manuscript Reader</h1><span class="status-pill">Read only</span></div>
|
|
</header>
|
|
}
|
|
<div class="reader-mode-controls"><a data-pwa-context="Reading & Review" data-pwa-label="Reading mode" title="Switch between reading and review mode" asp-controller="Writer" asp-action="Review" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@Model.Chapter?.ChapterID" asp-route-reading="@(!Model.ReadingMode)">@(Model.ReadingMode?"Review mode":"Reading mode")</a></div>
|
|
<a data-reader-exit-focus hidden="@(!Model.FocusReading)" class="btn btn-outline-secondary" asp-controller="Writer" asp-action="Review" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@Model.Chapter?.ChapterID" asp-route-reading="@Model.ReadingMode">Exit Focus Reading</a>
|
|
<nav class="reader-controls" aria-label="Reading controls">
|
|
<div class="reader-chapter-navigation" aria-label="Chapter navigation in focused reading">
|
|
@if (Model.PreviousId is int previous)
|
|
{ <a id="reader-prev" data-pwa-label="Previous" title="Read the previous chapter" class="btn btn-outline-secondary" asp-controller="@routeController" asp-action="@routeAction" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@previous" asp-route-focus="@Model.FocusReading" asp-route-reading="@Model.ReadingMode" rel="prev">← Previous chapter</a> }
|
|
else { <button id="reader-prev" type="button" data-pwa-label="Previous" title="Read the previous chapter" class="btn btn-outline-secondary" disabled>← Previous chapter</button> }
|
|
<form method="get" asp-controller="@routeController" asp-action="@routeAction">
|
|
<input type="hidden" name="reading" value="@Model.ReadingMode.ToString().ToLowerInvariant()" />
|
|
<input type="hidden" name="focus" value="@Model.FocusReading.ToString().ToLowerInvariant()" />
|
|
<input type="hidden" name="bookId" value="@Model.Book.BookID" />
|
|
<label for="reader-chapter">Chapter</label>
|
|
<select id="reader-chapter" name="chapterId" class="form-select">
|
|
@foreach (var chapter in Model.Chapters)
|
|
{ <option value="@chapter.ChapterID" selected="@(chapter.ChapterID == Model.Chapter?.ChapterID)">@chapter.ChapterNumber: @chapter.ChapterTitle</option> }
|
|
</select>
|
|
<button class="btn btn-outline-secondary" type="submit">Read</button>
|
|
</form>
|
|
@if (Model.NextId is int next)
|
|
{ <a id="reader-next" data-pwa-label="Next" title="Read the next chapter" class="btn btn-outline-secondary" asp-controller="@routeController" asp-action="@routeAction" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@next" asp-route-focus="@Model.FocusReading" asp-route-reading="@Model.ReadingMode" rel="next">Next chapter →</a> }
|
|
else { <button id="reader-next" type="button" data-pwa-label="Next" title="Read the next chapter" class="btn btn-outline-secondary" disabled>Next chapter →</button> }
|
|
</div>
|
|
<button type="button" class="btn btn-outline-secondary" id="reader-focus" data-pwa-context="Reading & Review" data-pwa-keep-visible="true" title="Enter or exit Focused Reading" aria-pressed="@Model.FocusReading.ToString().ToLowerInvariant()" hidden>Focus reading</button>
|
|
</nav>
|
|
@if(Model.IntegratedReview){<button type="button" class="btn btn-outline-primary" data-review-record data-pwa-context="Annotations" data-pwa-label="Add annotation" title="Record a chapter, verified scene or selected passage annotation">Record an observation</button>}
|
|
<p class="reader-status" role="status" id="reader-loading" hidden>Loading chapter…</p>
|
|
<div class="reader-status reader-live-controls" hidden>
|
|
<input type="checkbox" id="reader-pause" hidden /><button type="button" id="reader-pause-toggle" class="btn btn-outline-secondary btn-sm" aria-pressed="false" data-pwa-context="Synchronisation" title="Pause automatic manuscript updates">Pause updates</button>
|
|
<span role="status" aria-live="polite" id="reader-update-status"></span>
|
|
<button type="button" id="reader-apply-update" data-pwa-context="Synchronisation" data-pwa-keep-visible="true" title="Show the newly accepted chapter" class="btn btn-outline-secondary btn-sm" hidden>Show updated chapter</button>
|
|
</div>
|
|
<details class="reader-metadata" open="@(!Model.IntegratedReview)"><summary>Accepted manuscript details</summary><div class="reader-status muted" id="reader-timestamps">
|
|
@if (Model.LastSuccessfulSyncUtc is DateTime sync)
|
|
{ <p>Last successful chapter synchronisation: <time datetime="@sync.ToString("yyyy-MM-ddTHH:mm:ssZ")">@sync.ToString("dd MMM yyyy HH:mm:ss") UTC</time></p> }
|
|
else { <p>No successful chapter synchronisation timestamp is recorded.</p> }
|
|
@if (Model.SnapshotCapturedUtc is DateTime captured)
|
|
{ <p>Accepted manuscript snapshot captured: <time datetime="@captured.ToString("yyyy-MM-ddTHH:mm:ssZ")">@captured.ToString("dd MMM yyyy HH:mm:ss") UTC</time></p> }
|
|
<p>Showing accepted server text. Changes are checked automatically while this page is visible.</p>
|
|
</div>
|
|
</details>
|
|
<button type="button" id="reader-audio" class="btn btn-outline-secondary btn-sm" data-pwa-context="Reading & Review" title="Open Reading and Audio Review controls">Reading & Audio</button>
|
|
<dialog id="reader-audio-dialog" class="reader-audio-dialog" aria-labelledby="reader-audio-title"><h2 id="reader-audio-title">Reading & Audio Review</h2><button type="button" class="btn btn-outline-secondary" data-reader-audio-close>Close</button><partial name="_WriterWorkToolbar" model="reviewToolbar" /></dialog>
|
|
@if(!Model.IntegratedReview){<a asp-controller="Writer" asp-action="Write" asp-route-bookId="@Model.Book.BookID">Return to Writing</a>}
|
|
<div id="reader-content">
|
|
@if (Model.Paragraphs.Count == 0)
|
|
{
|
|
<section class="reader-empty" role="status"><h2>@(Model.Chapter?.ChapterTitle ?? "No chapters yet")</h2>
|
|
<p>No accepted manuscript text is available for this chapter. Save and successfully synchronise it using Word Companion, then refresh this page.</p>
|
|
<a class="btn btn-outline-secondary" asp-controller="@routeController" asp-action="@routeAction" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@Model.Chapter?.ChapterID" asp-route-focus="@Model.FocusReading" asp-route-reading="@Model.ReadingMode">Refresh manuscript</a>
|
|
</section>
|
|
}
|
|
else
|
|
{
|
|
<article class="reader-page" aria-label="Chapter manuscript">
|
|
<header><p class="eyebrow">Chapter @Model.Chapter?.ChapterNumber</p>
|
|
@if (!Model.Paragraphs[0].IsHeading)
|
|
{ <h2>@Model.Chapter?.ChapterTitle</h2> }
|
|
</header>
|
|
<partial name="~/Views/ManuscriptReader/_Paragraphs.cshtml" model="Model.Paragraphs" />
|
|
</article>
|
|
}
|
|
</div>
|
|
<footer class="reader-status muted"><p>Captured paragraph text and headings are preserved. Word formatting such as bold, italics, images and page layout is not available in this capture.</p>
|
|
<a asp-controller="Books" asp-action="Details" asp-route-id="@Model.Book.BookID">Return to Chapters</a>
|
|
<a asp-controller="@routeController" asp-action="@routeAction" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@Model.Chapter?.ChapterID" asp-route-focus="@Model.FocusReading" asp-route-reading="@Model.ReadingMode">Refresh manuscript</a>
|
|
</footer>
|
|
</div>
|