mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Remove AJAX tabs for settings pages
This commit is contained in:
parent
5f217f5720
commit
2e74a6ff05
15 changed files with 264 additions and 160 deletions
|
@ -7,7 +7,7 @@ namespace NzbDrone.Web.Helpers
|
|||
{
|
||||
public static class IsCurrentActionHelper
|
||||
{
|
||||
private static bool IsCurrentController(HtmlHelper helper, string actionName, string controllerName)
|
||||
private static bool IsCurrentController(HtmlHelper helper, string controllerName)
|
||||
{
|
||||
var currentControllerName = (string) helper.ViewContext.RouteData.Values["controller"];
|
||||
|
||||
|
@ -17,12 +17,23 @@ namespace NzbDrone.Web.Helpers
|
|||
return false;
|
||||
}
|
||||
|
||||
public static string CurrentActionLink(this HtmlHelper helper, string text, string actionName,
|
||||
string controllerName)
|
||||
private static bool IsCurrentAction(HtmlHelper helper, string actionName, string controllerName)
|
||||
{
|
||||
var currentControllerName = (string)helper.ViewContext.RouteData.Values["controller"];
|
||||
var currentActionName = (string)helper.ViewContext.RouteData.Values["action"];
|
||||
|
||||
if (currentControllerName.Equals(controllerName, StringComparison.CurrentCultureIgnoreCase) &&
|
||||
currentActionName.Equals(actionName, StringComparison.CurrentCultureIgnoreCase))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string CurrentControllerLink(this HtmlHelper helper, string text, string actionName, string controllerName)
|
||||
{
|
||||
string result;
|
||||
|
||||
if (IsCurrentController(helper, actionName, controllerName))
|
||||
if (IsCurrentController(helper, controllerName))
|
||||
{
|
||||
result = "<li class='current_page_item'>";
|
||||
}
|
||||
|
@ -33,5 +44,21 @@ namespace NzbDrone.Web.Helpers
|
|||
|
||||
return result + helper.ActionLink(text, actionName, controllerName).ToHtmlString() + @"</li>";
|
||||
}
|
||||
|
||||
public static string CurrentActionLink(this HtmlHelper helper, string text, string actionName, string controllerName)
|
||||
{
|
||||
string result;
|
||||
|
||||
if (IsCurrentAction(helper, actionName, controllerName))
|
||||
{
|
||||
result = "<li class='current_action'>";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "<li>";
|
||||
}
|
||||
|
||||
return result + helper.ActionLink(text, actionName, controllerName).ToHtmlString() + @"</li>";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue