76 lines
5.4 KiB
Plaintext
76 lines
5.4 KiB
Plaintext
@model PlotLine.Services.Manuscript.ManuscriptReaderModel
|
|
@{
|
|
ViewData["Title"] = $"Manuscript Reader · {Model.Book.BookTitle}";
|
|
ViewData["DesktopLayout"] = "details";
|
|
}
|
|
<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-check-url="@Url.Action("Changes")" data-chapter-url="@Url.Action("Chapter")">
|
|
<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>
|
|
<nav class="reader-controls" aria-label="Chapter navigation">
|
|
@if (Model.PreviousId is int previous)
|
|
{ <a class="btn btn-outline-secondary" asp-action="Index" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@previous" asp-route-focus="@Model.FocusReading" rel="prev">← Previous chapter</a> }
|
|
else { <span class="btn btn-outline-secondary disabled" aria-disabled="true">← Previous chapter</span> }
|
|
<form method="get" asp-action="Index">
|
|
<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 class="btn btn-outline-secondary" asp-action="Index" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@next" asp-route-focus="@Model.FocusReading" rel="next">Next chapter →</a> }
|
|
else { <span class="btn btn-outline-secondary disabled" aria-disabled="true">Next chapter →</span> }
|
|
<button type="button" class="btn btn-outline-secondary" id="reader-focus" aria-pressed="@Model.FocusReading.ToString().ToLowerInvariant()" hidden>Focus reading</button>
|
|
</nav>
|
|
<p class="reader-status" role="status" id="reader-loading" hidden>Loading chapter…</p>
|
|
<div class="reader-status reader-live-controls" hidden>
|
|
<label><input type="checkbox" id="reader-pause" /> Pause automatic updates while listening</label>
|
|
<span role="status" aria-live="polite" id="reader-update-status"></span>
|
|
<button type="button" id="reader-apply-update" class="btn btn-outline-secondary btn-sm" hidden>Show updated chapter</button>
|
|
</div>
|
|
<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>
|
|
<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-action="Index" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@Model.Chapter?.ChapterID" asp-route-focus="@Model.FocusReading">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="_Paragraphs" 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-action="Index" asp-route-bookId="@Model.Book.BookID" asp-route-chapterId="@Model.Chapter?.ChapterID" asp-route-focus="@Model.FocusReading">Refresh manuscript</a>
|
|
</footer>
|
|
</div>
|
|
<script src="~/js/manuscript-reader.js" asp-append-version="true" defer></script>
|