PlotDirector/PlotLine/Views/Writer/WritingPlans.cshtml
2026-06-12 22:46:18 +01:00

116 lines
5.2 KiB
Plaintext

@model WritingPlansManagementViewModel
@{
ViewData["Title"] = "Writing Plans";
var message = TempData["WritingPlansMessage"] as string;
var error = TempData["WritingPlansError"] as string;
}
<nav class="breadcrumb-trail" aria-label="Breadcrumb">
<a asp-controller="Writer" asp-action="Index">Writer Workspace</a>
<span>Writing Plans</span>
</nav>
<div class="page-heading compact">
<div>
<p class="eyebrow">Schedule admin</p>
<h1>Writing Plans</h1>
<p class="lead-text">Manage writing plans and their generated schedules.</p>
</div>
<div class="button-row">
<a class="btn btn-primary" asp-action="ScheduleSetup">Create Writing Schedule</a>
<a class="btn btn-outline-secondary" asp-action="SchedulePreview">Schedule Preview</a>
</div>
</div>
@if (!string.IsNullOrWhiteSpace(message))
{
<div class="alert alert-info">@message</div>
}
@if (!string.IsNullOrWhiteSpace(error))
{
<div class="alert alert-warning">@error</div>
}
<section class="story-bible-section">
<div class="story-bible-section-heading">
<div>
<p class="eyebrow">Plans</p>
<h2>Writing Plans</h2>
</div>
<span class="soft-count">@Model.Plans.Count plans</span>
</div>
@if (!Model.Plans.Any())
{
<p class="muted">No writing plans found.</p>
}
else
{
<div class="table-responsive">
<table class="table align-middle">
<thead>
<tr>
<th>Plan Name</th>
<th>Project</th>
<th>Book</th>
<th>Goal Type</th>
<th>Start Date</th>
<th>Deadline Date</th>
<th>Session Length</th>
<th>Active</th>
<th>Planned Tasks</th>
<th>Projected Finish Date</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var plan in Model.Plans)
{
<tr>
<td>@plan.PlanName</td>
<td>@plan.ProjectName</td>
<td>@(plan.BookTitle ?? "All Books")</td>
<td>@plan.GoalType</td>
<td>@plan.StartDate.ToString("dd MMM yyyy")</td>
<td>@plan.DeadlineDate.ToString("dd MMM yyyy")</td>
<td>@plan.SessionLengthMinutes minutes</td>
<td>@(plan.IsActive ? "Yes" : "No")</td>
<td>@plan.PlannedTaskCount</td>
<td>@(plan.ProjectedFinishDate?.ToString("dd MMM yyyy") ?? "-")</td>
<td>
<div class="button-row">
<a class="btn btn-sm btn-outline-secondary" asp-action="SchedulePreview" asp-route-writingPlanId="@plan.WritingPlanID">View Schedule</a>
<a class="btn btn-sm btn-outline-primary" asp-action="EditWritingPlan" asp-route-id="@plan.WritingPlanID">Edit Plan</a>
@if (plan.IsActive)
{
<form asp-action="DeactivateWritingPlan" method="post">
<input type="hidden" name="writingPlanId" value="@plan.WritingPlanID" />
<button class="btn btn-sm btn-outline-secondary" type="submit">Deactivate Plan</button>
</form>
}
else
{
<form asp-action="ActivateWritingPlan" method="post">
<input type="hidden" name="writingPlanId" value="@plan.WritingPlanID" />
<button class="btn btn-sm btn-outline-secondary" type="submit">Activate Plan</button>
</form>
}
<form asp-action="RegenerateWritingPlanSchedule" method="post">
<input type="hidden" name="writingPlanId" value="@plan.WritingPlanID" />
<button class="btn btn-sm btn-outline-primary" type="submit">Regenerate Schedule</button>
</form>
<form asp-action="DeleteWritingPlan" method="post" onsubmit="return confirm('Delete this writing plan and its generated schedule items?');">
<input type="hidden" name="writingPlanId" value="@plan.WritingPlanID" />
<button class="btn btn-sm btn-outline-danger" type="submit">Delete Plan</button>
</form>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
}
</section>