mirror of https://github.com/abpframework/abp
parent
175239a479
commit
5fe0798775
@ -1,52 +0,0 @@
|
||||
@using Localization.Resources.AbpUi
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@using Volo.Abp.MultiTenancy
|
||||
@using Volo.Abp.UI.Navigation
|
||||
@using Volo.Abp.Users
|
||||
@model ApplicationMenu
|
||||
@inject ICurrentUser CurrentUser
|
||||
@inject ICurrentTenant CurrentTenant
|
||||
@inject IHtmlLocalizer<AbpUiResource> L
|
||||
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
|
||||
<a class="navbar-brand" href="~/"><i>Project</i>Name</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar-collapse" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="main-navbar-collapse">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
@foreach (var menuItem in Model.Items)
|
||||
{
|
||||
if (menuItem.IsLeaf)
|
||||
{
|
||||
<li class="nav-item @(menuItem.IsDisabled ? "disabled" : "")">
|
||||
<!-- active -->
|
||||
<a class="nav-link" href="@(menuItem.Url ?? "#")">@menuItem.DisplayName</a> @*<span class="sr-only">(current)</span>*@
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="Menu_@(menuItem.Name)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">@menuItem.DisplayName</a>
|
||||
<div class="dropdown-menu" aria-labelledby="Menu_@(menuItem.Name)">
|
||||
@foreach (var childMenuItem in menuItem.Items)
|
||||
{
|
||||
<a class="dropdown-item" href="@(childMenuItem.Url ?? "#")">@childMenuItem.DisplayName</a>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
|
||||
<span id="main-navbar-tools">
|
||||
@if (CurrentUser.IsAuthenticated)
|
||||
{
|
||||
<span style="color: #fff">@CurrentUser.UserName</span> <text>(<a href="/Account/Logout">@L["Logout"]</a>)</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a href="/Account/Login">Login</a>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
@ -0,0 +1,31 @@
|
||||
@using Localization.Resources.AbpUi
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbarMenu
|
||||
@using Volo.Abp.MultiTenancy
|
||||
@using Volo.Abp.Users
|
||||
@inject ICurrentUser CurrentUser
|
||||
@inject ICurrentTenant CurrentTenant
|
||||
@inject IHtmlLocalizer<AbpUiResource> L
|
||||
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top" id="main-navbar">
|
||||
<a class="navbar-brand" href="~/"><i>Project</i>Name</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar-collapse" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="main-navbar-collapse">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
@(await Component.InvokeAsync<MainNavbarMenuViewComponent>())
|
||||
@* TODO: Menu *@
|
||||
</ul>
|
||||
|
||||
<span id="main-navbar-tools">
|
||||
@if (CurrentUser.IsAuthenticated)
|
||||
{
|
||||
<span style="color: #fff">@CurrentUser.UserName</span> <text>(<a href="/Account/Logout">@L["Logout"]</a>)</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a href="/Account/Login">Login</a>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
@ -0,0 +1,24 @@
|
||||
@using Volo.Abp.UI.Navigation
|
||||
@model ApplicationMenu
|
||||
@foreach (var menuItem in Model.Items)
|
||||
{
|
||||
if (menuItem.IsLeaf)
|
||||
{
|
||||
<li class="nav-item @(menuItem.IsDisabled ? "disabled" : "")">
|
||||
<!-- active -->
|
||||
<a class="nav-link" href="@(menuItem.Url ?? "#")">@menuItem.DisplayName</a> @*<span class="sr-only">(current)</span>*@
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="Menu_@(menuItem.Name)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">@menuItem.DisplayName</a>
|
||||
<div class="dropdown-menu" aria-labelledby="Menu_@(menuItem.Name)">
|
||||
@foreach (var childMenuItem in menuItem.Items)
|
||||
{
|
||||
<a class="dropdown-item" href="@(childMenuItem.Url ?? "#")">@childMenuItem.DisplayName</a>
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
}
|
Loading…
Reference in new issue