296 lines
16 KiB
Plaintext
296 lines
16 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en" data-theme="light" data-bs-theme="light">
|
|
@using System.Security.Claims
|
|
@inject IConfiguration Configuration
|
|
@inject IFeatureRequestService FeatureRequestService
|
|
@{
|
|
var shellClass = ViewData["ShellClass"] as string ?? string.Empty;
|
|
var isMarketingPage = shellClass.Contains("marketing-shell", StringComparison.OrdinalIgnoreCase);
|
|
var userEmail = User.FindFirstValue(ClaimTypes.Email);
|
|
var userIdValue = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
|
var userId = int.TryParse(userIdValue, out var parsedUserId) ? parsedUserId : (int?)null;
|
|
var adminEmails = Configuration.GetSection("Admin:AllowedEmails").Get<string[]>() ?? [];
|
|
var isAdmin = !string.IsNullOrWhiteSpace(userEmail)
|
|
&& adminEmails.Any(email => string.Equals(email, userEmail, StringComparison.OrdinalIgnoreCase));
|
|
var featureRequestAttentionCount = userId.HasValue ? await FeatureRequestService.CountAttentionForUserAsync(userId.Value) : 0;
|
|
var adminFeatureRequestAttentionCount = isAdmin ? await FeatureRequestService.CountWaitingForAdminAsync() : 0;
|
|
var defaultTitle = $"{ViewData["Title"]} - PlotDirector";
|
|
var seoTitle = isMarketingPage && ViewData["SeoTitle"] is string seoTitleValue ? seoTitleValue : defaultTitle;
|
|
var seoDescription = isMarketingPage && ViewData["SeoDescription"] is string seoDescriptionValue ? seoDescriptionValue : null;
|
|
var canonicalUrl = ViewData["CanonicalUrl"] as string;
|
|
var seoKeywords = isMarketingPage && ViewData["SeoKeywords"] is string seoKeywordsValue ? seoKeywordsValue : null;
|
|
var structuredData = ViewData["StructuredData"] is IEnumerable<string> structuredDataValues ? structuredDataValues : Array.Empty<string>();
|
|
const string ogImageUrl = "https://plotdirector.com/og-image.png";
|
|
}
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>@seoTitle</title>
|
|
@if (isMarketingPage)
|
|
{
|
|
@if (!string.IsNullOrWhiteSpace(seoDescription))
|
|
{
|
|
<meta name="description" content="@seoDescription" />
|
|
}
|
|
@if (!string.IsNullOrWhiteSpace(seoKeywords))
|
|
{
|
|
<meta name="keywords" content="@seoKeywords" />
|
|
}
|
|
<meta name="robots" content="index, follow" />
|
|
<meta property="og:site_name" content="PlotDirector" />
|
|
<meta property="og:title" content="@seoTitle" />
|
|
@if (!string.IsNullOrWhiteSpace(seoDescription))
|
|
{
|
|
<meta property="og:description" content="@seoDescription" />
|
|
}
|
|
<meta property="og:type" content="website" />
|
|
@if (!string.IsNullOrWhiteSpace(canonicalUrl))
|
|
{
|
|
<meta property="og:url" content="@canonicalUrl" />
|
|
}
|
|
<meta property="og:image" content="@ogImageUrl" />
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
<meta name="twitter:title" content="@seoTitle" />
|
|
@if (!string.IsNullOrWhiteSpace(seoDescription))
|
|
{
|
|
<meta name="twitter:description" content="@seoDescription" />
|
|
}
|
|
<meta name="twitter:image" content="@ogImageUrl" />
|
|
}
|
|
@foreach (var jsonLd in structuredData)
|
|
{
|
|
@Html.Raw("<script type=\"application/ld+json\">")
|
|
@Html.Raw(jsonLd)
|
|
@Html.Raw("</script>")
|
|
}
|
|
@if (!string.IsNullOrWhiteSpace(canonicalUrl))
|
|
{
|
|
<link rel="canonical" href="@canonicalUrl" />
|
|
}
|
|
<script>
|
|
(() => {
|
|
let savedTheme = null;
|
|
try {
|
|
savedTheme = localStorage.getItem("plotline.theme");
|
|
} catch {
|
|
savedTheme = null;
|
|
}
|
|
const theme = savedTheme === "dark" ? "dark" : "light";
|
|
document.documentElement.dataset.theme = theme;
|
|
document.documentElement.dataset.bsTheme = theme;
|
|
})();
|
|
</script>
|
|
<script type="importmap"></script>
|
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
|
<environment include="Production">
|
|
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
|
|
<link rel="stylesheet" href="~/css/plotline-theme.min.css" asp-append-version="true" />
|
|
</environment>
|
|
<environment exclude="Production">
|
|
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
|
<link rel="stylesheet" href="~/css/plotline-theme.css" asp-append-version="true" />
|
|
</environment>
|
|
|
|
<link rel="icon" href="~/favicon.ico" sizes="any" />
|
|
<link rel="icon" type="image/svg+xml" href="~/favicon.svg" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="~/favicon-32x32.png" />
|
|
<link rel="icon" type="image/png" sizes="16x16" href="~/favicon-16x16.png" />
|
|
<link rel="apple-touch-icon" sizes="180x180" href="~/apple-touch-icon.png" />
|
|
<link rel="manifest" href="~/site.webmanifest" />
|
|
<meta name="msapplication-config" content="/browserconfig.xml" />
|
|
<meta name="msapplication-TileColor" content="#1F2A44" />
|
|
<meta name="theme-color" content="#1F2A44" />
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm border-bottom plotline-nav mb-3">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand fw-semibold" asp-area="" asp-controller="Home" asp-action="Index">PlotDirector</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
|
aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
|
<ul class="navbar-nav flex-grow-1">
|
|
@if (User.Identity?.IsAuthenticated == true)
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="" asp-controller="Projects" asp-action="Index">Projects</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="" asp-controller="Writer" asp-action="Index">Writer Workspace</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="" asp-controller="Imports" asp-action="Index">Import</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/help">Help</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="" asp-controller="FeatureRequests" asp-action="Index">
|
|
Feature Requests
|
|
@if (featureRequestAttentionCount > 0)
|
|
{
|
|
<span class="badge text-bg-warning ms-1">@featureRequestAttentionCount</span>
|
|
}
|
|
</a>
|
|
</li>
|
|
@if (isAdmin)
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" asp-area="" asp-controller="Admin" asp-action="Index">
|
|
Admin
|
|
@if (adminFeatureRequestAttentionCount > 0)
|
|
{
|
|
<span class="badge text-bg-danger ms-1">@adminFeatureRequestAttentionCount</span>
|
|
}
|
|
</a>
|
|
</li>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/">Home</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/pricing">Pricing</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-dark" href="/help">Help</a>
|
|
</li>
|
|
}
|
|
</ul>
|
|
<div class="d-flex align-items-center gap-2 flex-wrap">
|
|
@if (User.Identity?.IsAuthenticated == true)
|
|
{
|
|
<div class="nav-item dropdown">
|
|
<button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" id="accountMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
|
|
Hello @User.Identity.Name
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="accountMenuButton">
|
|
<li><a class="dropdown-item" asp-controller="ManageAccount" asp-action="Index">Manage Account</a></li>
|
|
<li><a class="dropdown-item" asp-controller="ManageAccount" asp-action="Subscription">Billing / Subscription</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>
|
|
<form asp-controller="Account" asp-action="Logout" method="post" class="m-0">
|
|
<button class="dropdown-item" type="submit">Logout</button>
|
|
</form>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<a class="btn btn-outline-secondary btn-sm" asp-controller="Account" asp-action="Login">Login</a>
|
|
<a class="btn btn-outline-primary btn-sm" asp-controller="Account" asp-action="Register">Register</a>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
<div class="plotline-help-layout" data-help-layout>
|
|
<div class="plotline-help-main">
|
|
<div class="container-fluid plotline-shell @ViewData["ShellClass"]">
|
|
<main role="main" class="pb-3">
|
|
@if (TempData["ArchiveMessage"] is string archiveMessage)
|
|
{
|
|
<div class="alert alert-info">@archiveMessage</div>
|
|
}
|
|
@if (TempData["ArchiveError"] is string archiveError)
|
|
{
|
|
<div class="alert alert-warning">@archiveError</div>
|
|
}
|
|
@if (TempData["ImportMessage"] is string importMessage)
|
|
{
|
|
<div class="alert alert-info">@importMessage</div>
|
|
}
|
|
@RenderBody()
|
|
</main>
|
|
</div>
|
|
</div>
|
|
<div class="plotline-help-splitter" data-help-splitter role="separator" aria-orientation="vertical" aria-label="Resize help drawer"></div>
|
|
<aside class="plotline-help-drawer" data-help-drawer aria-label="Help drawer">
|
|
<div class="plotline-help-collapsed-strip" data-help-expand role="button" tabindex="0" aria-label="Expand help drawer">Help</div>
|
|
<div class="plotline-help-drawer-panel">
|
|
<header class="plotline-help-drawer-header">
|
|
<div>
|
|
<p class="eyebrow mb-0">Contextual help</p>
|
|
<strong data-help-drawer-heading>Help</strong>
|
|
</div>
|
|
<div class="btn-group btn-group-sm" role="group" aria-label="Help drawer controls">
|
|
<button class="btn btn-outline-secondary" type="button" data-help-pin aria-pressed="false">Pin</button>
|
|
<button class="btn btn-outline-secondary" type="button" data-help-collapse>Collapse</button>
|
|
<button class="btn btn-outline-secondary" type="button" data-help-close>Close</button>
|
|
</div>
|
|
</header>
|
|
<div class="plotline-help-drawer-content" data-help-content>
|
|
<p class="muted">Choose More from a help popover to open the full guide.</p>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
@if ((ViewData["ShellClass"] as string)?.Contains("marketing-shell", StringComparison.OrdinalIgnoreCase) == true)
|
|
{
|
|
<footer class="public-footer" aria-label="Public site footer">
|
|
<div class="marketing-container public-footer__inner">
|
|
<a class="public-footer__brand" asp-controller="Home" asp-action="Index">PlotDirector</a>
|
|
<nav class="public-footer__nav" aria-label="Footer navigation">
|
|
<a asp-controller="Home" asp-action="Index">Home</a>
|
|
<a asp-controller="Public" asp-action="About">About</a>
|
|
<a asp-controller="Pricing" asp-action="Index">Pricing</a>
|
|
<a asp-controller="Public" asp-action="Contact">Contact</a>
|
|
<a asp-controller="Public" asp-action="Privacy">Privacy Policy</a>
|
|
<a asp-controller="Public" asp-action="Terms">Terms of Service</a>
|
|
</nav>
|
|
</div>
|
|
</footer>
|
|
}
|
|
|
|
<div class="modal fade" id="plotlineConfirmModal" tabindex="-1" aria-labelledby="plotlineConfirmModalTitle" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content plotline-confirm-modal">
|
|
<div class="modal-header">
|
|
<h2 class="modal-title fs-5" id="plotlineConfirmModalTitle">Confirm action</h2>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cancel"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p id="plotlineConfirmModalMessage" class="mb-0"></p>
|
|
<div class="delete-confirm-field d-none mt-3" data-delete-confirm-field>
|
|
<label class="form-label" for="plotlineDeleteConfirmInput">Type DELETE to continue</label>
|
|
<input class="form-control" id="plotlineDeleteConfirmInput" autocomplete="off" data-delete-confirm-input />
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-danger" data-confirm-submit>Confirm</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
|
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.9/dist/chart.umd.min.js"></script>
|
|
<environment include="Production">
|
|
<script src="~/js/site.min.js" asp-append-version="true"></script>
|
|
</environment>
|
|
<environment exclude="Production">
|
|
<script src="~/js/site.js" asp-append-version="true"></script>
|
|
</environment>
|
|
|
|
@await RenderSectionAsync("Scripts", required: false)
|
|
</body>
|
|
</html>
|