Skip to content

Commit 51374e2

Browse files
committed
Fix auth layout.
1 parent 0504002 commit 51374e2

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

src/DynamicAuthorization.Mvc.Ui/Views/Shared/_AuthLayout.cshtml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
<header>
1414
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
1515
<div class="container">
16-
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">SampleMvcWebAppWithUi</a>
17-
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
18-
aria-expanded="false" aria-label="Toggle navigation">
19-
<span class="navbar-toggler-icon"></span>
20-
</button>
2116
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
2217
<ul class="navbar-nav">
2318
<li class="nav-item">
@@ -26,15 +21,15 @@
2621
</ul>
2722
<ul class="navbar-nav flex-grow-1">
2823
<li class="nav-item">
29-
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
24+
<a class="nav-link text-dark" href="/">Home</a>
3025
</li>
3126
<li class="nav-item dropdown">
3227
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
3328
Access
3429
</a>
3530
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
36-
<a class="dropdown-item text-dark" asp-area="Access" asp-controller="Role" asp-action="Index">Role List</a>
37-
<a class="dropdown-item text-dark" asp-area="Access" asp-controller="UserRole" asp-action="Index">User Role List</a>
31+
<a class="dropdown-item text-dark" href="/role">Role List</a>
32+
<a class="dropdown-item text-dark" href="/userrole">User Role List</a>
3833
</div>
3934
</li>
4035
</ul>

src/DynamicAuthorization.Mvc.Ui/Views/UserRole/Edit.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@model UserRoleViewModel
55
@{
66
ViewData["Title"] = "Edit User Access";
7+
Layout = "~/Views/Shared/_AuthLayout.cshtml";
78
var roles = (IEnumerable<IdentityRole>)ViewData["Roles"];
89
}
910

src/DynamicAuthorization.Mvc.Ui/Views/UserRole/Index.cshtml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@model IEnumerable<UserRoleViewModel>
44
@{
55
ViewData["Title"] = "User Role List";
6+
Layout = "~/Views/Shared/_AuthLayout.cshtml";
67
}
78

89
<h2>Access List</h2>
@@ -21,27 +22,27 @@
2122
<tbody>
2223
@foreach (var user in Model)
2324
{
24-
<tr>
25-
<td>@Html.DisplayFor(m => user.UserName)</td>
26-
<td>
27-
@for (var i = 0; i < user.Roles.Count(); i++)
25+
<tr>
26+
<td>@Html.DisplayFor(m => user.UserName)</td>
27+
<td>
28+
@for (var i = 0; i < user.Roles.Count(); i++)
2829
{
2930
if (i < user.Roles.Count() - 1)
3031
{
3132
var element = user.Roles.ElementAt(i);
32-
<span>@Html.DisplayFor(_ => element) | </span>
33+
<span>@Html.DisplayFor(_ => element) | </span>
3334
}
3435
else
3536
{
3637
var element = user.Roles.ElementAt(i);
37-
<span>@Html.DisplayFor(_ => element)</span>
38+
<span>@Html.DisplayFor(_ => element)</span>
3839
}
3940
}
40-
</td>
41-
<td>
42-
<a asp-action="Edit" asp-route-id="@user.UserId">Edit</a>
43-
</td>
44-
</tr>
41+
</td>
42+
<td>
43+
<a asp-action="Edit" asp-route-id="@user.UserId">Edit</a>
44+
</td>
45+
</tr>
4546
}
4647
</tbody>
4748
</table>

0 commit comments

Comments
 (0)