From af827c62414eb98a0a6772cd771066a63674b2c3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 19 Jan 2015 00:41:56 -0500 Subject: [PATCH] fixes #987 - Support custom css --- MediaBrowser.Api/BrandingService.cs | 14 +++++++++++++- MediaBrowser.Model/Branding/BrandingOptions.cs | 5 +++++ .../Localization/Server/server.json | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/BrandingService.cs b/MediaBrowser.Api/BrandingService.cs index 4b49b411a8..ac491a997a 100644 --- a/MediaBrowser.Api/BrandingService.cs +++ b/MediaBrowser.Api/BrandingService.cs @@ -8,7 +8,12 @@ namespace MediaBrowser.Api public class GetBrandingOptions : IReturn { } - + + [Route("/Branding/Css", "GET", Summary = "Gets custom css")] + public class GetBrandingCss + { + } + public class BrandingService : BaseApiService { private readonly IConfigurationManager _config; @@ -24,5 +29,12 @@ namespace MediaBrowser.Api return ToOptimizedResult(result); } + + public object Get(GetBrandingCss request) + { + var result = _config.GetConfiguration("branding"); + + return ResultFactory.GetResult(result.CustomCss, "text/css"); + } } } diff --git a/MediaBrowser.Model/Branding/BrandingOptions.cs b/MediaBrowser.Model/Branding/BrandingOptions.cs index 737cb5c48f..3b207d345c 100644 --- a/MediaBrowser.Model/Branding/BrandingOptions.cs +++ b/MediaBrowser.Model/Branding/BrandingOptions.cs @@ -8,5 +8,10 @@ namespace MediaBrowser.Model.Branding /// /// The login disclaimer. public string LoginDisclaimer { get; set; } + /// + /// Gets or sets the custom CSS. + /// + /// The custom CSS. + public string CustomCss { get; set; } } } diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 0151c0f7d1..83da44cc69 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -515,6 +515,8 @@ "NewCollectionNameExample": "Example: Star Wars Collection", "OptionSearchForInternetMetadata": "Search the internet for artwork and metadata", "ButtonCreate": "Create", + "LabelCustomCss": "Custom css:", + "LabelCustomCssHelp": "Apply your own custom css to the web interface.", "LabelLocalHttpServerPortNumber": "Local http port number:", "LabelLocalHttpServerPortNumberHelp": "The tcp port number that Media Browser's http server should bind to.", "LabelPublicHttpPort": "Public http port number:",