mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
Implimented a theme changer, waiting for the Plex theme
This commit is contained in:
parent
7c41f448a8
commit
c41944c933
7 changed files with 7078 additions and 7008 deletions
|
@ -52,8 +52,13 @@ namespace PlexRequests.UI.Helpers
|
|||
var assetLocation = GetBaseUrl();
|
||||
|
||||
var content = GetContentUrl(assetLocation);
|
||||
var settings = GetSettings();
|
||||
if (string.IsNullOrEmpty(settings.ThemeName))
|
||||
{
|
||||
settings.ThemeName = Themes.OriginalTheme;
|
||||
}
|
||||
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/bootstrap.css\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/Themes/{settings.ThemeName}\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/custom.min.css\" type=\"text/css\" />");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/font-awesome.css\" type=\"text/css\"/>");
|
||||
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{content}/Content/pace.min.css\" type=\"text/css\"/>");
|
||||
|
@ -156,11 +161,15 @@ namespace PlexRequests.UI.Helpers
|
|||
|
||||
private static string GetBaseUrl()
|
||||
{
|
||||
var returnValue = Cache.GetOrSet(CacheKeys.GetBaseUrl, () =>
|
||||
return GetSettings().BaseUrl;
|
||||
}
|
||||
|
||||
private static PlexRequestSettings GetSettings()
|
||||
{
|
||||
var returnValue = Cache.GetOrSet(CacheKeys.GetPlexRequestSettings, () =>
|
||||
{
|
||||
var settings = Locator.Resolve<ISettingsService<PlexRequestSettings>>().GetSettings();
|
||||
var assetLocation = settings.BaseUrl;
|
||||
return assetLocation;
|
||||
var settings = Locator.Resolve<ISettingsService<PlexRequestSettings>>().GetSettings();
|
||||
return settings;
|
||||
});
|
||||
return returnValue;
|
||||
}
|
||||
|
|
34
PlexRequests.UI/Helpers/Themes.cs
Normal file
34
PlexRequests.UI/Helpers/Themes.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
#region Copyright
|
||||
// /************************************************************************
|
||||
// Copyright (c) 2016 Jamie Rees
|
||||
// File: Themes.cs
|
||||
// Created By: Jamie Rees
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
namespace PlexRequests.UI.Helpers
|
||||
{
|
||||
public static class Themes
|
||||
{
|
||||
public const string OriginalTheme = "OriginalBootstrap.css";
|
||||
public const string PlexTheme = "PlexBootstrap.css";
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue