aboutsummaryrefslogtreecommitdiff
path: root/ExamTemplate/Web/Views/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'ExamTemplate/Web/Views/Shared')
-rw-r--r--ExamTemplate/Web/Views/Shared/_Navbar.cshtml18
1 files changed, 16 insertions, 2 deletions
diff --git a/ExamTemplate/Web/Views/Shared/_Navbar.cshtml b/ExamTemplate/Web/Views/Shared/_Navbar.cshtml
index f81d082..f60b799 100644
--- a/ExamTemplate/Web/Views/Shared/_Navbar.cshtml
+++ b/ExamTemplate/Web/Views/Shared/_Navbar.cshtml
@@ -1,14 +1,28 @@
+@using Microsoft.AspNetCore.Identity
+
+@inject SignInManager<User> SignInManager
+@inject UserManager<User> UserManager
+
<nav class="navbar border-bottom box-shadow">
<div class="middle-content-container navbar-contents">
<section>
<b>
<a asp-controller="Home" asp-action="Index">Web</a>
</b>
+ <a asp-controller="Home" asp-action="Index">Home</a>
+ <a asp-controller="Home" asp-action="Privacy">Privacy</a>
</section>
<div class="flex-spacer"></div>
<section>
- <a asp-controller="Home" asp-action="Index">Home</a>
- <a asp-controller="Home" asp-action="Privacy">Privacy</a>
+ @if (SignInManager.IsSignedIn(User))
+ {
+ <a asp-controller="User" asp-action="">@UserManager.GetUserName(User)</a>
+ }
+ else
+ {
+ <a asp-controller="User" asp-action="Login">Login</a>
+ <a asp-controller="User" asp-action="Register">Register</a>
+ }
</section>
</div>
</nav>