Add active page name to all pages.

pull/14162/head
maliming 3 years ago
parent 7d6ff3f35b
commit 9e83e6ab93

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Layout;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.ContentTitle;
public class ContentTitleViewComponent : AbpViewComponent
{
protected IPageLayout PageLayout { get; }
public ContentTitleViewComponent(IPageLayout pageLayout)
{
PageLayout = pageLayout;
}
public virtual IViewComponentResult Invoke()
{
return View("~/Themes/Basic/Components/ContentTitle/Default.cshtml", PageLayout.Content);
}
}

@ -0,0 +1,7 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model ContentLayout
<div class="col">
<h4>@Model.Title</h4>
</div>

@ -1,6 +1,7 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook @using Volo.Abp.AspNetCore.Mvc.UI.Components.LayoutHook
@using Volo.Abp.AspNetCore.Mvc.UI.Layout @using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.ContentTitle
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.MainNavbar @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.MainNavbar
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.PageAlerts @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.PageAlerts
@using Volo.Abp.AspNetCore.Mvc.UI.Theming @using Volo.Abp.AspNetCore.Mvc.UI.Theming
@ -58,8 +59,13 @@
<div class="@containerClass"> <div class="@containerClass">
@(await Component.InvokeAsync<PageAlertsViewComponent>()) @(await Component.InvokeAsync<PageAlertsViewComponent>())
<div id="AbpContentToolbar"> <div id="AbpContentToolbar">
<div class="text-end mb-2"> <div class="row mb-2">
@await RenderSectionAsync("content_toolbar", false) @(await Component.InvokeAsync<ContentTitleViewComponent>())
<div class="col">
<div class="text-end">
@await RenderSectionAsync("content_toolbar", false)
</div>
</div>
</div> </div>
</div> </div>
@await Component.InvokeLayoutHookAsync(LayoutHooks.PageContent.First, StandardLayouts.Application) @await Component.InvokeLayoutHookAsync(LayoutHooks.PageContent.First, StandardLayouts.Application)

@ -28,17 +28,10 @@
<abp-script src="/Pages/identity/roles/index.js" /> <abp-script src="/Pages/identity/roles/index.js" />
</abp-script-bundle> </abp-script-bundle>
} }
@section content_toolbar {
@await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })
}
<abp-card id="IdentityRolesWrapper"> <abp-card id="IdentityRolesWrapper">
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Roles"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-end">
@await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body> <abp-card-body>
<abp-table striped-rows="true" class="nowrap"></abp-table> <abp-table striped-rows="true" class="nowrap"></abp-table>
</abp-card-body> </abp-card-body>

@ -29,18 +29,10 @@
<abp-script src="/Pages/identity/users/index.js" /> <abp-script src="/Pages/identity/users/index.js" />
</abp-script-bundle> </abp-script-bundle>
} }
@section content_toolbar {
@await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })
}
<abp-card id="IdentityUsersWrapper"> <abp-card id="IdentityUsersWrapper">
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Users"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-end">
@await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body> <abp-card-body>
<abp-table striped-rows="true" class="nowrap"></abp-table> <abp-table striped-rows="true" class="nowrap"></abp-table>
</abp-card-body> </abp-card-body>

@ -24,17 +24,10 @@
<abp-script src="/Pages/TenantManagement/Tenants/Index.js"/> <abp-script src="/Pages/TenantManagement/Tenants/Index.js"/>
</abp-script-bundle> </abp-script-bundle>
} }
@section content_toolbar {
@await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })
}
<abp-card id="TenantsWrapper"> <abp-card id="TenantsWrapper">
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Tenants"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-end">
@await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(IndexModel).FullName })
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body> <abp-card-body>
<abp-table striped-rows="true" class="nowrap"></abp-table> <abp-table striped-rows="true" class="nowrap"></abp-table>
</abp-card-body> </abp-card-body>

@ -28,13 +28,6 @@
} }
<abp-card id="VirtualFileExplorerWrapper"> <abp-card id="VirtualFileExplorerWrapper">
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["VirtualFileExplorer"]</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body> <abp-card-body>
@Html.Raw(Model.PathNavigation) @Html.Raw(Model.PathNavigation)

Loading…
Cancel
Save