btcpayserver/BTCPayServer/Views/AppsPublic/ViewCrowdfund.cshtml
Andrew Camilleri 14e4d2d675
Make CSSThemeManager really only focus on theme (#2457)
* Make Settings Repository cache in memory

* Make use of SettingsRepo directly instead of CssThemeManager

* Completely remove CssThemeManager
2021-07-27 21:08:54 +09:00

68 lines
2.4 KiB
Text

@addTagHelper *, BundlerMinifier.TagHelpers
@inject ISettingsRepository _settingsRepository
@using BTCPayServer.Abstractions.Contracts
@model BTCPayServer.Models.AppViewModels.ViewCrowdfundViewModel
@{
ViewData["Title"] = Model.Title;
Layout = null;
var theme = await _settingsRepository.GetTheme();
}
<!DOCTYPE html>
<html class="h-100">
<head>
<title>@Model.Title</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="@Context.Request.GetRelativePathOrAbsolute(theme.BootstrapCssUri)" rel="stylesheet" asp-append-version="true"/>
<link href="@Context.Request.GetRelativePathOrAbsolute(theme.ThemeCssUri)" rel="stylesheet" asp-append-version="true"/>
@if (Model.CustomCSSLink != null)
{
<link href="@Model.CustomCSSLink" rel="stylesheet" />
}
@if (!Context.Request.Query.ContainsKey("simple"))
{
<script>
var srvModel = @Safe.Json(Model);
</script>
<bundle name="wwwroot/bundles/crowdfund-bundle-1.min.js" asp-append-version="true"></bundle>
<bundle name="wwwroot/bundles/crowdfund-bundle-2.min.js" asp-append-version="true"></bundle>
@*We need to make sure btcpay.js is not bundled, else it will not work if there is a RootPath*@
<script src="~/modal/btcpay.js" asp-append-version="true"></script>
}
<bundle name="wwwroot/bundles/crowdfund-bundle.min.css" asp-append-version="true"></bundle>
@if (!string.IsNullOrEmpty(Model.EmbeddedCSS))
{
@Safe.Raw($"<style>{Model.EmbeddedCSS}</style>");
}
</head>
<body>
@if (Context.Request.Query.ContainsKey("simple"))
{
<partial name="/Views/AppsPublic/Crowdfund/MinimalCrowdfund.cshtml" model="Model" />
}
else
{
<noscript>
<partial name="/Views/AppsPublic/Crowdfund/MinimalCrowdfund.cshtml" model="Model" />
<style>
/* Hide the below canvas or else user will be staring "Loading..." text when JS is disabled */
#fireworks,
#app {
display:none;
}
</style>
</noscript>
if (Model.AnimationsEnabled)
{
<canvas id="fireworks"></canvas>
}
<partial name="/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml" model="Model" />
}
</body>
</html>