376 lines
21 KiB
Plaintext
376 lines
21 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en" data-theme="light" data-bs-theme="light">
|
|
@using System.Security.Claims
|
|
@inject IConfiguration Configuration
|
|
@inject IFeatureRequestService FeatureRequestService
|
|
@inject ApplicationNavigation Navigation
|
|
@inject PlotLine.Data.IAppearanceRepository AppearancePreferences
|
|
@inject IOnboardingService OnboardingService
|
|
@inject IStoryIntelligenceGlobalProgressService StoryIntelligenceGlobalProgress
|
|
@{
|
|
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 showWordCompanionHeader = User.Identity?.IsAuthenticated == true && await OnboardingService.ShouldShowWordCompanionHeaderAsync();
|
|
var storyIntelligenceProgress = User.Identity?.IsAuthenticated == true && !isMarketingPage
|
|
? await StoryIntelligenceGlobalProgress.GetForCurrentUserAsync()
|
|
: new StoryIntelligenceGlobalProgressViewModel();
|
|
var appNavigation = User.Identity?.IsAuthenticated == true
|
|
? await Navigation.BuildAsync(ViewData.Model, ViewData["ProjectSection"] as string, Context.Request)
|
|
: new ApplicationNavigationViewModel();
|
|
appNavigation.IsAdmin = isAdmin;
|
|
appNavigation.ShowCompanionPresence = showWordCompanionHeader;
|
|
appNavigation.FeatureRequestAttentionCount = featureRequestAttentionCount;
|
|
appNavigation.AdminFeatureRequestAttentionCount = adminFeatureRequestAttentionCount;
|
|
var isApplication = User.Identity?.IsAuthenticated == true && !isMarketingPage;
|
|
var appearance = isApplication && userId.HasValue ? await AppearancePreferences.GetAsync(userId.Value) : new ApplicationAppearance();
|
|
ViewData["ApplicationAppearance"] = appearance;
|
|
var seoMetadata = ViewData["Seo"] as SeoMetadata;
|
|
var defaultTitle = PublicSeo.DisplayTitle(ViewData["Title"] as string);
|
|
var seoTitle = ViewData["SeoTitle"] is string seoTitleValue ? seoTitleValue : defaultTitle;
|
|
var hasSeoMetadata = seoMetadata is not null || ViewData["SeoDescription"] is string || ViewData["CanonicalUrl"] is string;
|
|
var seoDescription = ViewData["SeoDescription"] as string;
|
|
var canonicalUrl = ViewData["CanonicalUrl"] as string;
|
|
var seoKeywords = ViewData["SeoKeywords"] as string;
|
|
var structuredData = ViewData["StructuredData"] is IEnumerable<string> structuredDataValues ? structuredDataValues : Array.Empty<string>();
|
|
var ogTitle = ViewData["OgTitle"] as string ?? seoTitle;
|
|
var ogDescription = ViewData["OgDescription"] as string ?? seoDescription;
|
|
var ogType = ViewData["OgType"] as string ?? "website";
|
|
var ogImageUrl = ViewData["OgImage"] as string ?? "https://plotdirector.com/og-image.png";
|
|
var twitterCard = ViewData["TwitterCard"] as string ?? "summary_large_image";
|
|
}
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>@seoTitle</title>
|
|
@if (hasSeoMetadata)
|
|
{
|
|
@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="@ogTitle" />
|
|
@if (!string.IsNullOrWhiteSpace(ogDescription))
|
|
{
|
|
<meta property="og:description" content="@ogDescription" />
|
|
}
|
|
<meta property="og:type" content="@ogType" />
|
|
@if (!string.IsNullOrWhiteSpace(canonicalUrl))
|
|
{
|
|
<meta property="og:url" content="@canonicalUrl" />
|
|
}
|
|
<meta property="og:image" content="@ogImageUrl" />
|
|
<meta name="twitter:card" content="@twitterCard" />
|
|
<meta name="twitter:title" content="@ogTitle" />
|
|
@if (!string.IsNullOrWhiteSpace(ogDescription))
|
|
{
|
|
<meta name="twitter:description" content="@ogDescription" />
|
|
}
|
|
<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" />
|
|
}
|
|
@if (isApplication)
|
|
{
|
|
<script>
|
|
(() => {
|
|
const saved = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(appearance.ThemeKey));
|
|
let legacy = null;
|
|
try { legacy = localStorage.getItem('plotline.theme'); } catch { }
|
|
const theme = saved || (legacy === 'dark' ? 'warm-dark' : 'warm-light');
|
|
document.documentElement.dataset.appTheme = theme;
|
|
document.documentElement.dataset.theme = theme.endsWith('-dark') ? 'dark' : 'light';
|
|
document.documentElement.dataset.bsTheme = document.documentElement.dataset.theme;
|
|
window.plotdirectorAppearance = { theme, migrate: !saved, collapsed: @(appearance.RibbonCollapsed ? "true" : "false") };
|
|
})();
|
|
</script>
|
|
}
|
|
<script>
|
|
(() => {
|
|
if (document.documentElement.dataset.appTheme) return;
|
|
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="stylesheet" href="~/css/onboarding.css" asp-append-version="true" />
|
|
<link rel="stylesheet" href="~/css/story-intelligence-global-progress.css" asp-append-version="true" />
|
|
<link rel="stylesheet" href="~/css/plot-line-workspace.css" asp-append-version="true" />
|
|
|
|
<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" />
|
|
@if (isApplication || string.Equals(ViewContext.RouteData.Values["controller"]?.ToString(), "Account", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
<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" />
|
|
<link rel="stylesheet" href="~/css/application-navigation.css" asp-append-version="true" />
|
|
@if (isApplication)
|
|
{
|
|
<link rel="stylesheet" href="~/css/application-shell.css" asp-append-version="true" />
|
|
<script src="~/js/application-pwa.js" asp-append-version="true" defer></script>
|
|
}
|
|
</head>
|
|
<body class="@(User.Identity?.IsAuthenticated == true && !isMarketingPage ? "app-layout" : null)">
|
|
<header class="@(isApplication ? "pd-application-header" : null)">
|
|
@if (User.Identity?.IsAuthenticated == true)
|
|
{
|
|
@if (isApplication)
|
|
{
|
|
<partial name="_ApplicationShell" model="appNavigation" />
|
|
@await Component.InvokeAsync("EntitlementBanner")
|
|
}
|
|
else
|
|
{
|
|
<partial name="_ApplicationNavigation" model="appNavigation" />
|
|
}
|
|
}
|
|
else
|
|
{
|
|
<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-route="@PublicRouteNames.Home">PlotDirector</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#publicMenu" aria-controls="publicMenu" 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" id="publicMenu">
|
|
<ul class="navbar-nav flex-grow-1">
|
|
<li class="nav-item"><a class="nav-link text-dark" asp-route="@PublicRouteNames.Home">Home</a></li>
|
|
<li class="nav-item"><a class="nav-link text-dark" asp-route="@PublicRouteNames.Features">Features</a></li>
|
|
<li class="nav-item"><a class="nav-link text-dark" asp-route="@PublicRouteNames.Pricing">Pricing</a></li>
|
|
<li class="nav-item"><a class="nav-link text-dark" asp-route="@PublicRouteNames.Help">Help</a></li>
|
|
</ul>
|
|
<div class="d-flex align-items-center gap-2 flex-wrap">
|
|
<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>
|
|
@if (User.Identity?.IsAuthenticated == true)
|
|
{
|
|
var primaryBook = storyIntelligenceProgress.Books.FirstOrDefault(book => book.HasActiveRuns);
|
|
var progressUpdatedUtc = storyIntelligenceProgress.UpdatedUtc?.ToUniversalTime().ToString("O", System.Globalization.CultureInfo.InvariantCulture);
|
|
<div class="story-intelligence-global-strip"
|
|
data-story-intelligence-global-strip
|
|
data-progress-percent="@storyIntelligenceProgress.ProgressPercent"
|
|
data-total-expected-scenes="@storyIntelligenceProgress.TotalExpectedScenes"
|
|
data-completed-scenes="@storyIntelligenceProgress.CompletedScenes"
|
|
data-failed-scenes="@storyIntelligenceProgress.FailedScenes"
|
|
data-active-books="@storyIntelligenceProgress.ActiveBookCount"
|
|
data-story-intelligence-updated-utc="@progressUpdatedUtc"
|
|
data-book-id="@primaryBook?.BookID"
|
|
data-project-id="@primaryBook?.ProjectID"
|
|
data-story-intelligence-has-active-work="@storyIntelligenceProgress.HasActiveWork.ToString().ToLowerInvariant()"
|
|
role="status"
|
|
aria-live="polite"
|
|
hidden="@(!storyIntelligenceProgress.HasActiveWork)">
|
|
<div class="story-intelligence-global-strip__inner">
|
|
<div class="story-intelligence-global-strip__copy">
|
|
<span class="story-intelligence-global-strip__dot" aria-hidden="true"></span>
|
|
<strong data-story-intelligence-global-title>@storyIntelligenceProgress.SummaryText</strong>
|
|
<span data-story-intelligence-global-detail>
|
|
@storyIntelligenceProgress.CompletedScenes.ToString("N0") of @storyIntelligenceProgress.TotalExpectedScenes.ToString("N0") scenes analysed
|
|
@if (storyIntelligenceProgress.FailedScenes > 0)
|
|
{
|
|
<text> · @storyIntelligenceProgress.FailedScenes.ToString("N0") failed</text>
|
|
}
|
|
@if (primaryBook is not null)
|
|
{
|
|
<text> · @primaryBook.EstimatedRemaining remaining</text>
|
|
}
|
|
</span>
|
|
</div>
|
|
<div class="story-intelligence-global-strip__meter" aria-hidden="true">
|
|
<span data-story-intelligence-global-bar style="width: @storyIntelligenceProgress.ProgressPercent%"></span>
|
|
</div>
|
|
@if (primaryBook?.BookID is int progressBookId)
|
|
{
|
|
<a class="btn btn-outline-secondary btn-sm" asp-controller="Books" asp-action="Details" asp-route-id="@progressBookId">Book</a>
|
|
}
|
|
</div>
|
|
<div hidden aria-hidden="true" data-story-intelligence-global-runs>
|
|
@foreach (var book in storyIntelligenceProgress.Books)
|
|
{
|
|
<span data-story-intelligence-global-book
|
|
data-project-id="@book.ProjectID"
|
|
data-book-id="@book.BookID"
|
|
data-book-title="@book.BookTitle"
|
|
data-status="@book.Status"
|
|
data-total-expected-scenes="@book.TotalExpectedScenes"
|
|
data-completed-scenes="@book.CompletedScenes"
|
|
data-failed-scenes="@book.FailedScenes"
|
|
data-active-scenes="@book.ActiveScenes"
|
|
data-total-duration-ms="@book.TotalDurationMs"
|
|
data-updated-utc="@book.UpdatedUtc.ToUniversalTime().ToString("O", System.Globalization.CultureInfo.InvariantCulture)"></span>
|
|
@foreach (var run in book.Runs)
|
|
{
|
|
<span data-story-intelligence-global-run
|
|
data-run-id="@run.RunID"
|
|
data-project-id="@run.ProjectID"
|
|
data-book-id="@run.BookID"
|
|
data-book-title="@run.BookTitle"
|
|
data-status="@run.Status"
|
|
data-total-detected-scenes="@run.TotalDetectedScenes"
|
|
data-completed-scenes="@run.CompletedScenes"
|
|
data-failed-scenes="@run.FailedScenes"
|
|
data-total-duration-ms="@run.TotalDurationMs"
|
|
data-updated-utc="@run.UpdatedUtc.ToUniversalTime().ToString("O", System.Globalization.CultureInfo.InvariantCulture)"></span>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
<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-route="@PublicRouteNames.Home">PlotDirector</a>
|
|
<nav class="public-footer__nav" aria-label="Footer navigation">
|
|
<a asp-route="@PublicRouteNames.Home">Home</a>
|
|
<a asp-route="@PublicRouteNames.Features">Features</a>
|
|
<a asp-route="@PublicRouteNames.About">About</a>
|
|
<a asp-route="@PublicRouteNames.Pricing">Pricing</a>
|
|
<a asp-route="@PublicRouteNames.Help">Help</a>
|
|
<a asp-route="@PublicRouteNames.Contact">Contact</a>
|
|
<a asp-route="@PublicRouteNames.Privacy">Privacy Policy</a>
|
|
<a asp-route="@PublicRouteNames.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>
|
|
@if (User.Identity?.IsAuthenticated == true)
|
|
{
|
|
<script src="https://cdn.jsdelivr.net/npm/@@microsoft/signalr@8.0.7/dist/browser/signalr.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>
|
|
@if (User.Identity?.IsAuthenticated == true)
|
|
{
|
|
<script src="~/js/application-navigation.js" asp-append-version="true"></script>
|
|
@if (!isMarketingPage)
|
|
{
|
|
<script src="~/js/application-toolbar.js" asp-append-version="true"></script>
|
|
<script src="~/js/application-shell.js" asp-append-version="true"></script>
|
|
}
|
|
<script src="~/js/word-companion-presence.js" asp-append-version="true"></script>
|
|
<script src="~/js/story-intelligence-global-progress.js" asp-append-version="true"></script>
|
|
}
|
|
|
|
@await RenderSectionAsync("Scripts", required: false)
|
|
</body>
|
|
</html>
|