From 83bb86de06162af9f10c3016515c18892bfd07b1 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Mon, 13 Mar 2017 09:05:33 +0000 Subject: [PATCH] Tooltips --- Ombi.UI/Helpers/BaseUrlHelper.cs | 8 ++++ Ombi.UI/Helpers/CustomHtmlHelper.cs | 5 +- Ombi.UI/Views/Admin/Authentication.cshtml | 46 +++++-------------- Ombi.UI/Views/Admin/Emby.cshtml | 4 +- Ombi.UI/Views/Admin/NewsletterSettings.cshtml | 19 ++++---- Ombi.UI/Views/Admin/Settings.cshtml | 37 ++++----------- .../Views/Customization/Customization.cshtml | 8 +++- Ombi.UI/Views/Shared/Partial/_Sidebar.cshtml | 4 ++ Ombi.UI/Views/SystemStatus/Status.cshtml | 17 ++++--- 9 files changed, 61 insertions(+), 87 deletions(-) diff --git a/Ombi.UI/Helpers/BaseUrlHelper.cs b/Ombi.UI/Helpers/BaseUrlHelper.cs index 5badfad5b..232cab766 100644 --- a/Ombi.UI/Helpers/BaseUrlHelper.cs +++ b/Ombi.UI/Helpers/BaseUrlHelper.cs @@ -363,6 +363,14 @@ namespace Ombi.UI.Helpers return helper.Raw(returnString); } + public static IHtmlString ToolTip(this HtmlHelpers helper, string tooltipText) + { + //< span class="customTooltip" title="It also requires users to have the Newsletter feature"> + return + helper.Raw( + $""); + } + public static IHtmlString GetBaseUrl(this HtmlHelpers helper) { return helper.Raw(GetBaseUrl()); diff --git a/Ombi.UI/Helpers/CustomHtmlHelper.cs b/Ombi.UI/Helpers/CustomHtmlHelper.cs index 1f76cd371..14f401169 100644 --- a/Ombi.UI/Helpers/CustomHtmlHelper.cs +++ b/Ombi.UI/Helpers/CustomHtmlHelper.cs @@ -41,13 +41,14 @@ namespace Ombi.UI.Helpers return helper.Raw(htmlString); } - public static IHtmlString Checkbox(this HtmlHelpers helper, bool check, string name, string display) + public static IHtmlString Checkbox(this HtmlHelpers helper, bool check, string name, string display, string tooltipText = null) { var sb = new StringBuilder(); sb.AppendLine("
"); sb.AppendLine("
"); - sb.AppendFormat("", name, display, check ? "checked=\"checked\"" : string.Empty); + sb.AppendFormat("", name, display, check ? "checked=\"checked\"" : string.Empty, + string.IsNullOrEmpty(tooltipText) ? string.Empty : helper.ToolTip(tooltipText).ToHtmlString()); sb.AppendLine("
"); sb.AppendLine("
"); return helper.Raw(sb.ToString()); diff --git a/Ombi.UI/Views/Admin/Authentication.cshtml b/Ombi.UI/Views/Admin/Authentication.cshtml index 5c0a2dda2..c4654c56b 100644 --- a/Ombi.UI/Views/Admin/Authentication.cshtml +++ b/Ombi.UI/Views/Admin/Authentication.cshtml @@ -1,4 +1,5 @@ @using Ombi.UI.Helpers +@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase @Html.Partial("Shared/Partial/_Sidebar") @{ @@ -17,40 +18,11 @@
Authentication Settings - -
-
- - @if (Model.UserAuthentication) - { - - - } - else - { - - - } - -
-
- -
-
- - @if (Model.UsePassword) - { - - - } - else - { - - - } -
-
+ @Html.Checkbox(Model.UserAuthentication, "UserAuthentication", "Enable User Authentication", "If enabled we will check the login name against a user in your local users list or Plex/Emby users.") + + + @Html.Checkbox(Model.UsePassword, "UsePassword", "Require users to login with their passwords", "If enabled, users must provide a valid password to log into Ombi")
@@ -59,7 +31,9 @@
-

A comma separated list of users that you do not want to login.

+

A comma separated list of users that you do not want to login. + @Html.ToolTip("This is a 'blacklist', if you have users that you do not want to log in, enter them here!")

+
@@ -83,7 +57,9 @@ $(function () { var base = '@Html.GetBaseUrl()'; - + $('.customTooltip').tooltipster({ + contentCloning: true + }); changeDisabledStatus($('#UsePassword'), @Model.UserAuthentication.ToString().ToLower(), $('#passLabel')); diff --git a/Ombi.UI/Views/Admin/Emby.cshtml b/Ombi.UI/Views/Admin/Emby.cshtml index 7ebceaf14..3cdaf33a1 100644 --- a/Ombi.UI/Views/Admin/Emby.cshtml +++ b/Ombi.UI/Views/Admin/Emby.cshtml @@ -47,7 +47,8 @@
- @Html.Checkbox(Model.EnableEpisodeSearching, "EnableEpisodeSearching", "Enable Episode Searching") + @Html.Checkbox(Model.EnableEpisodeSearching, "EnableEpisodeSearching", "Enable Episode Searching") + @Html.ToolTip("This will allow Ombi to search through all of the episodes stored on Emby")
@@ -81,6 +82,7 @@