mirror of https://github.com/abpframework/abp.git
8 changed files with 55 additions and 21 deletions
@ -0,0 +1 @@ |
|||
<a class="navbar-brand" href="~/"><i>Project</i>Name</a> |
|||
@ -0,0 +1,12 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbar.Brand |
|||
{ |
|||
public class MainNavbarBrandViewComponent : AbpViewComponent |
|||
{ |
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View("~/Views/Shared/Components/Theme/MainNavbar/Brand/Default.cshtml"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,31 +1,21 @@ |
|||
@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 |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbar.Brand |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbar.Menu |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbar.Tools |
|||
<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"> |
|||
@(await Component.InvokeAsync<MainNavbarBrandViewComponent>()) |
|||
<button class="navbar-toggler" type="button" data-toggle="collapse" |
|||
data-target="#main-navbar-collapse" aria-controls="main-navbar-collapse" |
|||
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> |
|||
} |
|||
@(await Component.InvokeAsync<MainNavbarToolsViewComponent>()) |
|||
|
|||
</span> |
|||
</div> |
|||
</nav> |
|||
|
|||
@ -0,0 +1,15 @@ |
|||
@using Localization.Resources.AbpUi |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.MultiTenancy |
|||
@using Volo.Abp.Users |
|||
@inject ICurrentUser CurrentUser |
|||
@inject ICurrentTenant CurrentTenant |
|||
@inject IHtmlLocalizer<AbpUiResource> L |
|||
@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> |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbar.Tools |
|||
{ |
|||
public class MainNavbarToolsViewComponent : AbpViewComponent |
|||
{ |
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View("~/Views/Shared/Components/Theme/MainNavbar/Tools/Default.cshtml"); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue