Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
<title id="page_title">@ViewData["Title"] - SwarmUI - @Program.ServerSettings.UserAuthorization.InstanceTitle</title>
@{
string themeId = "modern_dark";
string pageThemeOverride = ViewContext.HttpContext.Request.Query["theme"].ToString();
if (!string.IsNullOrEmpty(pageThemeOverride) && Program.Web.RegisteredThemes.ContainsKey(pageThemeOverride)) {
themeId = pageThemeOverride;
}
// TODO: Identify user by auth header and use their settings to determine theme
if (ViewContext.HttpContext.Request.Cookies.TryGetValue("sui_theme_id", out string themeCookie) && Program.Web.RegisteredThemes.ContainsKey(themeCookie)) {
else if (ViewContext.HttpContext.Request.Cookies.TryGetValue("sui_theme_id", out string themeCookie) && Program.Web.RegisteredThemes.ContainsKey(themeCookie)) {
themeId = themeCookie;
}
WebServer.ThemeData theme = Program.Web.RegisteredThemes[themeId];
Expand Down
7 changes: 0 additions & 7 deletions src/Pages/ThemePreview.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
@section Header {
<link rel="stylesheet" href="css/[email protected]" />
<link rel="stylesheet" href="css/[email protected]" />
@{
var themeId = Request.Query["theme"].ToString();
if (!string.IsNullOrEmpty(themeId))
{
<link rel="stylesheet" href="css/themes/@(themeId)[email protected]" />
}
}
}
<div class="theme_preview-content">
<div class="theme_preview-item">
Expand Down