Made breadcrumbs dynamic and moved it to a shared partial view.
This commit is contained in:
parent
a02b544f58
commit
39d152ca48
@ -1,4 +1,6 @@
|
||||
namespace ReportingServices.Shared.HelperClasses;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace ReportingServices.Shared.HelperClasses;
|
||||
|
||||
public static class APIHelperFunctions
|
||||
{
|
||||
@ -50,4 +52,14 @@ public static class APIHelperFunctions
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static string SplitOnCamelCase(string input)
|
||||
{
|
||||
Regex r = new(@"
|
||||
(?<=[A-Z])(?=[A-Z][a-z]) |
|
||||
(?<=[^A-Z])(?=[A-Z]) |
|
||||
(?<=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace);
|
||||
|
||||
return r.Replace(input, " ");
|
||||
}
|
||||
}
|
@ -2,12 +2,7 @@
|
||||
ViewData["Title"] = "Home Page | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item active" aria-current="page">Home</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 d-grid">
|
||||
|
@ -2,13 +2,7 @@
|
||||
ViewData["Title"] = "Planning Reports | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Planning Reports</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 d-grid">
|
||||
|
@ -4,14 +4,7 @@
|
||||
ViewData["Title"] = "Weekly Part Changes | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="PlanningReport" asp-action="Index">Planning Reports</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Weekly Part Changes Report</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<h1 class="text-center">Weekly Part Changes</h1>
|
||||
|
||||
|
@ -23,14 +23,7 @@
|
||||
ViewData["Title"] = "Daily Passdown | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="ProductionReport" asp-action="Index">Production Reports</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Production Passdown Report</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<div class="text-center">
|
||||
<h2>Daily Report</h2>
|
||||
|
@ -4,14 +4,7 @@
|
||||
ViewData["Title"] = "Edit Daily Passdown | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="ProductionReport" asp-action="Index">Production Reports</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Edit Passdown</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
@ -4,14 +4,7 @@
|
||||
ViewData["Title"] = "Hold Lot Report | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li class="breadcrumb-item"><a asp-controller="ProductionReport" asp-action="Index">Production Reports</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Hold Lot Report</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<h1 class="text-center">Hold Lots</h1>
|
||||
<br /><br />
|
||||
|
@ -2,13 +2,7 @@
|
||||
ViewData["Title"] = "Production Reports | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Production Reports</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 d-grid">
|
||||
|
@ -4,14 +4,7 @@
|
||||
ViewData["Title"] = "Open NCR Report | Mesa Reporting Services";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">Home</a></li>
|
||||
<li class="breadcrumb-item"><a asp-controller="ProductionReport" asp-action="Index">Production Reports</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Hold Lot Report</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
||||
<partial name="_BreadCrumbs" />
|
||||
|
||||
<h1 class="text-center">Open NCRs</h1>
|
||||
<br />
|
||||
|
26
ReportingServices.UI/Views/Shared/_BreadCrumbs.cshtml
Normal file
26
ReportingServices.UI/Views/Shared/_BreadCrumbs.cshtml
Normal file
@ -0,0 +1,26 @@
|
||||
@{
|
||||
string myClass = "";
|
||||
}
|
||||
|
||||
<div aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
@if (ViewContext.RouteData.Values["controller"].ToString() == "Home" && ViewContext.RouteData.Values["action"].ToString() == "Index")
|
||||
myClass = "active disableLink";
|
||||
<li class="breadcrumb-item @myClass">@Html.ActionLink("Home", "Index", "Home")</li>
|
||||
@if (ViewContext.RouteData.Values["controller"].ToString() != "Home")
|
||||
{
|
||||
if (ViewContext.RouteData.Values["action"].ToString() == "Index")
|
||||
myClass = "active disableLink";
|
||||
|
||||
<li class="breadcrumb-item @myClass">@Html.ActionLink(APIHelperFunctions.SplitOnCamelCase(ViewContext.RouteData.Values["controller"].ToString()) + "s", "Index", ViewContext.RouteData.Values["controller"].ToString())</li>
|
||||
}
|
||||
@if (ViewContext.RouteData.Values["action"].ToString() != "Index")
|
||||
{
|
||||
if (ViewContext.RouteData.Values["controller"].ToString() != "Home")
|
||||
myClass = "active disableLink";
|
||||
|
||||
<li class="breadcrumb-item @myClass">@Html.ActionLink(APIHelperFunctions.SplitOnCamelCase(ViewContext.RouteData.Values["action"].ToString()), ViewContext.RouteData.Values["action"].ToString(), ViewContext.RouteData.Values["controller"].ToString())</li>
|
||||
}
|
||||
</ol>
|
||||
</div>
|
||||
<br />
|
@ -3,4 +3,5 @@
|
||||
@using ReportingServices.Shared.Models.PlanningReport
|
||||
@using ReportingServices.Shared.Models.ProductionReport
|
||||
@using ReportingServices.Shared.ViewModels.ProductionReport
|
||||
@using ReportingServices.Shared.HelperClasses
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
|
@ -1 +1 @@
|
||||
[{"Date":"2023-01-23T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-24T00:00:00-07:00","ASM":7,"HTR":15}]
|
||||
[{"Date":"2023-01-23T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-24T00:00:00-07:00","ASM":7,"HTR":15},{"Date":"2023-01-26T00:00:00-07:00","ASM":7,"HTR":14}]
|
@ -105,3 +105,24 @@ body {
|
||||
color: rgb(212, 111, 35);
|
||||
background-color: rgba(212, 111, 35, 0.3);
|
||||
}
|
||||
|
||||
.disableLink a:link {
|
||||
color: grey;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.disableLink a:visited {
|
||||
color: grey;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.disableLink a:hover {
|
||||
color: grey;
|
||||
text-decoration: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.disableLink a:active {
|
||||
color: grey;
|
||||
text-decoration: none;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user