From d0998f2f213602a817ab5447690eb18c28b439db Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Wed, 25 Jan 2017 08:42:11 +0000 Subject: [PATCH] Small changed to the sidebar --- Ombi.UI/Helpers/BaseUrlHelper.cs | 28 +++---- Ombi.UI/Views/Shared/Partial/_Sidebar.cshtml | 82 +++++++++++++------- 2 files changed, 70 insertions(+), 40 deletions(-) diff --git a/Ombi.UI/Helpers/BaseUrlHelper.cs b/Ombi.UI/Helpers/BaseUrlHelper.cs index 37482005c..99c37459e 100644 --- a/Ombi.UI/Helpers/BaseUrlHelper.cs +++ b/Ombi.UI/Helpers/BaseUrlHelper.cs @@ -199,7 +199,7 @@ namespace Ombi.UI.Helpers var assetLocation = GetBaseUrl(); var content = GetContentUrl(assetLocation); - + sb.AppendLine($""); return helper.Raw(sb.ToString()); @@ -226,9 +226,9 @@ namespace Ombi.UI.Helpers sb.Append($""); sb.Append($""); sb.Append($""); - sb.Append($""); - sb.Append($""); - sb.Append($""); + sb.Append($""); + sb.Append($""); + sb.Append($""); return helper.Raw(sb.ToString()); } @@ -290,17 +290,19 @@ namespace Ombi.UI.Helpers return helper.Raw(asset); } - public static IHtmlString GetSidebarUrl(this HtmlHelpers helper, NancyContext context, string url, string title, bool dropdown = false) + public static IHtmlString GetSidebarUrl(this HtmlHelpers helper, NancyContext context, string url, string title, string icon = null) { var content = GetLinkUrl(GetBaseUrl()); if (!string.IsNullOrEmpty(content)) { url = $"/{content}{url}"; } - var dropdownClass = dropdown ? "list-group-item-dropdown" : string.Empty; - var returnString = context.Request.Path == url - ? $"{title}" - : $"{title}"; + + + var iconHtml = string.IsNullOrEmpty(icon) ? "" : $""; + var returnString = context.Request.Path == url + ? $"{title} {iconHtml}" + : $"{title} {iconHtml}"; return helper.Raw(returnString); } @@ -312,8 +314,8 @@ namespace Ombi.UI.Helpers { url = $"/{content}{url}"; } - var returnString = context.Request.Path == url ? - $"
  • {title}
  • " + var returnString = context.Request.Path == url ? + $"
  • {title}
  • " : $"
  • {title}
  • "; return helper.Raw(returnString); @@ -327,8 +329,8 @@ namespace Ombi.UI.Helpers url = $"/{content}{url}"; } - var returnString = context.Request.Path == url - ? $"
  • {title} {extraHtml}
  • " + var returnString = context.Request.Path == url + ? $"
  • {title} {extraHtml}
  • " : $"
  • {title} {extraHtml}
  • "; return helper.Raw(returnString); diff --git a/Ombi.UI/Views/Shared/Partial/_Sidebar.cshtml b/Ombi.UI/Views/Shared/Partial/_Sidebar.cshtml index 0d4db7818..e62947012 100644 --- a/Ombi.UI/Views/Shared/Partial/_Sidebar.cshtml +++ b/Ombi.UI/Views/Shared/Partial/_Sidebar.cshtml @@ -2,34 +2,62 @@ @Html.LoadSettingsAssets()
    - @Html.GetSidebarUrl(Context, "/admin/about", "About") - @Html.GetSidebarUrl(Context, "/admin", "Ombi Configuration") - @Html.GetSidebarUrl(Context, "/admin/customization", "Customization") - @Html.GetSidebarUrl(Context, "/admin/landingpage", "Landing Page") - @Html.GetSidebarUrl(Context, "/admin/authentication", "Authentication") - @Html.GetSidebarUrl(Context, "/admin/usermanagementsettings", "User Management Settings") - @Html.GetSidebarUrl(Context, "/admin/plex", "Plex") - @Html.GetSidebarUrl(Context, "/admin/couchpotato", "CouchPotato") - @Html.GetSidebarUrl(Context, "/admin/watcher", "Watcher (beta)") - @Html.GetSidebarUrl(Context, "/admin/radarr", "Radarr (beta)") - @Html.GetSidebarUrl(Context, "/admin/sonarr", "Sonarr") - @Html.GetSidebarUrl(Context, "/admin/sickrage", "SickRage") - @Html.GetSidebarUrl(Context, "/admin/headphones", "Headphones (beta)") - @Html.GetSidebarUrl(Context, "/admin/newsletter", "Newsletter Settings") + @Html.GetSidebarUrl(Context, "/admin/about", "About", "glyphicon glyphicon-info-sign") + @Html.GetSidebarUrl(Context, "/admin", "Ombi Configuration", "glyphicon glyphicon-ok-sign") + @Html.GetSidebarUrl(Context, "/admin/customization", "Customization", "glyphicon glyphicon-tasks") + @Html.GetSidebarUrl(Context, "/admin/landingpage", "Landing Page", "glyphicon glyphicon-dashboard") + @Html.GetSidebarUrl(Context, "/admin/authentication", "Authentication", "glyphicon glyphicon-lock") + @Html.GetSidebarUrl(Context, "/admin/usermanagementsettings", "User Management Settings", "glyphicon glyphicon-user") + @Html.GetSidebarUrl(Context, "/admin/plex", "Plex", "glyphicon glyphicon-play-circle") + @Html.GetSidebarUrl(Context, "/admin/couchpotato", "CouchPotato", "glyphicon glyphicon-film") + @Html.GetSidebarUrl(Context, "/admin/watcher", "Watcher (beta)", "glyphicon glyphicon-film") + @Html.GetSidebarUrl(Context, "/admin/radarr", "Radarr (beta)", "glyphicon glyphicon-film") + @Html.GetSidebarUrl(Context, "/admin/sonarr", "Sonarr", "fa fa-tv") + @Html.GetSidebarUrl(Context, "/admin/sickrage", "SickRage", "fa fa-tv") + @Html.GetSidebarUrl(Context, "/admin/headphones", "Headphones (beta)", "glyphicon glyphicon-headphones") + @Html.GetSidebarUrl(Context, "/admin/newsletter", "Newsletter Settings", "fa fa-newspaper-o") + -
    \ No newline at end of file + + +
    + + \ No newline at end of file