123 lines
11 KiB
Plaintext
123 lines
11 KiB
Plaintext
@model ApplicationNavigationViewModel
|
|
@{
|
|
var project = Model.Project;
|
|
var book = Model.Book;
|
|
var controller = ViewContext.RouteData.Values["controller"]?.ToString();
|
|
}
|
|
<nav class="navbar navbar-expand-lg border-bottom plotline-nav app-navigation" aria-label="Application navigation" data-app-navigation>
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand fw-semibold" asp-route="@PublicRouteNames.Home">PlotDirector</a>
|
|
<div class="app-navigation-status">
|
|
@if (Model.ShowCompanionPresence)
|
|
{
|
|
<span class="word-companion-presence-pill" data-word-companion-presence data-word-companion-status="Offline" title="Word Companion status" role="status" aria-live="polite">
|
|
<span class="word-companion-presence-dot" data-word-companion-status-dot></span>
|
|
<span data-word-companion-status-label>Offline</span>
|
|
</span>
|
|
}
|
|
</div>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#applicationMenu" aria-controls="applicationMenu" aria-expanded="false" aria-label="Toggle application menu">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="applicationMenu">
|
|
<ul class="navbar-nav app-navigation-menus">
|
|
<li class="nav-item dropdown">
|
|
<button class="nav-link dropdown-toggle @(controller == "Projects" ? "active" : null)" type="button" id="appProjectMenu" data-bs-toggle="dropdown" aria-expanded="false" title="@(project?.ProjectName ?? "Project")">
|
|
<span class="app-context-label">@(project?.ProjectName ?? "Project")</span>
|
|
</button>
|
|
<ul class="dropdown-menu" aria-labelledby="appProjectMenu">
|
|
@if (project is not null)
|
|
{
|
|
<li><h2 class="dropdown-header">@project.ProjectName</h2></li>
|
|
<li><a class="dropdown-item" asp-controller="Projects" asp-action="Details" asp-route-id="@project.ProjectID">Project overview</a></li>
|
|
<li><a class="dropdown-item" asp-controller="Projects" asp-action="Edit" asp-route-id="@project.ProjectID">Edit project</a></li>
|
|
<li><a class="dropdown-item" asp-controller="Books" asp-action="Create" asp-route-projectId="@project.ProjectID">Add book</a></li>
|
|
<li><a class="dropdown-item" asp-controller="Projects" asp-action="Activity" asp-route-id="@project.ProjectID">Activity</a></li>
|
|
@if (project.IsOwner)
|
|
{
|
|
<li><a class="dropdown-item" asp-controller="ProjectCollaborators" asp-action="Index" asp-route-projectId="@project.ProjectID">Collaborators</a></li>
|
|
<li><a class="dropdown-item" asp-controller="BookRecovery" asp-action="Backup" asp-route-projectId="@project.ProjectID">Back up books</a></li>
|
|
}
|
|
@if(project.IsOwner){<li><a class="dropdown-item" asp-controller="ProjectRestorePoints" asp-action="Index" asp-route-projectId="@project.ProjectID">Rewind project · saved restore points</a></li>}
|
|
<li><hr class="dropdown-divider" /></li>
|
|
}
|
|
<li><a class="dropdown-item" asp-controller="Projects" asp-action="Index">@(project is null ? "Projects" : "Switch project…")</a></li>
|
|
<li><form asp-controller="Onboarding" asp-action="StartImport" method="post"><button class="dropdown-item">Import a manuscript</button></form></li>
|
|
@if(project is null){<li><a class="dropdown-item" asp-controller="BookRecovery" asp-action="Backup">Back up books</a></li>}
|
|
<li><a class="dropdown-item" asp-controller="BookRecovery" asp-action="Restore">Restore books from backup</a></li>
|
|
</ul>
|
|
</li>
|
|
@if (project is not null)
|
|
{
|
|
<li class="nav-item dropdown">
|
|
<button class="nav-link dropdown-toggle @(controller is "Books" or "Chapters" or "Scenes" or "ManuscriptReader" ? "active" : null)" type="button" id="appBookMenu" data-bs-toggle="dropdown" aria-expanded="false" title="@(book?.BookDisplayTitle ?? "Book")">
|
|
<span class="app-context-label app-book-label" data-app-book-label>@(book?.BookDisplayTitle ?? "Book")</span>
|
|
</button>
|
|
<ul class="dropdown-menu app-book-menu" aria-labelledby="appBookMenu">
|
|
<li><h2 class="dropdown-header" data-app-book-heading>@(book?.BookDisplayTitle ?? "Books in this project")</h2></li>
|
|
<li hidden="@(book is null)" data-app-book-action><a class="dropdown-item" data-app-book-url="@Url.Action("Details", "Books", new { id = (int?)null })" asp-controller="Books" asp-action="Details" asp-route-id="@book?.BookID">Book overview</a></li>
|
|
<li hidden="@(book is null)" data-app-book-action><a class="dropdown-item" data-app-book-url="@Url.Action("Index", "ManuscriptReader")" data-app-book-param="bookId" asp-controller="ManuscriptReader" asp-action="Index" asp-route-bookId="@book?.BookID">Read manuscript</a></li>
|
|
<li hidden="@(book is null)" data-app-book-action><a class="dropdown-item" data-app-book-url="@Url.Action("Edit", "Books", new { id = (int?)null })" asp-controller="Books" asp-action="Edit" asp-route-id="@book?.BookID">Edit book</a></li>
|
|
<li hidden="@(book is null)" data-app-book-action><a class="dropdown-item" data-app-book-url="@Url.Action("Create", "Chapters", new { id = (int?)null })" data-app-book-param="bookId" asp-controller="Chapters" asp-action="Create" asp-route-bookId="@book?.BookID">Add chapter</a></li>
|
|
<li hidden="@(book is null)" data-app-book-action><a class="dropdown-item" data-app-review-link data-review-url="@Url.Action("StoryIntelligenceBookReviewCentre", "Onboarding", new { bookId = 0 })" asp-controller="Onboarding" asp-action="StoryIntelligenceBookReviewCentre" asp-route-bookId="@book?.BookID">Review Centre</a></li>
|
|
<li><a class="dropdown-item" asp-controller="Projects" asp-action="Details" asp-route-id="@project.ProjectID">All books / project overview</a></li>
|
|
<li><hr class="dropdown-divider" /></li>
|
|
@foreach (var choice in Model.Books)
|
|
{
|
|
<li><a class="dropdown-item @(choice.BookID == book?.BookID ? "active" : null)" aria-current="@(choice.BookID == book?.BookID ? "page" : null)" data-app-book-choice="@choice.BookID" data-app-book-title="@choice.BookDisplayTitle" href="@(Model.ActiveSection == "Writer" ? Url.Action(controller=="WriterInvestigations" ? "Explore" : WriterNavigation.BookSwitchAction(ViewContext.RouteData.Values["action"]?.ToString()), "Writer", new { projectId = project.ProjectID, bookId = choice.BookID }) : Url.Action("Details", "Books", new { id = choice.BookID }))">Book @choice.BookNumber: @choice.BookDisplayTitle</a></li>
|
|
}
|
|
@if (Model.Books.Count == 0)
|
|
{
|
|
<li><span class="dropdown-item-text text-muted">No books yet</span></li>
|
|
}
|
|
</ul>
|
|
</li>
|
|
<partial name="_ApplicationSectionMenus" model="Model" />
|
|
}
|
|
else
|
|
{
|
|
<li class="nav-item"><a class="nav-link @(Model.ActiveSection == "Writer" ? "active" : null)" aria-current="@(Model.ActiveSection == "Writer" ? "page" : null)" asp-controller="Writer" asp-action="Index">Writer</a></li>
|
|
}
|
|
<li class="nav-item dropdown">
|
|
<button class="nav-link dropdown-toggle @(controller is "Help" or "FeatureRequests" ? "active" : null)" type="button" id="appHelpMenu" data-bs-toggle="dropdown" aria-expanded="false">Help</button>
|
|
<ul class="dropdown-menu" aria-labelledby="appHelpMenu">
|
|
<li><a class="dropdown-item" asp-route="@PublicRouteNames.Help">Help Centre</a></li>
|
|
<li><a class="dropdown-item" asp-controller="FeatureRequests" asp-action="Index">Feature Requests @if (Model.FeatureRequestAttentionCount > 0) { <span class="badge text-bg-warning ms-1">@Model.FeatureRequestAttentionCount</span> }</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="nav-item dropdown app-account-menu">
|
|
<button class="nav-link dropdown-toggle" type="button" id="accountMenuButton" data-bs-toggle="dropdown" aria-expanded="false" title="@User.Identity?.Name">
|
|
<span class="app-account-label">@User.Identity?.Name</span>
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="accountMenuButton">
|
|
<li><h2 class="dropdown-header">@User.Identity?.Name</h2></li>
|
|
<li><a class="dropdown-item" asp-controller="ManageAccount" asp-action="Index">Manage Account</a></li>
|
|
<li><a class="dropdown-item" asp-controller="Onboarding" asp-action="Index">Setup preferences</a></li>
|
|
@if (!(ViewData["ShellClass"] as string ?? "").Contains("marketing-shell", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
<li><button type="button" class="dropdown-item" data-bs-toggle="modal" data-bs-target="#customiseToolbar">Customise toolbar…</button></li>
|
|
}
|
|
<li><a class="dropdown-item" asp-controller="ManageAccount" asp-action="Subscription">Billing / Subscription</a></li>
|
|
@if (Model.IsAdmin)
|
|
{
|
|
<li><hr class="dropdown-divider" /></li>
|
|
<li><a class="dropdown-item" asp-controller="Admin" asp-action="Index">Admin @if (Model.AdminFeatureRequestAttentionCount > 0) { <span class="badge text-bg-danger ms-1">@Model.AdminFeatureRequestAttentionCount</span> }</a></li>
|
|
}
|
|
<li><hr class="dropdown-divider" /></li>
|
|
<li><div class="px-3 py-2">
|
|
<div class="small text-muted mb-2">Theme</div>
|
|
<div class="theme-switcher btn-group btn-group-sm w-100" role="group" aria-label="Theme selection">
|
|
<button type="button" class="btn btn-outline-secondary" data-theme-choice="light" aria-pressed="true">Light</button>
|
|
<button type="button" class="btn btn-outline-secondary" data-theme-choice="dark" aria-pressed="false">Dark</button>
|
|
</div>
|
|
</div></li>
|
|
<li><hr class="dropdown-divider" /></li>
|
|
<li><a class="dropdown-item" asp-route="@PublicRouteNames.Home">PlotDirector website</a></li>
|
|
<li><form asp-controller="Account" asp-action="Logout" method="post" class="m-0"><button class="dropdown-item" type="submit">Logout</button></form></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|