Remove the datetime picker css from the main assets block and only load it on the pages it needs. #493

pull/511/head
tidusjar 8 years ago
parent 8969ebd299
commit d89b129afe

@ -84,7 +84,6 @@ namespace PlexRequests.UI.Helpers
$"<link rel=\"stylesheet\" href=\"{startUrl}/awesome-bootstrap-checkbox.css\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/base.css\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/Themes/{settings.ThemeName}\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/datepicker.min.css\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/tooltip/tooltipster.bundle.min.css\" type=\"text/css\"/>",
};
@ -99,7 +98,6 @@ namespace PlexRequests.UI.Helpers
$"<script src=\"{startUrl}/pace.min.js\"></script>",
$"<script src=\"{startUrl}/jquery.mixitup.js\"></script>",
$"<script src=\"{startUrl}/moment.min.js\"></script>",
$"<script src=\"{startUrl}/bootstrap-datetimepicker.min.js\"></script>",
$"<script src=\"{startUrl}/tooltip/tooltipster.bundle.min.js\"></script>"
};
@ -118,6 +116,16 @@ namespace PlexRequests.UI.Helpers
return helper.Raw(sb.ToString());
}
public static IHtmlString LoadDateTimePickerAsset(this HtmlHelpers helper)
{
var startUrl = GetBaseUrl();
var sb = new StringBuilder();
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{startUrl}/datepicker.min.css\" type=\"text/css\"/>");
sb.AppendLine($"<script src=\"{startUrl}/bootstrap-datetimepicker.min.js\"></script>");
return helper.Raw(sb.ToString());
}
public static IHtmlString LoadAngularAssets(this HtmlHelpers helper)
{
var sb = new StringBuilder();

@ -1,7 +1,7 @@
@using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar")
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.LandingPageSettings>
@Html.LoadDateTimePickerAsset()
<div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm">
<fieldset>

Loading…
Cancel
Save