|
20 | 20 |
|
21 | 21 | <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /> |
22 | 22 | <link rel="stylesheet" href="~/ApiIntegrationMvc.styles.css" asp-append-version="true" /> |
23 | | - |
| 23 | + |
24 | 24 | @RenderSection("Styles", required: false) |
25 | 25 | </head> |
26 | 26 | <body> |
|
59 | 59 | </button> |
60 | 60 |
|
61 | 61 | </li> |
62 | | - <li> |
63 | | - |
64 | | - </li> |
| 62 | + |
65 | 63 |
|
66 | 64 | <li class="nav-item"> |
67 | 65 | <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index"> |
68 | 66 | <i class="bi bi-house-door me-1"></i> Home |
69 | 67 | </a> |
70 | 68 | </li> |
71 | | - <li class="nav-item"> |
72 | | - <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy"> |
73 | | - <i class="bi bi-shield-lock me-1"></i> Privacy |
74 | | - </a> |
75 | | - </li> |
| 69 | + |
| 70 | + |
| 71 | + @if (User.IsInRole("Admin")) |
| 72 | + { |
| 73 | + <li class="nav-item d-none d-sm-block"> |
| 74 | + <a class="nav-link text-dark" href="#" data-bs-toggle="modal" data-bs-target="#permModal"> |
| 75 | + <i class="bi bi-shield-lock me-1"></i> Permissions |
| 76 | + </a> |
| 77 | + </li> |
| 78 | + } |
| 79 | + |
| 80 | + |
76 | 81 | </ul> |
77 | 82 | </div> |
78 | | - |
| 83 | + |
79 | 84 | <!-- RIGHT: Logout (ALWAYS visible, never collapses) --> |
80 | 85 | <div class="d-flex ms-auto align-items-center"> |
81 | | - @if (User?.Identity?.IsAuthenticated == true) |
82 | | - { |
83 | | - <form asp-area="Account" asp-controller="Login" asp-action="Logout" method="post" class="d-inline"> |
84 | | - @Html.AntiForgeryToken() |
85 | | - <button type="submit" class="btn btn-link nav-link"> |
86 | | - <i class="bi bi-box-arrow-right me-1"></i> Logout |
87 | | - </button> |
88 | | - </form> |
89 | | - } |
90 | | - else |
91 | | - { |
92 | | - <a class="nav-link" asp-area="Account" asp-controller="Login" asp-action="Index">Login</a> |
93 | | - } |
94 | | - </div> |
| 86 | + |
| 87 | + <ul class="navbar-nav ms-auto align-items-center"> |
| 88 | + |
| 89 | + <li class="nav-item d-none d-sm-block"> |
| 90 | + <div class="d-flex align-items-center text-dark"> |
| 91 | + <i class="bi bi-person-circle me-1"></i> |
| 92 | + <span class="fw-bold">@User.Identity.Name</span> |
| 93 | + <small class="text-muted ms-1"> |
| 94 | + (@User.FindFirst(System.Security.Claims.ClaimTypes.Role)?.Value) |
| 95 | + </small> |
| 96 | + </div> |
| 97 | + </li> |
95 | 98 |
|
| 99 | + @* Logout / Profile stays as it is *@ |
| 100 | + @if (User?.Identity?.IsAuthenticated == true) |
| 101 | + { |
| 102 | + <li> |
| 103 | + <form asp-area="Account" asp-controller="Login" asp-action="Logout" |
| 104 | + method="post" class="d-inline"> |
| 105 | + @Html.AntiForgeryToken() |
| 106 | + <button type="submit" class="btn btn-link nav-link text-dark"> |
| 107 | + <i class="bi bi-box-arrow-right me-1"></i> Logout |
| 108 | + </button> |
| 109 | + </form> |
| 110 | + </li> |
| 111 | + } |
| 112 | + else |
| 113 | + { |
| 114 | + <li class="nav-item"> |
| 115 | + <a class="nav-link" |
| 116 | + asp-area="Account" asp-controller="Login" asp-action="Index">Login</a> |
| 117 | + </li> |
| 118 | + } |
| 119 | + </ul> |
| 120 | + </div> |
96 | 121 | </div> |
97 | 122 | </nav> |
98 | 123 |
|
|
172 | 197 | }); |
173 | 198 | </script> |
174 | 199 | } |
175 | | - |
| 200 | + @await Html.PartialAsync("_PermissionSwitchModal") |
176 | 201 | </body> |
177 | 202 | </html> |
0 commit comments