53 lines
2.4 KiB
Plaintext

@model PlotLine.Controllers.WriterGroupsController.GroupPage
@{
ViewData["Title"] = "Working groups";
ViewData["ProjectSection"] = "Writer";
}
<header data-pwa-task>
<h1>Working groups</h1>
<p>Group existing chapters for a stretch of work. Choose any chapter in the group when you write.</p>
</header>
@if (TempData["WriterWorkspaceMessage"] is string message)
{
<p role="status">@message</p>
}
@foreach (var group in Model.Groups)
{
<section class="story-bible-card mb-3">
<h2>@group.Name @if (group.IsCurrent) { <small class="text-body-secondary">Current focus</small> }</h2>
<ul>
@foreach (var chapter in Model.Chapters.Where(chapter => group.ChapterIDs.Contains(chapter.ChapterID)))
{
<li><a asp-controller="Writer" asp-action="Chapter" asp-route-id="@chapter.ChapterID">@chapter.ChapterTitle</a></li>
}
</ul>
<a asp-action="Index" asp-route-bookId="@Model.BookID" asp-route-groupId="@group.GroupID">Edit @group.Name</a>
@if (group.ChapterIDs.Count > 0)
{
<a asp-controller="Writer" asp-action="ScheduleSetup" asp-route-bookId="@Model.BookID" asp-route-workingGroupId="@group.GroupID">Schedule time for @group.Name</a>
}
</section>
}
<form asp-action="Index" method="post" class="story-bible-card">
<h2>@(Model.GroupID == 0 ? "Create a group" : "Edit group")</h2>
<div asp-validation-summary="All" class="text-danger"></div>
<input asp-for="BookID" type="hidden" />
<input asp-for="GroupID" type="hidden" />
<label asp-for="Name" class="form-label">Group name</label>
<input asp-for="Name" class="form-control" required />
<label class="mt-2"><input asp-for="IsCurrent" /> Make this the current group for this book</label>
<fieldset class="mt-2">
<legend>Chapters</legend>
@foreach (var chapter in Model.Chapters)
{
<label class="d-block">
<input type="checkbox" name="ChapterIDs" value="@chapter.ChapterID" checked="@Model.ChapterIDs.Contains(chapter.ChapterID)" /> @chapter.ChapterTitle
</label>
}
</fieldset>
<div class="button-row mt-3" data-pwa-context="Record">
<button class="btn btn-primary" type="submit">Save working group</button>
<a asp-action="Index" asp-route-bookId="@Model.BookID">Cancel</a>
</div>
</form>