Browse Source
Merge pull request #7467 from abpframework/cotur/module-template
Added missing menu contribution to module template
pull/7469/head
Yunus Emre Kalkan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
16 additions and
4 deletions
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Pages/Index.cshtml
-
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs
-
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenus.cs
-
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/Menus/MyProjectNameMenuContributor.cs
-
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Web/Menus/MyProjectNameMenus.cs
|
|
|
@ -2,6 +2,16 @@ |
|
|
|
@using Localization.Resources.AbpUi |
|
|
|
@using Microsoft.Extensions.Localization |
|
|
|
@using MyCompanyName.MyProjectName.Pages |
|
|
|
@using Volo.Abp.Users |
|
|
|
@model IndexModel |
|
|
|
@inject IStringLocalizer<AbpUiResource> Localizer |
|
|
|
<a href="~/Account/Login">@Localizer["Login"]</a> |
|
|
|
@inject ICurrentUser CurrentUser |
|
|
|
|
|
|
|
@if (!CurrentUser.IsAuthenticated) |
|
|
|
{ |
|
|
|
<a href="~/Account/Login">@Localizer["Login"]</a> |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
<span>Welcome: @CurrentUser.UserName</span> |
|
|
|
} |
|
|
|
@ -16,7 +16,8 @@ namespace MyCompanyName.MyProjectName.Blazor.Menus |
|
|
|
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) |
|
|
|
{ |
|
|
|
//Add main menu items.
|
|
|
|
|
|
|
|
context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "~/MyProjectName", icon: "fa fa-globe")); |
|
|
|
|
|
|
|
return Task.CompletedTask; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
{ |
|
|
|
public class MyProjectNameMenus |
|
|
|
{ |
|
|
|
private const string Prefix = "MyProjectName"; |
|
|
|
public const string Prefix = "MyProjectName"; |
|
|
|
|
|
|
|
//Add your menu items here...
|
|
|
|
//public const string Home = Prefix + ".MyNewMenuItem";
|
|
|
|
|
|
|
|
@ -16,6 +16,7 @@ namespace MyCompanyName.MyProjectName.Web.Menus |
|
|
|
private Task ConfigureMainMenuAsync(MenuConfigurationContext context) |
|
|
|
{ |
|
|
|
//Add main menu items.
|
|
|
|
context.Menu.AddItem(new ApplicationMenuItem(MyProjectNameMenus.Prefix, displayName: "MyProjectName", "~/MyProjectName", icon: "fa fa-globe")); |
|
|
|
|
|
|
|
return Task.CompletedTask; |
|
|
|
} |
|
|
|
|
|
|
|
@ -2,7 +2,7 @@ |
|
|
|
{ |
|
|
|
public class MyProjectNameMenus |
|
|
|
{ |
|
|
|
private const string Prefix = "MyProjectName"; |
|
|
|
public const string Prefix = "MyProjectName"; |
|
|
|
|
|
|
|
//Add your menu items here...
|
|
|
|
//public const string Home = Prefix + ".MyNewMenuItem";
|
|
|
|
|