Skip to content

Commit

Permalink
feat: marking current page
Browse files Browse the repository at this point in the history
-add few scripts for marking current page
  • Loading branch information
Nazg0r committed May 29, 2024
1 parent 5600090 commit 0c08460
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
12 changes: 11 additions & 1 deletion src/MTRPZ4.UI/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,14 @@

<partial name="/Views/Shared/_FooterMeta.cshtml" />

</footer>
</footer>

<script>
var home = document.getElementById("Home");
var testing = document.getElementById("Testing");
var result = document.getElementById("Results");
home.classList.add("is-current");
testing.classList.remove("is-current");
result.classList.remove("is-current");
</script>
12 changes: 11 additions & 1 deletion src/MTRPZ4.UI/Views/Result/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,14 @@

<partial name="/Views/Shared/_FooterMeta.cshtml" />

</footer>
</footer>

<script>
var home = document.getElementById("Home");
var testing = document.getElementById("Testing");
var result = document.getElementById("Results");
home.classList.remove("is-current");
testing.classList.remove("is-current");
result.classList.add("is-current");
</script>
7 changes: 4 additions & 3 deletions src/MTRPZ4.UI/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
<div class="header__nav_body">
<ul class="header__nav_list">
<li>
<a asp-area="" asp-controller="Home" asp-action="Index" aria-label="Home">
<a asp-area="" asp-controller="Home" asp-action="Index" aria-label="Home" id="Home">
<span>Home</span>
</a>
</li>
<li>
<a class="is-current" asp-area="" asp-controller="Test" asp-action="Index" aria-label="Testing">
<a asp-area="" asp-controller="Test" asp-action="Index" aria-label="Testing" id="Testing">
<span>Testing</span>
</a>
</li>
<li>
<a asp-area="" asp-controller="Result" asp-action="Index" aria-label="Results">
<a asp-area="" asp-controller="Result" asp-action="Index" aria-label="Results" id="Results">
<span>Results</span>
</a>
</li>
Expand All @@ -52,6 +52,7 @@
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>

@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
12 changes: 11 additions & 1 deletion src/MTRPZ4.UI/Views/Test/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,14 @@

<partial name="/Views/Shared/_FooterMeta.cshtml" />

</footer>
</footer>

<script>
var home = document.getElementById("Home");
var testing = document.getElementById("Testing");
var result = document.getElementById("Results");
home.classList.remove("is-current");
testing.classList.add("is-current");
result.classList.remove("is-current");
</script>

0 comments on commit 0c08460

Please sign in to comment.