widget & dashboardStyleBundleContributors

pull/1148/head^2
Yunus Emre Kalkan 7 years ago
parent e808fccfc3
commit a009375d37

@ -0,0 +1,8 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Dashboards
{
public class AbpBasicDashboardStyleContributor : BundleContributor
{
}
}

@ -8,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection;
using DashboardDemo.EntityFrameworkCore;
using DashboardDemo.Localization.DashboardDemo;
using DashboardDemo.Menus;
using DashboardDemo.Pages;
using DashboardDemo.Pages.widgets;
using DashboardDemo.Permissions;
using DashboardDemo.Widgets;
@ -101,10 +102,14 @@ namespace DashboardDemo
Configure<BundlingOptions>(options =>
{
options.ScriptBundles.Add("MyDashboard", configuration =>
options.ScriptBundles.Add(DashboardNames.MyDashboard, configuration =>
{
configuration.AddContributors(typeof(MyDashboardScriptBundleContributor));
});
options.StyleBundles.Add(DashboardNames.MyDashboard, configuration =>
{
configuration.AddContributors(typeof(MyDashboardStyleBundleContributor));
});
});
}

@ -9,8 +9,11 @@
@model DashboardDemo.Pages.MyDashboardModel
@{
}
@section styles {
<abp-style-bundle name="@DashboardNames.MyDashboard" />
}
@section scripts {
<abp-script-bundle name="@DashboardNames.MyDashboard" />
}
@await DashboardRenderer.RenderAsync(Component, new { dashboardName = DashboardNames.MyDashboard})
@await DashboardRenderer.RenderAsync(Component, new { dashboardName = DashboardNames.MyDashboard })

@ -3,7 +3,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Dashboards;
using Volo.Abp.Modularity;
namespace DashboardDemo.Dashboards
namespace DashboardDemo.Pages
{
[DependsOn(
typeof(AbpBasicDashboardScriptContributor),

@ -0,0 +1,20 @@
using DashboardDemo.Pages.widgets;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Dashboards;
using Volo.Abp.Modularity;
namespace DashboardDemo.Pages
{
[DependsOn(
typeof(AbpBasicDashboardStyleContributor),
typeof(MyWidgetStyleBundleContributor),
typeof(DemoStatisticsStyleContributor)
)]
public class MyDashboardStyleBundleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
}
}
}

@ -0,0 +1,8 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace DashboardDemo.Pages.widgets
{
public class DemoStatisticsStyleContributor : BundleContributor
{
}
}

@ -0,0 +1,17 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.HighlightJs;
using Volo.Abp.Modularity;
namespace DashboardDemo.Pages.widgets
{
[DependsOn(typeof(BootstrapStyleContributor))]
[DependsOn(typeof(HighlightJsStyleContributor))]
public class MyWidgetStyleBundleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.Add("/Pages/widgets/MyDashboard.css");
}
}
}
Loading…
Cancel
Save