Skip to content

Commit 3311891

Browse files
committed
use PageNames in navigationProvider and views.
1 parent f5b380b commit 3311891

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

src/AbpCompanyName.AbpProjectName.Web/Startup/AbpProjectNameNavigationProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ public override void SetNavigation(INavigationProviderContext context)
1414
context.Manager.MainMenu
1515
.AddItem(
1616
new MenuItemDefinition(
17-
"Home",
17+
PageNames.Home,
1818
L("HomePage"),
1919
url: "",
2020
icon: "fa fa-home",
2121
requiresAuthentication: true
2222
)
2323
).AddItem(
2424
new MenuItemDefinition(
25-
"Tenants",
25+
PageNames.Tenants,
2626
L("Tenants"),
2727
url: "Tenants",
2828
icon: "fa fa-globe",
2929
requiredPermissionName: PermissionNames.Pages_Tenants
3030
)
3131
).AddItem(
3232
new MenuItemDefinition(
33-
"Users",
33+
PageNames.Users,
3434
L("Users"),
3535
url: "Users",
3636
icon: "fa fa-users",
3737
requiredPermissionName: PermissionNames.Pages_Users
3838
)
3939
).AddItem(
4040
new MenuItemDefinition(
41-
"About",
41+
PageNames.About,
4242
L("About"),
4343
url: "About",
4444
icon: "fa fa-info"

src/AbpCompanyName.AbpProjectName.Web/Startup/PageNames.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ public class PageNames
44
{
55
public const string Home = "Home";
66
public const string About = "About";
7+
public const string Tenants = "Tenants";
8+
public const string Users = "Users";
79
}
810
}

src/AbpCompanyName.AbpProjectName.Web/Views/About/Index.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
@{
2-
ViewBag.CurrentPageName = "About"; //The menu item will be active for this page.
1+
@using AbpCompanyName.AbpProjectName.Web.Startup
2+
@{
3+
ViewBag.CurrentPageName = PageNames.About; //The menu item will be active for this page.
34
}
45
<div>
56
<div class="row">

src/AbpCompanyName.AbpProjectName.Web/Views/Home/Index.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
@{
2-
ViewBag.CurrentPageName = "Home"; //The menu item will be active for this page.
1+
@using AbpCompanyName.AbpProjectName.Web.Startup
2+
@{
3+
ViewBag.CurrentPageName = PageNames.Home; //The menu item will be active for this page.
34
}
45
<h1>@L("WellcomeMessage")</h1>
56
<div class="row">

src/AbpCompanyName.AbpProjectName.Web/Views/Tenants/Index.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
@using Abp.MultiTenancy
22
@using AbpCompanyName.AbpProjectName.MultiTenancy
3+
@using AbpCompanyName.AbpProjectName.Web.Startup
34
@model Abp.Application.Services.Dto.ListResultOutput<AbpCompanyName.AbpProjectName.MultiTenancy.Dto.TenantListDto>
45
@{
5-
ViewBag.CurrentPageName = "Tenants"; //The menu item will be active for this page.
6+
ViewBag.CurrentPageName = PageNames.Tenants; //The menu item will be active for this page.
67
}
78
@section scripts
89
{

src/AbpCompanyName.AbpProjectName.Web/Views/Users/Index.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
@using Abp.Authorization.Users
2+
@using AbpCompanyName.AbpProjectName.Web.Startup
23
@model Abp.Application.Services.Dto.ListResultOutput<AbpCompanyName.AbpProjectName.Users.Dto.UserListDto>
34
@{
4-
ViewBag.CurrentPageName = "Users"; //The menu item will be active for this page.
5+
ViewBag.CurrentPageName = PageNames.Users; //The menu item will be active for this page.
56
}
67
@section scripts
78
{

0 commit comments

Comments
 (0)