104 lines
4.7 KiB
Plaintext
104 lines
4.7 KiB
Plaintext
@model ProjectIndexViewModel
|
|
@{
|
|
ViewData["Title"] = "Projects";
|
|
}
|
|
|
|
<div class="page-heading">
|
|
<div>
|
|
<p class="eyebrow">Series planning</p>
|
|
<h1>Projects <help-icon key="projects.overview" /></h1>
|
|
</div>
|
|
<div class="button-row">
|
|
<a class="btn btn-outline-primary" asp-controller="Imports" asp-action="Index">Import JSON</a>
|
|
<a class="btn btn-primary" asp-action="Create">New project</a>
|
|
</div>
|
|
</div>
|
|
|
|
@if (TempData["ArchiveMessage"] is string archiveMessage)
|
|
{
|
|
<div class="alert alert-success">@archiveMessage</div>
|
|
}
|
|
@if (TempData["ProjectExportMessage"] is string projectExportMessage)
|
|
{
|
|
<div class="alert alert-warning">@projectExportMessage</div>
|
|
}
|
|
|
|
@if (!Model.ActiveProjects.Any() && !Model.ArchivedProjects.Any())
|
|
{
|
|
<section class="empty-panel">
|
|
<h2>Start with a series or standalone novel</h2>
|
|
<p>Create a project, then add books, chapters and scenes in narrative order.</p>
|
|
<a class="btn btn-primary" asp-action="Create">Create your first project</a>
|
|
</section>
|
|
}
|
|
else
|
|
{
|
|
<section class="list-section">
|
|
<h2>Active Projects</h2>
|
|
@if (!Model.ActiveProjects.Any())
|
|
{
|
|
<p class="muted">No active projects.</p>
|
|
}
|
|
else
|
|
{
|
|
<div class="content-grid">
|
|
@foreach (var project in Model.ActiveProjects)
|
|
{
|
|
<article class="plain-card">
|
|
<h3>@project.ProjectName</h3>
|
|
<p class="eyebrow">@project.AccessRole</p>
|
|
<p>@(string.IsNullOrWhiteSpace(project.Description) ? "No description yet." : project.Description)</p>
|
|
<div class="button-row">
|
|
<a class="btn btn-outline-primary btn-sm" asp-action="Details" asp-route-id="@project.ProjectID">Open</a>
|
|
<a class="btn btn-outline-secondary btn-sm" asp-action="Edit" asp-route-id="@project.ProjectID">Edit</a>
|
|
@if (project.IsOwner)
|
|
{
|
|
<a class="btn btn-outline-secondary btn-sm" asp-controller="Exports" asp-action="ProjectBackup" asp-route-projectId="@project.ProjectID">Download backup</a>
|
|
<form asp-action="Archive" method="post" class="archive-button-form" data-confirm-message="Archive this project? Archived projects are hidden from your active workspace but remain stored within PlotDirector. Export your project first if you wish to maintain an external backup.">
|
|
<input type="hidden" name="id" value="@project.ProjectID" />
|
|
<button class="btn btn-outline-danger btn-sm" type="submit">Archive</button>
|
|
</form>
|
|
}
|
|
</div>
|
|
</article>
|
|
}
|
|
</div>
|
|
}
|
|
</section>
|
|
|
|
<section class="list-section">
|
|
<h2>Archived Projects</h2>
|
|
@if (!Model.ArchivedProjects.Any())
|
|
{
|
|
<p class="muted">No archived projects.</p>
|
|
}
|
|
else
|
|
{
|
|
<div class="content-grid">
|
|
@foreach (var project in Model.ArchivedProjects)
|
|
{
|
|
var archivedDateLabel = project.ArchivedDate?.ToLocalTime().ToString("yyyy-MM-dd");
|
|
<article class="plain-card">
|
|
<h3>@project.ProjectName</h3>
|
|
<p class="eyebrow">
|
|
Archived
|
|
@if (!string.IsNullOrWhiteSpace(archivedDateLabel))
|
|
{
|
|
<span> / @archivedDateLabel</span>
|
|
}
|
|
</p>
|
|
<p>@(string.IsNullOrWhiteSpace(project.Description) ? "No description yet." : project.Description)</p>
|
|
<div class="button-row">
|
|
<a class="btn btn-outline-secondary btn-sm" asp-controller="Exports" asp-action="ProjectBackup" asp-route-projectId="@project.ProjectID">Download backup</a>
|
|
<form asp-action="Restore" method="post" class="archive-button-form" data-confirm-message="Restore this project? It will return to your active project list.">
|
|
<input type="hidden" name="id" value="@project.ProjectID" />
|
|
<button class="btn btn-outline-primary btn-sm" type="submit">Restore</button>
|
|
</form>
|
|
</div>
|
|
</article>
|
|
}
|
|
</div>
|
|
}
|
|
</section>
|
|
}
|