From f947d852f096a0c35cbbf3b7de711e8c143883e3 Mon Sep 17 00:00:00 2001 From: Maarten Heebink Date: Tue, 4 Jan 2022 00:34:27 +0100 Subject: [PATCH 1/4] Added custom favicon --- .../Settings/Models/CustomizationSettings.cs | 1 + src/Ombi/ClientApp/src/app/app.component.ts | 13 +- .../ClientApp/src/app/interfaces/ISettings.ts | 3 +- .../customization.component.html | 137 ++++++++++-------- src/Ombi/ClientApp/src/index.html | 4 +- src/Ombi/Views/Shared/_Layout.cshtml | 6 + 6 files changed, 94 insertions(+), 70 deletions(-) diff --git a/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs b/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs index 1f2155331..c8406493f 100644 --- a/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs +++ b/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs @@ -12,6 +12,7 @@ public bool RecentlyAddedPage { get; set; } public bool UseCustomPage { get; set; } public bool HideAvailableFromDiscover { get; set; } + public string Favicon { get; set; } public string AddToUrl(string part) { diff --git a/src/Ombi/ClientApp/src/app/app.component.ts b/src/Ombi/ClientApp/src/app/app.component.ts index cbfcf0af0..2c543606b 100644 --- a/src/Ombi/ClientApp/src/app/app.component.ts +++ b/src/Ombi/ClientApp/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { OverlayContainer } from '@angular/cdk/overlay'; +import { OverlayContainer } from '@angular/cdk/overlay'; import { Component, OnInit, HostBinding, Inject } from "@angular/core"; import { NavigationStart, Router } from "@angular/router"; @@ -34,6 +34,7 @@ export class AppComponent implements OnInit { public userName: string; public userEmail: string; public accessToken: string; + public favicon: string; private hubConnected: boolean; @@ -88,9 +89,15 @@ export class AppComponent implements OnInit { this.customizationFacade.settings$().subscribe(x => { this.customizationSettings = x; if (this.customizationSettings && this.customizationSettings.applicationName) { - this.applicationName = this.customizationSettings.applicationName; - this.document.getElementsByTagName('title')[0].innerText = this.applicationName; + this.applicationName = this.customizationSettings.applicationName; + this.document.getElementsByTagName('title')[0].innerText = this.applicationName; } + + if (this.customizationSettings && this.customizationSettings.favicon) { + this.favicon = this.customizationSettings.favicon; + this.document.getElementById('favicon').setAttribute('href', this.favicon); + } + if (this.customizationSettings && this.customizationSettings.customCss) { var dom = this.document.getElementsByTagName('head')[0]; var css = document.createElement("style"); diff --git a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts index c5dcaffc6..c7990215f 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts @@ -1,4 +1,4 @@ -import { ISettings } from "./ICommon"; +import { ISettings } from "./ICommon"; import { RequestLimitType } from "."; export interface IExternalSettings extends ISettings { @@ -193,6 +193,7 @@ export interface ICustomizationSettings extends ISettings { recentlyAddedPage: boolean; useCustomPage: boolean; hideAvailableFromDiscover: boolean; + favicon: string; } export interface IJobSettings { diff --git a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html index b2168bb72..dd079524f 100644 --- a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html @@ -5,71 +5,80 @@ Customization
-
- - Application Name - - -
-
- The application url should be your Externally Accessible URL (the address you use to reach Ombi from outside your system). For example, 'https://example.com/requests'.
Please ensure this field is correct as it drives a lot of functionality, including the QR code for the - mobile app, and the way email notifications are sent. -
- - Application URL - - -
-
- - Custom Logo - - -
-
-
- -
- -
-
-
-
- - Hide Available Content On The Discover Page - -
-
- - Enable Custom Donation Link - -
-
- - Custom Donation URL - - -
-
- - Custom Donation Message - - -
-
- - Enable Custom Page - -
-
- - Custom CSS - - -
-
- +
+ + Application Name + + +
+
+ The application url should be your Externally Accessible URL (the address you use to reach Ombi from outside your system). For example, 'https://example.com/requests'.
Please ensure this field is correct as it drives a lot of functionality, including the QR code for the + mobile app, and the way email notifications are sent. +
+ + Application URL + + +
+
+ + Custom Logo + + +
+ + The favicon url should be an externally accesible URL. + +
+ + Custom Favicon + + +
+
+
+ +
+ +
+
+
+ + Hide Available Content On The Discover Page + +
+
+ + Enable Custom Donation Link + +
+
+ + Custom Donation URL + + +
+
+ + Custom Donation Message + + +
+
+ + Enable Custom Page + +
+
+ + Custom CSS + + +
+
+ +
diff --git a/src/Ombi/ClientApp/src/index.html b/src/Ombi/ClientApp/src/index.html index e9c1ed486..4f7786647 100644 --- a/src/Ombi/ClientApp/src/index.html +++ b/src/Ombi/ClientApp/src/index.html @@ -1,12 +1,12 @@ - + - + diff --git a/src/Ombi/Views/Shared/_Layout.cshtml b/src/Ombi/Views/Shared/_Layout.cshtml index 5cee9c275..3cd9ccc56 100644 --- a/src/Ombi/Views/Shared/_Layout.cshtml +++ b/src/Ombi/Views/Shared/_Layout.cshtml @@ -23,6 +23,12 @@ appName = "Ombi"; } + var favicon = customization.Favicon; + if (string.IsNullOrEmpty(favicon)) + { + favicon = "images/favicon/favicon.ico"; + } + } From 6e91716edf375cf11c03786cdb16aba97f9dc42c Mon Sep 17 00:00:00 2001 From: Maarten Heebink Date: Tue, 4 Jan 2022 00:35:01 +0100 Subject: [PATCH 2/4] Added extra info --- .../src/app/settings/customization/customization.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html index dd079524f..283dc6a8f 100644 --- a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html @@ -27,7 +27,7 @@
- The favicon url should be an externally accesible URL. + The favicon url should be an externally accesible URL. Leave blank for default.
From ccc277aca186789e2fa1f041a803eabf9727b76d Mon Sep 17 00:00:00 2001 From: maartenheebink Date: Tue, 4 Jan 2022 11:44:07 +0100 Subject: [PATCH 3/4] Update customization.component.html --- .../customization.component.html | 142 +++++++++--------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html index 283dc6a8f..32b4058ef 100644 --- a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html @@ -5,80 +5,80 @@ Customization
-
- - Application Name - - -
-
- The application url should be your Externally Accessible URL (the address you use to reach Ombi from outside your system). For example, 'https://example.com/requests'.
Please ensure this field is correct as it drives a lot of functionality, including the QR code for the - mobile app, and the way email notifications are sent. +
+ + Application Name + + +
+
+ The application url should be your Externally Accessible URL (the address you use to reach Ombi from outside your system). For example, 'https://example.com/requests'.
Please ensure this field is correct as it drives a lot of functionality, including the QR code for the + mobile app, and the way email notifications are sent. +
+ + Application URL + + +
+
+ + Custom Logo + + +
+ + The favicon url should be an externally accesible URL. Leave blank for default. - - Application URL - - -
-
- - Custom Logo - - -
- - The favicon url should be an externally accesible URL. Leave blank for default. - -
- - Custom Favicon - - -
-
-
- -
- +
+ + Custom Favicon + + +
+
+
+ +
+ +
-
-
- - Hide Available Content On The Discover Page - -
-
- - Enable Custom Donation Link - -
-
- - Custom Donation URL - - -
-
- - Custom Donation Message - - -
-
- - Enable Custom Page - -
-
- - Custom CSS - - -
-
- -
+
+ + Hide Available Content On The Discover Page + +
+
+ + Enable Custom Donation Link + +
+
+ + Custom Donation URL + + +
+
+ + Custom Donation Message + + +
+
+ + Enable Custom Page + +
+
+ + Custom CSS + + +
+
+ +
From 5dde21b9bcf7ae0931f4e8033935406895365fb5 Mon Sep 17 00:00:00 2001 From: maartenheebink Date: Tue, 4 Jan 2022 11:47:52 +0100 Subject: [PATCH 4/4] Update customization.component.html Indentation fixes --- .../customization.component.html | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html index 32b4058ef..4c8bcecb6 100644 --- a/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/src/app/settings/customization/customization.component.html @@ -6,78 +6,78 @@
- - Application Name - - + + Application Name + +
- The application url should be your Externally Accessible URL (the address you use to reach Ombi from outside your system). For example, 'https://example.com/requests'.
Please ensure this field is correct as it drives a lot of functionality, including the QR code for the - mobile app, and the way email notifications are sent. -
- - Application URL - - + The application url should be your Externally Accessible URL (the address you use to reach Ombi from outside your system). For example, 'https://example.com/requests'.
Please ensure this field is correct as it drives a lot of functionality, including the QR code for the + mobile app, and the way email notifications are sent. +
+ + Application URL + +
- - Custom Logo - - + + Custom Logo + + +
+
+
+ +
+ +
+
- The favicon url should be an externally accesible URL. Leave blank for default. + The favicon url should be an externally accesible URL. Leave blank for default.
- - Custom Favicon - - + + Custom Favicon + +
-
- -
- -
-
+ + Hide Available Content On The Discover Page +
- - Hide Available Content On The Discover Page - + + Enable Custom Donation Link +
- - Enable Custom Donation Link - + + Custom Donation URL + +
- - Custom Donation URL - - + + Custom Donation Message + +
- - Custom Donation Message - - + + Enable Custom Page +
- - Enable Custom Page - -
-
- - Custom CSS - - + + Custom CSS + +
- +