Separate tools and brand and reorginize the layout components

pull/279/head
Halil İbrahim Kalkan 7 years ago
parent c6144db737
commit 8fcc06eab9

@ -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>

@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbarMenu
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.MainNavbar.Menu
{
public class MainNavbarMenuViewComponent : AbpViewComponent
{
@ -16,7 +16,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Views.Shared.Components.Theme.M
public async Task<IViewComponentResult> InvokeAsync()
{
var menu = await _menuManager.GetAsync(StandardMenus.Main);
return View("~/Views/Shared/Components/Theme/MainNavbarMenu/Default.cshtml", menu);
return View("~/Views/Shared/Components/Theme/MainNavbar/Menu/Default.cshtml", menu);
}
}
}

@ -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");
}
}
}

@ -20,6 +20,10 @@
<EmbeddedResource Include="wwwroot\**\*.*" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="Views\Shared\Components\Theme\MainNavbar\Tools\Default.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />
</ItemGroup>

Loading…
Cancel
Save