86 lines
4.3 KiB
Plaintext
86 lines
4.3 KiB
Plaintext
@model BookDetailViewModel
|
|
@{
|
|
ViewData["Title"] = Model.Book.BookTitle;
|
|
ViewData["ProjectSection"] = "Overview";
|
|
}
|
|
|
|
<nav class="breadcrumb-trail" aria-label="Breadcrumb">
|
|
<a asp-controller="Projects" asp-action="Index">Projects</a>
|
|
<a asp-controller="Projects" asp-action="Details" asp-route-id="@Model.Project.ProjectID">@Model.Project.ProjectName</a>
|
|
<span>@Model.Book.BookTitle</span>
|
|
</nav>
|
|
|
|
<partial name="_ProjectSectionNav" model="Model.Project" />
|
|
|
|
<div class="page-heading">
|
|
<div>
|
|
<p class="eyebrow"><a asp-controller="Projects" asp-action="Details" asp-route-id="@Model.Project.ProjectID">@Model.Project.ProjectName</a></p>
|
|
<h1>Book @Model.Book.BookNumber: @Model.Book.BookTitle <help-icon key="books.overview" /></h1>
|
|
@if (!string.IsNullOrWhiteSpace(Model.Book.Description))
|
|
{
|
|
<p class="lead-text">@Model.Book.Description</p>
|
|
}
|
|
</div>
|
|
<div class="button-row">
|
|
<a class="btn btn-outline-secondary" asp-action="Edit" asp-route-id="@Model.Book.BookID">Edit book</a>
|
|
<a class="btn btn-primary" asp-controller="Chapters" asp-action="Create" asp-route-bookId="@Model.Book.BookID">Add chapter</a>
|
|
<div class="dropdown pw-actions">
|
|
<button class="btn pw-actions__toggle dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
Actions
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-end">
|
|
<a class="dropdown-item" asp-controller="Analytics" asp-action="Index" asp-route-projectId="@Model.Project.ProjectID" asp-route-bookId="@Model.Book.BookID">Story health</a>
|
|
<div class="dropdown-divider"></div>
|
|
<form asp-action="Archive" method="post" class="archive-button-form" data-confirm-message="Archive this book? This will hide it from active lists and timelines, but the data will be kept and can be restored later.">
|
|
<input type="hidden" name="id" value="@Model.Book.BookID" />
|
|
<input type="hidden" name="projectId" value="@Model.Project.ProjectID" />
|
|
<button class="dropdown-item text-danger" type="submit">Archive Book</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<section class="list-section">
|
|
<h2>Chapters <help-icon key="books.chapters" /></h2>
|
|
@if (!Model.Chapters.Any())
|
|
{
|
|
<p class="muted">No chapters yet.</p>
|
|
}
|
|
else
|
|
{
|
|
<div class="table-responsive">
|
|
<table class="table align-middle">
|
|
<thead>
|
|
<tr>
|
|
<th>Chapter</th>
|
|
<th>Title</th>
|
|
<th>Status</th>
|
|
<th>Summary</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var chapter in Model.Chapters)
|
|
{
|
|
<tr>
|
|
<td class="narrow">@chapter.ChapterNumber</td>
|
|
<td><a asp-controller="Chapters" asp-action="Details" asp-route-id="@chapter.ChapterID">@chapter.ChapterTitle</a></td>
|
|
<td><span class="status-pill">@chapter.RevisionStatusName</span></td>
|
|
<td>@chapter.Summary</td>
|
|
<td class="text-end">
|
|
<a class="btn btn-outline-secondary btn-sm" asp-controller="Chapters" asp-action="Edit" asp-route-id="@chapter.ChapterID">Edit</a>
|
|
<form asp-controller="Chapters" asp-action="Archive" method="post" class="archive-button-form" data-confirm-message="Archive this chapter? This will hide it from active lists and timelines, but the data will be kept and can be restored later.">
|
|
<input type="hidden" name="id" value="@chapter.ChapterID" />
|
|
<input type="hidden" name="bookId" value="@Model.Book.BookID" />
|
|
<button class="btn btn-outline-danger btn-sm" type="submit">Archive</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|
|
</section>
|