Browse Source

use file-scoped namespacing for basicTheme module

pull/10696/head
Ahmet Çotur 4 years ago
parent
commit
2f672afa54
  1. 63
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/AbpAspNetCoreComponentsServerBasicThemeModule.cs
  2. 19
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/BasicThemeToolbarContributor.cs
  3. 21
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Bundling/BlazorBasicThemeBundles.cs
  4. 9
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Bundling/BlazorBasicThemeScriptContributor.cs
  5. 13
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Bundling/BlazorBasicThemeStyleContributor.cs
  6. 37
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor.cs
  7. 17
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/AbpAspNetCoreComponentsWebBasicThemeModule.cs
  8. 47
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor.cs
  9. 43
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor.cs
  10. 47
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavMenu.razor.cs
  11. 67
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavToolbar.razor.cs
  12. 47
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor.cs
  13. 33
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/AbpAspNetCoreComponentsWebAssemblyBasicThemeModule.cs
  14. 17
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/BasicThemeBundleContributor.cs
  15. 31
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/BasicThemeToolbarContributor.cs
  16. 93
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs
  17. 97
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs
  18. 33
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/BasicTheme.cs
  19. 21
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Bundling/BasicThemeBundles.cs
  20. 13
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Bundling/BasicThemeGlobalScriptContributor.cs
  21. 11
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Bundling/BasicThemeGlobalStyleContributor.cs
  22. 11
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Brand/MainNavbarBrandViewComponent.cs
  23. 11
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/MainNavbar/MainNavbarViewComponent.cs
  24. 25
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/MainNavbarMenuViewComponent.cs
  25. 23
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/PageAlerts/PageAlertsViewComponent.cs
  26. 75
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponent.cs
  27. 13
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponentModel.cs
  28. 25
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/MainNavbarToolbarViewComponent.cs
  29. 25
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/UserMenuViewComponent.cs
  30. 43
      modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Toolbars/BasicThemeMainTopToolbarContributor.cs
  31. 23
      modules/basic-theme/src/Volo.Abp.BasicTheme.Installer/Volo/Abp/BasicTheme/AbpBasicThemeInstallerModule.cs
  32. 15
      modules/basic-theme/src/Volo.Abp.BasicTheme.Installer/Volo/Abp/BasicTheme/BasicThemeInstallerPipelineBuilder.cs
  33. 91
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestBase.cs
  34. 15
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestModule.cs
  35. 15
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/Components/Card_Tests.cs
  36. 21
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/TestStartup.cs
  37. 37
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs
  38. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Alerts.cshtml.cs
  39. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Badges.cshtml.cs
  40. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Blockquotes.cshtml.cs
  41. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Borders.cshtml.cs
  42. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Breadcrumbs.cshtml.cs
  43. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ButtonGroups.cshtml.cs
  44. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml.cs
  45. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Cards.cshtml.cs
  46. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Carousel.cshtml.cs
  47. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Collapse.cshtml.cs
  48. 33
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Dropdowns.cshtml.cs
  49. 249
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml.cs
  50. 89
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml.cs
  51. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Grids.cshtml.cs
  52. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ListGroup.cshtml.cs
  53. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Modals.cshtml.cs
  54. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml.cs
  55. 15
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Paginator.cshtml.cs
  56. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Popovers.cshtml.cs
  57. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ProgressBars.cshtml.cs
  58. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tables.cshtml.cs
  59. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tabs.cshtml.cs
  60. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tooltips.cshtml.cs
  61. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Index.cshtml.cs
  62. 67
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Program.cs
  63. 19
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Startup.cs
  64. 73
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs
  65. 37
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Menus/BasicThemeDemoMenuContributor.cs
  66. 65
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Menus/BasicThemeDemoMenus.cs
  67. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml.cs
  68. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml.cs
  69. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml.cs
  70. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml.cs
  71. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml.cs
  72. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Buttons/Index.cshtml.cs
  73. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml.cs
  74. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Carousel/Index.cshtml.cs
  75. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml.cs
  76. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml.cs
  77. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/DynamicForms/Index.cshtml.cs
  78. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/FormElements/Index.cshtml.cs
  79. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml.cs
  80. 23
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Index.cshtml.cs
  81. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml.cs
  82. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml.cs
  83. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navbars/Index.cshtml.cs
  84. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml.cs
  85. 15
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Paginator/Index.cshtml.cs
  86. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml.cs
  87. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml.cs
  88. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml.cs
  89. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml.cs
  90. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml.cs
  91. 11
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Index.cshtml.cs
  92. 67
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Program.cs
  93. 21
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Startup.cs

63
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/AbpAspNetCoreComponentsServerBasicThemeModule.cs

@ -7,41 +7,40 @@ using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme;
[DependsOn(
typeof(AbpAspNetCoreComponentsWebBasicThemeModule),
typeof(AbpAspNetCoreComponentsServerThemingModule)
)]
public class AbpAspNetCoreComponentsServerBasicThemeModule : AbpModule
{
[DependsOn(
typeof(AbpAspNetCoreComponentsWebBasicThemeModule),
typeof(AbpAspNetCoreComponentsServerThemingModule)
)]
public class AbpAspNetCoreComponentsServerBasicThemeModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new BasicThemeToolbarContributor());
});
Configure<AbpBundlingOptions>(options =>
{
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new BasicThemeToolbarContributor());
});
Configure<AbpBundlingOptions>(options =>
{
options
.StyleBundles
.Add(BlazorBasicThemeBundles.Styles.Global, bundle =>
{
bundle
.AddBaseBundles(BlazorStandardBundles.Styles.Global)
.AddContributors(typeof(BlazorBasicThemeStyleContributor));
});
options
.StyleBundles
.Add(BlazorBasicThemeBundles.Styles.Global, bundle =>
{
bundle
.AddBaseBundles(BlazorStandardBundles.Styles.Global)
.AddContributors(typeof(BlazorBasicThemeStyleContributor));
});
options
.ScriptBundles
.Add(BlazorBasicThemeBundles.Scripts.Global, bundle =>
{
bundle
.AddBaseBundles(BlazorStandardBundles.Scripts.Global)
.AddContributors(typeof(BlazorBasicThemeScriptContributor));
});
});
}
options
.ScriptBundles
.Add(BlazorBasicThemeBundles.Scripts.Global, bundle =>
{
bundle
.AddBaseBundles(BlazorStandardBundles.Scripts.Global)
.AddContributors(typeof(BlazorBasicThemeScriptContributor));
});
});
}
}

19
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/BasicThemeToolbarContributor.cs

@ -2,19 +2,18 @@
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Themes.Basic;
using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars;
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme;
public class BasicThemeToolbarContributor : IToolbarContributor
{
public class BasicThemeToolbarContributor : IToolbarContributor
public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
{
public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
if (context.Toolbar.Name == StandardToolbars.Main)
{
if (context.Toolbar.Name == StandardToolbars.Main)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitch)));
context.Toolbar.Items.Add(new ToolbarItem(typeof(LoginDisplay)));
}
return Task.CompletedTask;
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitch)));
context.Toolbar.Items.Add(new ToolbarItem(typeof(LoginDisplay)));
}
return Task.CompletedTask;
}
}

21
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Bundling/BlazorBasicThemeBundles.cs

@ -1,15 +1,14 @@
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
public class BlazorBasicThemeBundles
{
public class BlazorBasicThemeBundles
public static class Styles
{
public static class Styles
{
public static string Global = "Blazor.BasicTheme.Global";
}
public static string Global = "Blazor.BasicTheme.Global";
}
public static class Scripts
{
public static string Global = "Blazor.BasicTheme.Global";
}
public static class Scripts
{
public static string Global = "Blazor.BasicTheme.Global";
}
}
}

9
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Bundling/BlazorBasicThemeScriptContributor.cs

@ -1,9 +1,8 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
public class BlazorBasicThemeScriptContributor : BundleContributor
{
public class BlazorBasicThemeScriptContributor : BundleContributor
{
}
}
}

13
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Bundling/BlazorBasicThemeStyleContributor.cs

@ -1,13 +1,12 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
public class BlazorBasicThemeStyleContributor : BundleContributor
{
public class BlazorBasicThemeStyleContributor : BundleContributor
public override void ConfigureBundle(BundleConfigurationContext context)
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web.BasicTheme/libs/abp/css/theme.css");
}
context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web.BasicTheme/libs/abp/css/theme.css");
}
}
}

37
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor.cs

@ -4,30 +4,29 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Themes.Basic
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Themes.Basic;
public partial class LoginDisplay : IDisposable
{
public partial class LoginDisplay : IDisposable
{
[Inject]
protected IMenuManager MenuManager { get; set; }
[Inject]
protected IMenuManager MenuManager { get; set; }
protected ApplicationMenu Menu { get; set; }
protected ApplicationMenu Menu { get; set; }
protected override async Task OnInitializedAsync()
{
Menu = await MenuManager.GetAsync(StandardMenus.User);
protected override async Task OnInitializedAsync()
{
Menu = await MenuManager.GetAsync(StandardMenus.User);
Navigation.LocationChanged += OnLocationChanged;
}
Navigation.LocationChanged += OnLocationChanged;
}
protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
InvokeAsync(StateHasChanged);
}
protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
InvokeAsync(StateHasChanged);
}
public void Dispose()
{
Navigation.LocationChanged -= OnLocationChanged;
}
public void Dispose()
{
Navigation.LocationChanged -= OnLocationChanged;
}
}

17
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/AbpAspNetCoreComponentsWebBasicThemeModule.cs

@ -1,13 +1,12 @@
using Volo.Abp.AspNetCore.Components.Web.Theming;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme;
[DependsOn(
typeof(AbpAspNetCoreComponentsWebThemingModule)
)]
public class AbpAspNetCoreComponentsWebBasicThemeModule : AbpModule
{
[DependsOn(
typeof(AbpAspNetCoreComponentsWebThemingModule)
)]
public class AbpAspNetCoreComponentsWebBasicThemeModule : AbpModule
{
}
}
}

47
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor.cs

@ -3,36 +3,35 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
public partial class FirstLevelNavMenuItem : IDisposable
{
public partial class FirstLevelNavMenuItem : IDisposable
{
[Inject] private NavigationManager NavigationManager { get; set; }
[Inject] private NavigationManager NavigationManager { get; set; }
[Parameter]
public ApplicationMenuItem MenuItem { get; set; }
[Parameter]
public ApplicationMenuItem MenuItem { get; set; }
public bool IsSubMenuOpen { get; set; }
public bool IsSubMenuOpen { get; set; }
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnLocationChanged;
}
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnLocationChanged;
}
private void ToggleSubMenu()
{
IsSubMenuOpen = !IsSubMenuOpen;
}
private void ToggleSubMenu()
{
IsSubMenuOpen = !IsSubMenuOpen;
}
public void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
public void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
private void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
IsSubMenuOpen = false;
InvokeAsync(StateHasChanged);
}
private void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
IsSubMenuOpen = false;
InvokeAsync(StateHasChanged);
}
}

43
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/MainLayout.razor.cs

@ -2,33 +2,32 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
public partial class MainLayout : IDisposable
{
public partial class MainLayout : IDisposable
{
[Inject] private NavigationManager NavigationManager { get; set; }
[Inject] private NavigationManager NavigationManager { get; set; }
private bool IsCollapseShown { get; set; }
private bool IsCollapseShown { get; set; }
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnLocationChanged;
}
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnLocationChanged;
}
private void ToggleCollapse()
{
IsCollapseShown = !IsCollapseShown;
}
private void ToggleCollapse()
{
IsCollapseShown = !IsCollapseShown;
}
public void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
public void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
private void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
IsCollapseShown = false;
InvokeAsync(StateHasChanged);
}
private void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
IsCollapseShown = false;
InvokeAsync(StateHasChanged);
}
}

47
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavMenu.razor.cs

@ -4,33 +4,32 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
public partial class NavMenu : IDisposable
{
public partial class NavMenu : IDisposable
{
[Inject]
protected IMenuManager MenuManager { get; set; }
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected IMenuManager MenuManager { get; set; }
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
protected ApplicationMenu Menu { get; set; }
protected ApplicationMenu Menu { get; set; }
protected override async Task OnInitializedAsync()
{
Menu = await MenuManager.GetMainMenuAsync();
AuthenticationStateProvider.AuthenticationStateChanged += AuthenticationStateProviderOnAuthenticationStateChanged;
}
public void Dispose()
{
AuthenticationStateProvider.AuthenticationStateChanged -= AuthenticationStateProviderOnAuthenticationStateChanged;
}
protected override async Task OnInitializedAsync()
{
Menu = await MenuManager.GetMainMenuAsync();
AuthenticationStateProvider.AuthenticationStateChanged += AuthenticationStateProviderOnAuthenticationStateChanged;
}
private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task<AuthenticationState> task)
{
Menu = await MenuManager.GetMainMenuAsync();
await InvokeAsync(StateHasChanged);
}
public void Dispose()
{
AuthenticationStateProvider.AuthenticationStateChanged -= AuthenticationStateProviderOnAuthenticationStateChanged;
}
private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task<AuthenticationState> task)
{
Menu = await MenuManager.GetMainMenuAsync();
await InvokeAsync(StateHasChanged);
}
}

67
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/NavToolbar.razor.cs

@ -6,50 +6,49 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars;
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
public partial class NavToolbar : IDisposable
{
public partial class NavToolbar : IDisposable
{
[Inject]
private IToolbarManager ToolbarManager { get; set; }
[Inject]
private IToolbarManager ToolbarManager { get; set; }
[Inject]
private AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
private AuthenticationStateProvider AuthenticationStateProvider { get; set; }
private List<RenderFragment> ToolbarItemRenders { get; set; } = new List<RenderFragment>();
private List<RenderFragment> ToolbarItemRenders { get; set; } = new List<RenderFragment>();
protected override async Task OnInitializedAsync()
{
await GetToolbarItemRendersAsync();
AuthenticationStateProvider.AuthenticationStateChanged += AuthenticationStateProviderOnAuthenticationStateChanged;
}
protected override async Task OnInitializedAsync()
{
await GetToolbarItemRendersAsync();
AuthenticationStateProvider.AuthenticationStateChanged += AuthenticationStateProviderOnAuthenticationStateChanged;
}
private async Task GetToolbarItemRendersAsync()
{
var toolbar = await ToolbarManager.GetAsync(StandardToolbars.Main);
private async Task GetToolbarItemRendersAsync()
{
var toolbar = await ToolbarManager.GetAsync(StandardToolbars.Main);
ToolbarItemRenders.Clear();
ToolbarItemRenders.Clear();
var sequence = 0;
foreach (var item in toolbar.Items)
var sequence = 0;
foreach (var item in toolbar.Items)
{
ToolbarItemRenders.Add(builder =>
{
ToolbarItemRenders.Add(builder =>
{
builder.OpenComponent(sequence++, item.ComponentType);
builder.CloseComponent();
});
}
builder.OpenComponent(sequence++, item.ComponentType);
builder.CloseComponent();
});
}
}
private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task<AuthenticationState> task)
{
await GetToolbarItemRendersAsync();
await InvokeAsync(StateHasChanged);
}
private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task<AuthenticationState> task)
{
await GetToolbarItemRendersAsync();
await InvokeAsync(StateHasChanged);
}
public void Dispose()
{
AuthenticationStateProvider.AuthenticationStateChanged -= AuthenticationStateProviderOnAuthenticationStateChanged;
}
public void Dispose()
{
AuthenticationStateProvider.AuthenticationStateChanged -= AuthenticationStateProviderOnAuthenticationStateChanged;
}
}

47
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor.cs

@ -3,36 +3,35 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic;
public partial class SecondLevelNavMenuItem : IDisposable
{
public partial class SecondLevelNavMenuItem : IDisposable
{
[Inject] private NavigationManager NavigationManager { get; set; }
[Inject] private NavigationManager NavigationManager { get; set; }
[Parameter]
public ApplicationMenuItem MenuItem { get; set; }
[Parameter]
public ApplicationMenuItem MenuItem { get; set; }
public bool IsSubMenuOpen { get; set; }
public bool IsSubMenuOpen { get; set; }
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnLocationChanged;
}
protected override void OnInitialized()
{
NavigationManager.LocationChanged += OnLocationChanged;
}
private void ToggleSubMenu()
{
IsSubMenuOpen = !IsSubMenuOpen;
}
private void ToggleSubMenu()
{
IsSubMenuOpen = !IsSubMenuOpen;
}
public void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
public void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
}
private void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
IsSubMenuOpen = false;
InvokeAsync(StateHasChanged);
}
private void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
IsSubMenuOpen = false;
InvokeAsync(StateHasChanged);
}
}

33
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/AbpAspNetCoreComponentsWebAssemblyBasicThemeModule.cs

@ -5,26 +5,25 @@ using Volo.Abp.AspNetCore.Components.WebAssembly.Theming;
using Volo.Abp.Http.Client.IdentityModel.WebAssembly;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme;
[DependsOn(
typeof(AbpAspNetCoreComponentsWebBasicThemeModule),
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule),
typeof(AbpHttpClientIdentityModelWebAssemblyModule)
)]
public class AbpAspNetCoreComponentsWebAssemblyBasicThemeModule : AbpModule
{
[DependsOn(
typeof(AbpAspNetCoreComponentsWebBasicThemeModule),
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule),
typeof(AbpHttpClientIdentityModelWebAssemblyModule)
)]
public class AbpAspNetCoreComponentsWebAssemblyBasicThemeModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
Configure<AbpRouterOptions>(options =>
{
Configure<AbpRouterOptions>(options =>
{
options.AdditionalAssemblies.Add(typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule).Assembly);
});
options.AdditionalAssemblies.Add(typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule).Assembly);
});
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new BasicThemeToolbarContributor());
});
}
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new BasicThemeToolbarContributor());
});
}
}

17
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/BasicThemeBundleContributor.cs

@ -1,17 +1,16 @@
using Volo.Abp.Bundling;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme;
public class BasicThemeBundleContributor : IBundleContributor
{
public class BasicThemeBundleContributor : IBundleContributor
public void AddScripts(BundleContext context)
{
public void AddScripts(BundleContext context)
{
}
}
public void AddStyles(BundleContext context)
{
context.Add("_content/Volo.Abp.AspNetCore.Components.Web.BasicTheme/libs/abp/css/theme.css");
}
public void AddStyles(BundleContext context)
{
context.Add("_content/Volo.Abp.AspNetCore.Components.Web.BasicTheme/libs/abp/css/theme.css");
}
}

31
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/BasicThemeToolbarContributor.cs

@ -6,27 +6,26 @@ using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars;
using Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme;
public class BasicThemeToolbarContributor : IToolbarContributor
{
public class BasicThemeToolbarContributor : IToolbarContributor
public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
{
public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
if (context.Toolbar.Name == StandardToolbars.Main)
{
if (context.Toolbar.Name == StandardToolbars.Main)
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitch)));
//TODO: Can we find a different way to understand if authentication was configured or not?
var authenticationStateProvider = context.ServiceProvider
.GetService<AuthenticationStateProvider>();
if (authenticationStateProvider != null)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitch)));
//TODO: Can we find a different way to understand if authentication was configured or not?
var authenticationStateProvider = context.ServiceProvider
.GetService<AuthenticationStateProvider>();
if (authenticationStateProvider != null)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(LoginDisplay)));
}
context.Toolbar.Items.Add(new ToolbarItem(typeof(LoginDisplay)));
}
return Task.CompletedTask;
}
return Task.CompletedTask;
}
}

93
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor.cs

@ -8,70 +8,69 @@ using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Microsoft.JSInterop;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic;
public partial class LoginDisplay : IDisposable
{
public partial class LoginDisplay : IDisposable
{
[Inject]
protected IMenuManager MenuManager { get; set; }
[Inject]
protected IMenuManager MenuManager { get; set; }
[Inject]
public AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
public AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[CanBeNull]
protected SignOutSessionStateManager SignOutManager;
[CanBeNull]
protected SignOutSessionStateManager SignOutManager;
protected ApplicationMenu Menu { get; set; }
protected ApplicationMenu Menu { get; set; }
protected override async Task OnInitializedAsync()
{
Menu = await MenuManager.GetAsync(StandardMenus.User);
protected override async Task OnInitializedAsync()
{
Menu = await MenuManager.GetAsync(StandardMenus.User);
Navigation.LocationChanged += OnLocationChanged;
Navigation.LocationChanged += OnLocationChanged;
LazyGetService(ref SignOutManager);
LazyGetService(ref SignOutManager);
AuthenticationStateProvider.AuthenticationStateChanged +=
AuthenticationStateProviderOnAuthenticationStateChanged;
}
AuthenticationStateProvider.AuthenticationStateChanged +=
AuthenticationStateProviderOnAuthenticationStateChanged;
}
protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
InvokeAsync(StateHasChanged);
}
protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
InvokeAsync(StateHasChanged);
}
private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task<AuthenticationState> task)
{
Menu = await MenuManager.GetAsync(StandardMenus.User);
await InvokeAsync(StateHasChanged);
}
private async void AuthenticationStateProviderOnAuthenticationStateChanged(Task<AuthenticationState> task)
{
Menu = await MenuManager.GetAsync(StandardMenus.User);
await InvokeAsync(StateHasChanged);
}
public void Dispose()
{
Navigation.LocationChanged -= OnLocationChanged;
AuthenticationStateProvider.AuthenticationStateChanged -=
AuthenticationStateProviderOnAuthenticationStateChanged;
}
public void Dispose()
private async Task NavigateToAsync(string uri, string target = null)
{
if (target == "_blank")
{
Navigation.LocationChanged -= OnLocationChanged;
AuthenticationStateProvider.AuthenticationStateChanged -=
AuthenticationStateProviderOnAuthenticationStateChanged;
await JsRuntime.InvokeVoidAsync("open", uri, target);
}
private async Task NavigateToAsync(string uri, string target = null)
else
{
if (target == "_blank")
{
await JsRuntime.InvokeVoidAsync("open", uri, target);
}
else
{
Navigation.NavigateTo(uri);
}
Navigation.NavigateTo(uri);
}
}
private async Task BeginSignOut()
private async Task BeginSignOut()
{
if (SignOutManager != null)
{
if (SignOutManager != null)
{
await SignOutManager.SetSignOutState();
await NavigateToAsync("authentication/logout");
}
await SignOutManager.SetSignOutState();
await NavigateToAsync("authentication/logout");
}
}
}

97
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs

@ -10,64 +10,63 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theming;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
[DependsOn(
typeof(AbpAspNetCoreMvcUiThemeSharedModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule)
)]
public class AbpAspNetCoreMvcUiBasicThemeModule : AbpModule
{
[DependsOn(
typeof(AbpAspNetCoreMvcUiThemeSharedModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule)
)]
public class AbpAspNetCoreMvcUiBasicThemeModule : AbpModule
public override void PreConfigureServices(ServiceConfigurationContext context)
{
public override void PreConfigureServices(ServiceConfigurationContext context)
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAspNetCoreMvcUiBasicThemeModule).Assembly);
});
}
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAspNetCoreMvcUiBasicThemeModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpThemingOptions>(options =>
{
Configure<AbpThemingOptions>(options =>
{
options.Themes.Add<BasicTheme>();
if (options.DefaultThemeName == null)
{
options.DefaultThemeName = BasicTheme.Name;
}
});
options.Themes.Add<BasicTheme>();
Configure<AbpVirtualFileSystemOptions>(options =>
if (options.DefaultThemeName == null)
{
options.FileSets.AddEmbedded<AbpAspNetCoreMvcUiBasicThemeModule>("Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic");
});
options.DefaultThemeName = BasicTheme.Name;
}
});
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new BasicThemeMainTopToolbarContributor());
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpAspNetCoreMvcUiBasicThemeModule>("Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic");
});
Configure<AbpBundlingOptions>(options =>
{
options
.StyleBundles
.Add(BasicThemeBundles.Styles.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Styles.Global)
.AddContributors(typeof(BasicThemeGlobalStyleContributor));
});
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new BasicThemeMainTopToolbarContributor());
});
options
.ScriptBundles
.Add(BasicThemeBundles.Scripts.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Scripts.Global)
.AddContributors(typeof(BasicThemeGlobalScriptContributor));
});
});
}
Configure<AbpBundlingOptions>(options =>
{
options
.StyleBundles
.Add(BasicThemeBundles.Styles.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Styles.Global)
.AddContributors(typeof(BasicThemeGlobalStyleContributor));
});
options
.ScriptBundles
.Add(BasicThemeBundles.Scripts.Global, bundle =>
{
bundle
.AddBaseBundles(StandardBundles.Scripts.Global)
.AddContributors(typeof(BasicThemeGlobalScriptContributor));
});
});
}
}

33
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/BasicTheme.cs

@ -1,26 +1,25 @@
using Volo.Abp.AspNetCore.Mvc.UI.Theming;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
[ThemeName(Name)]
public class BasicTheme : ITheme, ITransientDependency
{
[ThemeName(Name)]
public class BasicTheme : ITheme, ITransientDependency
{
public const string Name = "Basic";
public const string Name = "Basic";
public virtual string GetLayout(string name, bool fallbackToDefault = true)
public virtual string GetLayout(string name, bool fallbackToDefault = true)
{
switch (name)
{
switch (name)
{
case StandardLayouts.Application:
return "~/Themes/Basic/Layouts/Application.cshtml";
case StandardLayouts.Account:
return "~/Themes/Basic/Layouts/Account.cshtml";
case StandardLayouts.Empty:
return "~/Themes/Basic/Layouts/Empty.cshtml";
default:
return fallbackToDefault ? "~/Themes/Basic/Layouts/Application.cshtml" : null;
}
case StandardLayouts.Application:
return "~/Themes/Basic/Layouts/Application.cshtml";
case StandardLayouts.Account:
return "~/Themes/Basic/Layouts/Account.cshtml";
case StandardLayouts.Empty:
return "~/Themes/Basic/Layouts/Empty.cshtml";
default:
return fallbackToDefault ? "~/Themes/Basic/Layouts/Application.cshtml" : null;
}
}
}

21
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Bundling/BasicThemeBundles.cs

@ -1,15 +1,14 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
public static class BasicThemeBundles
{
public static class BasicThemeBundles
public static class Styles
{
public static class Styles
{
public const string Global = "Basic.Global";
}
public const string Global = "Basic.Global";
}
public static class Scripts
{
public const string Global = "Basic.Global";
}
public static class Scripts
{
public const string Global = "Basic.Global";
}
}
}

13
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Bundling/BasicThemeGlobalScriptContributor.cs

@ -1,12 +1,11 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
public class BasicThemeGlobalScriptContributor : BundleContributor
{
public class BasicThemeGlobalScriptContributor : BundleContributor
public override void ConfigureBundle(BundleConfigurationContext context)
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.Add("/themes/basic/layout.js");
}
context.Files.Add("/themes/basic/layout.js");
}
}
}

11
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Bundling/BasicThemeGlobalStyleContributor.cs

@ -1,12 +1,11 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
public class BasicThemeGlobalStyleContributor : BundleContributor
{
public class BasicThemeGlobalStyleContributor : BundleContributor
public override void ConfigureBundle(BundleConfigurationContext context)
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.Add("/themes/basic/layout.css");
}
context.Files.Add("/themes/basic/layout.css");
}
}

11
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Brand/MainNavbarBrandViewComponent.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Brand
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Brand;
public class MainNavbarBrandViewComponent : AbpViewComponent
{
public class MainNavbarBrandViewComponent : AbpViewComponent
public virtual IViewComponentResult Invoke()
{
public virtual IViewComponentResult Invoke()
{
return View("~/Themes/Basic/Components/Brand/Default.cshtml");
}
return View("~/Themes/Basic/Components/Brand/Default.cshtml");
}
}

11
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/MainNavbar/MainNavbarViewComponent.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.MainNavbar
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.MainNavbar;
public class MainNavbarViewComponent : AbpViewComponent
{
public class MainNavbarViewComponent : AbpViewComponent
public virtual IViewComponentResult Invoke()
{
public virtual IViewComponentResult Invoke()
{
return View("~/Themes/Basic/Components/MainNavbar/Default.cshtml");
}
return View("~/Themes/Basic/Components/MainNavbar/Default.cshtml");
}
}

25
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/MainNavbarMenuViewComponent.cs

@ -2,21 +2,20 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Menu
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Menu;
public class MainNavbarMenuViewComponent : AbpViewComponent
{
public class MainNavbarMenuViewComponent : AbpViewComponent
{
protected IMenuManager MenuManager { get; }
protected IMenuManager MenuManager { get; }
public MainNavbarMenuViewComponent(IMenuManager menuManager)
{
MenuManager = menuManager;
}
public MainNavbarMenuViewComponent(IMenuManager menuManager)
{
MenuManager = menuManager;
}
public virtual async Task<IViewComponentResult> InvokeAsync()
{
var menu = await MenuManager.GetMainMenuAsync();
return View("~/Themes/Basic/Components/Menu/Default.cshtml", menu);
}
public virtual async Task<IViewComponentResult> InvokeAsync()
{
var menu = await MenuManager.GetMainMenuAsync();
return View("~/Themes/Basic/Components/Menu/Default.cshtml", menu);
}
}

23
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/PageAlerts/PageAlertsViewComponent.cs

@ -1,20 +1,19 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Alerts;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.PageAlerts
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.PageAlerts;
public class PageAlertsViewComponent : AbpViewComponent
{
public class PageAlertsViewComponent : AbpViewComponent
{
protected IAlertManager AlertManager { get; }
protected IAlertManager AlertManager { get; }
public PageAlertsViewComponent(IAlertManager alertManager)
{
AlertManager = alertManager;
}
public PageAlertsViewComponent(IAlertManager alertManager)
{
AlertManager = alertManager;
}
public IViewComponentResult Invoke(string name)
{
return View("~/Themes/Basic/Components/PageAlerts/Default.cshtml", AlertManager.Alerts);
}
public IViewComponentResult Invoke(string name)
{
return View("~/Themes/Basic/Components/PageAlerts/Default.cshtml", AlertManager.Alerts);
}
}

75
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponent.cs

@ -6,52 +6,51 @@ using Microsoft.AspNetCore.RequestLocalization;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Localization;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.LanguageSwitch
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.LanguageSwitch;
public class LanguageSwitchViewComponent : AbpViewComponent
{
public class LanguageSwitchViewComponent : AbpViewComponent
protected ILanguageProvider LanguageProvider { get; }
public LanguageSwitchViewComponent(ILanguageProvider languageProvider)
{
protected ILanguageProvider LanguageProvider { get; }
LanguageProvider = languageProvider;
}
public LanguageSwitchViewComponent(ILanguageProvider languageProvider)
{
LanguageProvider = languageProvider;
}
public virtual async Task<IViewComponentResult> InvokeAsync()
{
var languages = await LanguageProvider.GetLanguagesAsync();
var currentLanguage = languages.FindByCulture(
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name
);
public virtual async Task<IViewComponentResult> InvokeAsync()
if (currentLanguage == null)
{
var languages = await LanguageProvider.GetLanguagesAsync();
var currentLanguage = languages.FindByCulture(
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name
);
if (currentLanguage == null)
var abpRequestLocalizationOptionsProvider = HttpContext.RequestServices.GetRequiredService<IAbpRequestLocalizationOptionsProvider>();
var localizationOptions = await abpRequestLocalizationOptionsProvider.GetLocalizationOptionsAsync();
if (localizationOptions.DefaultRequestCulture != null)
{
var abpRequestLocalizationOptionsProvider = HttpContext.RequestServices.GetRequiredService<IAbpRequestLocalizationOptionsProvider>();
var localizationOptions = await abpRequestLocalizationOptionsProvider.GetLocalizationOptionsAsync();
if (localizationOptions.DefaultRequestCulture != null)
{
currentLanguage = new LanguageInfo(
localizationOptions.DefaultRequestCulture.Culture.Name,
localizationOptions.DefaultRequestCulture.UICulture.Name,
localizationOptions.DefaultRequestCulture.UICulture.DisplayName);
}
else
{
currentLanguage = new LanguageInfo(
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name,
CultureInfo.CurrentUICulture.DisplayName);
}
currentLanguage = new LanguageInfo(
localizationOptions.DefaultRequestCulture.Culture.Name,
localizationOptions.DefaultRequestCulture.UICulture.Name,
localizationOptions.DefaultRequestCulture.UICulture.DisplayName);
}
var model = new LanguageSwitchViewComponentModel
else
{
CurrentLanguage = currentLanguage,
OtherLanguages = languages.Where(l => l != currentLanguage).ToList()
};
return View("~/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml", model);
currentLanguage = new LanguageInfo(
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name,
CultureInfo.CurrentUICulture.DisplayName);
}
}
var model = new LanguageSwitchViewComponentModel
{
CurrentLanguage = currentLanguage,
OtherLanguages = languages.Where(l => l != currentLanguage).ToList()
};
return View("~/Themes/Basic/Components/Toolbar/LanguageSwitch/Default.cshtml", model);
}
}

13
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/LanguageSwitch/LanguageSwitchViewComponentModel.cs

@ -1,12 +1,11 @@
using System.Collections.Generic;
using Volo.Abp.Localization;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.LanguageSwitch
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.LanguageSwitch;
public class LanguageSwitchViewComponentModel
{
public class LanguageSwitchViewComponentModel
{
public LanguageInfo CurrentLanguage { get; set; }
public LanguageInfo CurrentLanguage { get; set; }
public List<LanguageInfo> OtherLanguages { get; set; }
}
}
public List<LanguageInfo> OtherLanguages { get; set; }
}

25
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/MainNavbarToolbarViewComponent.cs

@ -2,21 +2,20 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar;
public class MainNavbarToolbarViewComponent : AbpViewComponent
{
public class MainNavbarToolbarViewComponent : AbpViewComponent
{
protected IToolbarManager ToolbarManager { get; }
protected IToolbarManager ToolbarManager { get; }
public MainNavbarToolbarViewComponent(IToolbarManager toolbarManager)
{
ToolbarManager = toolbarManager;
}
public MainNavbarToolbarViewComponent(IToolbarManager toolbarManager)
{
ToolbarManager = toolbarManager;
}
public virtual async Task<IViewComponentResult> InvokeAsync()
{
var toolbar = await ToolbarManager.GetAsync(StandardToolbars.Main);
return View("~/Themes/Basic/Components/Toolbar/Default.cshtml", toolbar);
}
public virtual async Task<IViewComponentResult> InvokeAsync()
{
var toolbar = await ToolbarManager.GetAsync(StandardToolbars.Main);
return View("~/Themes/Basic/Components/Toolbar/Default.cshtml", toolbar);
}
}

25
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Toolbar/UserMenu/UserMenuViewComponent.cs

@ -2,21 +2,20 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.UserMenu
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Toolbar.UserMenu;
public class UserMenuViewComponent : AbpViewComponent
{
public class UserMenuViewComponent : AbpViewComponent
{
protected IMenuManager MenuManager { get; }
protected IMenuManager MenuManager { get; }
public UserMenuViewComponent(IMenuManager menuManager)
{
MenuManager = menuManager;
}
public UserMenuViewComponent(IMenuManager menuManager)
{
MenuManager = menuManager;
}
public virtual async Task<IViewComponentResult> InvokeAsync()
{
var menu = await MenuManager.GetAsync(StandardMenus.User);
return View("~/Themes/Basic/Components/Toolbar/UserMenu/Default.cshtml", menu);
}
public virtual async Task<IViewComponentResult> InvokeAsync()
{
var menu = await MenuManager.GetAsync(StandardMenus.User);
return View("~/Themes/Basic/Components/Toolbar/UserMenu/Default.cshtml", menu);
}
}

43
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Toolbars/BasicThemeMainTopToolbarContributor.cs

@ -6,35 +6,34 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Toolbars;
using Volo.Abp.Localization;
using Volo.Abp.Users;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Toolbars
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Toolbars;
public class BasicThemeMainTopToolbarContributor : IToolbarContributor
{
public class BasicThemeMainTopToolbarContributor : IToolbarContributor
public async Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
{
public async Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
if (context.Toolbar.Name != StandardToolbars.Main)
{
if (context.Toolbar.Name != StandardToolbars.Main)
{
return;
}
return;
}
if (!(context.Theme is BasicTheme))
{
return;
}
if (!(context.Theme is BasicTheme))
{
return;
}
var languageProvider = context.ServiceProvider.GetService<ILanguageProvider>();
var languageProvider = context.ServiceProvider.GetService<ILanguageProvider>();
//TODO: This duplicates GetLanguages() usage. Can we eleminate this?
var languages = await languageProvider.GetLanguagesAsync();
if (languages.Count > 1)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitchViewComponent)));
}
//TODO: This duplicates GetLanguages() usage. Can we eleminate this?
var languages = await languageProvider.GetLanguagesAsync();
if (languages.Count > 1)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitchViewComponent)));
}
if (context.ServiceProvider.GetRequiredService<ICurrentUser>().IsAuthenticated)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(UserMenuViewComponent)));
}
if (context.ServiceProvider.GetRequiredService<ICurrentUser>().IsAuthenticated)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(UserMenuViewComponent)));
}
}
}

23
modules/basic-theme/src/Volo.Abp.BasicTheme.Installer/Volo/Abp/BasicTheme/AbpBasicThemeInstallerModule.cs

@ -2,20 +2,19 @@
using Volo.Abp.Studio;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.BasicTheme
namespace Volo.Abp.BasicTheme;
[DependsOn(
typeof(AbpStudioModuleInstallerModule),
typeof(AbpVirtualFileSystemModule)
)]
public class AbpBasicThemeInstallerModule : AbpModule
{
[DependsOn(
typeof(AbpStudioModuleInstallerModule),
typeof(AbpVirtualFileSystemModule)
)]
public class AbpBasicThemeInstallerModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
Configure<AbpVirtualFileSystemOptions>(options =>
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpBasicThemeInstallerModule>();
});
}
options.FileSets.AddEmbedded<AbpBasicThemeInstallerModule>();
});
}
}

15
modules/basic-theme/src/Volo.Abp.BasicTheme.Installer/Volo/Abp/BasicTheme/BasicThemeInstallerPipelineBuilder.cs

@ -3,15 +3,14 @@ using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Studio.ModuleInstalling;
namespace Volo.Abp.BasicTheme
namespace Volo.Abp.BasicTheme;
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(IModuleInstallingPipelineBuilder))]
public class BasicThemeInstallerPipelineBuilder : ModuleInstallingPipelineBuilderBase, IModuleInstallingPipelineBuilder, ITransientDependency
{
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(IModuleInstallingPipelineBuilder))]
public class BasicThemeInstallerPipelineBuilder : ModuleInstallingPipelineBuilderBase, IModuleInstallingPipelineBuilder, ITransientDependency
public async Task<ModuleInstallingPipeline> BuildAsync(ModuleInstallingContext context)
{
public async Task<ModuleInstallingPipeline> BuildAsync(ModuleInstallingContext context)
{
return GetBasePipeline(context);
}
return GetBasePipeline(context);
}
}

91
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestBase.cs

@ -9,67 +9,66 @@ using Microsoft.Extensions.Hosting;
using Shouldly;
using Volo.Abp.AspNetCore.TestBase;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo;
public abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreIntegratedTestBase<TestStartup>
{
public abstract class AbpAspNetCoreMvcUiBootstrapDemoTestBase : AbpAspNetCoreIntegratedTestBase<TestStartup>
protected override IHostBuilder CreateHostBuilder()
{
protected override IHostBuilder CreateHostBuilder()
{
return base.CreateHostBuilder()
.UseContentRoot(CalculateContentRootPath());
}
return base.CreateHostBuilder()
.UseContentRoot(CalculateContentRootPath());
}
private static string CalculateContentRootPath()
{
return CalculateContentRootPath(
"Volo.Abp.sln",
$"test{Path.DirectorySeparatorChar}Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo"
);
}
private static string CalculateContentRootPath()
{
return CalculateContentRootPath(
"Volo.Abp.sln",
$"test{Path.DirectorySeparatorChar}Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo"
);
}
private static string CalculateContentRootPath(
string testFileNameInTheRootFolder,
string relativeContentPath)
private static string CalculateContentRootPath(
string testFileNameInTheRootFolder,
string relativeContentPath)
{
var currentDirectory = Directory.GetCurrentDirectory();
while (!ContainsFile(currentDirectory, testFileNameInTheRootFolder))
{
var currentDirectory = Directory.GetCurrentDirectory();
while (!ContainsFile(currentDirectory, testFileNameInTheRootFolder))
{
currentDirectory = new DirectoryInfo(currentDirectory).Parent.FullName;
}
if (!relativeContentPath.IsNullOrWhiteSpace())
{
currentDirectory = Path.Combine(currentDirectory, relativeContentPath);
}
return currentDirectory;
currentDirectory = new DirectoryInfo(currentDirectory).Parent.FullName;
}
private static bool ContainsFile(string currentDirectory, string projectFileName)
if (!relativeContentPath.IsNullOrWhiteSpace())
{
return Directory
.GetFiles(currentDirectory, "*.*", SearchOption.TopDirectoryOnly)
.Any(f => Path.GetFileName(f) == projectFileName);
currentDirectory = Path.Combine(currentDirectory, relativeContentPath);
}
return currentDirectory;
}
private static bool ContainsFile(string currentDirectory, string projectFileName)
{
return Directory
.GetFiles(currentDirectory, "*.*", SearchOption.TopDirectoryOnly)
.Any(f => Path.GetFileName(f) == projectFileName);
}
protected virtual async Task<string> GetResponseAsStringAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
protected virtual async Task<string> GetResponseAsStringAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
{
using (var response = await GetResponseAsync(url, expectedStatusCode))
{
using (var response = await GetResponseAsync(url, expectedStatusCode))
{
return await response.Content.ReadAsStringAsync();
}
return await response.Content.ReadAsStringAsync();
}
}
protected virtual async Task<HttpResponseMessage> GetResponseAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
protected virtual async Task<HttpResponseMessage> GetResponseAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
{
using (var requestMessage = new HttpRequestMessage(HttpMethod.Get, url))
{
using (var requestMessage = new HttpRequestMessage(HttpMethod.Get, url))
{
requestMessage.Headers.Add("Accept-Language", CultureInfo.CurrentUICulture.Name);
var response = await Client.SendAsync(requestMessage);
response.StatusCode.ShouldBe(expectedStatusCode);
return response;
}
requestMessage.Headers.Add("Accept-Language", CultureInfo.CurrentUICulture.Name);
var response = await Client.SendAsync(requestMessage);
response.StatusCode.ShouldBe(expectedStatusCode);
return response;
}
}
}

15
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestModule.cs

@ -1,14 +1,13 @@
using Volo.Abp.AspNetCore.TestBase;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo;
[DependsOn(
typeof(AbpAspNetCoreMvcUiBootstrapDemoModule),
typeof(AbpAspNetCoreTestBaseModule)
)]
public class AbpAspNetCoreMvcUiBootstrapDemoTestModule : AbpModule
{
[DependsOn(
typeof(AbpAspNetCoreMvcUiBootstrapDemoModule),
typeof(AbpAspNetCoreTestBaseModule)
)]
public class AbpAspNetCoreMvcUiBootstrapDemoTestModule : AbpModule
{
}
}

15
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/Components/Card_Tests.cs

@ -2,15 +2,14 @@
using Shouldly;
using Xunit;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Components;
public class Card_Tests : AbpAspNetCoreMvcUiBootstrapDemoTestBase
{
public class Card_Tests : AbpAspNetCoreMvcUiBootstrapDemoTestBase
[Fact(Skip = "This test project is not completed yet")]
public async Task Index()
{
[Fact(Skip = "This test project is not completed yet")]
public async Task Index()
{
var result = await GetResponseAsStringAsync("/Components/Cards");
result.ShouldNotBeNullOrEmpty();
}
var result = await GetResponseAsStringAsync("/Components/Cards");
result.ShouldNotBeNullOrEmpty();
}
}

21
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/TestStartup.cs

@ -4,18 +4,17 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo;
public class TestStartup
{
public class TestStartup
public void ConfigureServices(IServiceCollection services)
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoTestModule>();
}
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoTestModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

37
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs

@ -4,27 +4,26 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.Autofac;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo;
[DependsOn(
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAutofacModule)
)]
public class AbpAspNetCoreMvcUiBootstrapDemoModule : AbpModule
{
[DependsOn(
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAutofacModule)
)]
public class AbpAspNetCoreMvcUiBootstrapDemoModule : AbpModule
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseRouting();
app.UseStaticFiles();
app.UseConfiguredEndpoints();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseStaticFiles();
app.UseConfiguredEndpoints();
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Alerts.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class AlertsModel : PageModel
{
public class AlertsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Badges.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class BadgesModel : PageModel
{
public class BadgesModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Blockquotes.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class BlockquotesModel : PageModel
{
public class BlockquotesModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Borders.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class BordersModel : PageModel
{
public class BordersModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Breadcrumbs.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class BreadcrumbsModel : PageModel
{
public class BreadcrumbsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ButtonGroups.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class ButtonGroupsModel : PageModel
{
public class ButtonGroupsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class ButtonsModel : PageModel
{
public class ButtonsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Cards.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class CardsModel : PageModel
{
public class CardsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Carousel.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class CarouselsModel : PageModel
{
public class CarouselsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Collapse.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class CollapseModel : PageModel
{
public class CollapseModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

33
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Dropdowns.cshtml.cs

@ -6,27 +6,26 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class DropdownsModel : PageModel
{
public class DropdownsModel : PageModel
{
[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email Address")]
public string EmailAddress { get; set; }
[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email Address")]
public string EmailAddress { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password{ get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember Me")]
public bool RememberMe{ get; set; }
[Display(Name = "Remember Me")]
public bool RememberMe { get; set; }
public void OnGet()
{
public void OnGet()
{
}
}
}
}

249
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml.cs

@ -7,20 +7,20 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class DynamicFormsModel : PageModel
{
public class DynamicFormsModel : PageModel
{
[BindProperty]
public DetailedModel MyDetailedModel { get; set; }
[BindProperty]
public DetailedModel MyDetailedModel { get; set; }
public OrderExampleModel MyOrderExampleModel { get; set; }
public OrderExampleModel MyOrderExampleModel { get; set; }
public AttributeExamplesModel MyAttributeExamplesModel { get; set; }
public AttributeExamplesModel MyAttributeExamplesModel { get; set; }
public FormContentExampleModel MyFormContentExampleModel { get; set; }
public FormContentExampleModel MyFormContentExampleModel { get; set; }
public List<SelectListItem> CountryList { get; set; } = new List<SelectListItem>
public List<SelectListItem> CountryList { get; set; } = new List<SelectListItem>
{
new SelectListItem { Value = "CA", Text = "Canada"},
new SelectListItem { Value = "US", Text = "USA"},
@ -28,132 +28,131 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
new SelectListItem { Value = "RU", Text = "Russia"}
};
public void OnGet()
{
MyDetailedModel = new DetailedModel
{
Name = "",
Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
IsActive = true,
Age = 65,
Day = DateTime.Now,
MyCarType = CarType.Coupe,
YourCarType = CarType.Sedan,
Country = "RU",
NeighborCountries = new List<string>() { "UK", "CA" }
};
MyFormContentExampleModel = new FormContentExampleModel();
MyOrderExampleModel = new OrderExampleModel();
MyAttributeExamplesModel = new AttributeExamplesModel
{
DisabledInput = "Disabled Input",
ReadonlyInput = "Readonly Input",
LargeInput = "Large Input",
SmallInput = "Small Input"
};
}
public class FormContentExampleModel
public void OnGet()
{
MyDetailedModel = new DetailedModel
{
public string SampleInput { get; set; }
}
Name = "",
Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
IsActive = true,
Age = 65,
Day = DateTime.Now,
MyCarType = CarType.Coupe,
YourCarType = CarType.Sedan,
Country = "RU",
NeighborCountries = new List<string>() { "UK", "CA" }
};
MyFormContentExampleModel = new FormContentExampleModel();
MyOrderExampleModel = new OrderExampleModel();
public class AttributeExamplesModel
MyAttributeExamplesModel = new AttributeExamplesModel
{
[HiddenInput]
public string HiddenInput { get; set; }
DisabledInput = "Disabled Input",
ReadonlyInput = "Readonly Input",
LargeInput = "Large Input",
SmallInput = "Small Input"
};
[DisabledInput]
public string DisabledInput{ get; set; }
}
[ReadOnlyInput]
public string ReadonlyInput { get; set; }
public class FormContentExampleModel
{
public string SampleInput { get; set; }
}
[FormControlSize(AbpFormControlSize.Large)]
public string LargeInput { get; set; }
public class AttributeExamplesModel
{
[HiddenInput]
public string HiddenInput { get; set; }
[FormControlSize(AbpFormControlSize.Small)]
public string SmallInput { get; set; }
}
[DisabledInput]
public string DisabledInput { get; set; }
public class OrderExampleModel
{
[DisplayOrder(10005)]
public string Surname{ get; set; }
[ReadOnlyInput]
public string ReadonlyInput { get; set; }
//Default 10000
public string EmailAddress { get; set; }
[FormControlSize(AbpFormControlSize.Large)]
public string LargeInput { get; set; }
[DisplayOrder(10003)]
public string Name { get; set; }
[FormControlSize(AbpFormControlSize.Small)]
public string SmallInput { get; set; }
}
[DisplayOrder(9999)]
public string City { get; set; }
}
public class OrderExampleModel
{
[DisplayOrder(10005)]
public string Surname { get; set; }
public class DetailedModel
{
[Required]
[Placeholder("Enter your name...")]
[Display(Name = "Name")]
public string Name { get; set; }
[TextArea(Rows = 4)]
[Display(Name = "Description")]
[InputInfoText("Describe Yourself")]
public string Description { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Is Active")]
public bool IsActive { get; set; }
[Required]
[Display(Name = "Age")]
public int Age { get; set; }
[Required]
[Display(Name = "My Car Type")]
public CarType MyCarType { get; set; }
[Required]
[Display(Name = "My Car Type Nullable")]
public CarType? MyCarTypeNullable { get; set; }
[Required]
[AbpRadioButton(Inline = true)]
[Display(Name = "Your Car Type")]
public CarType YourCarType { get; set; }
[DataType(DataType.Date)]
[Display(Name = "Day")]
public DateTime Day { get; set; }
[SelectItems(nameof(CountryList))]
[Display(Name = "Country")]
public string Country { get; set; }
[SelectItems(nameof(CountryList))]
[Display(Name = "Neighbor Countries")]
public List<string> NeighborCountries { get; set; }
[DynamicFormIgnore]
public string IgnoredProperty { get; set; }
}
public enum CarType
{
Sedan,
Hatchback,
StationWagon,
Coupe
}
//Default 10000
public string EmailAddress { get; set; }
[DisplayOrder(10003)]
public string Name { get; set; }
[DisplayOrder(9999)]
public string City { get; set; }
}
public class DetailedModel
{
[Required]
[Placeholder("Enter your name...")]
[Display(Name = "Name")]
public string Name { get; set; }
[TextArea(Rows = 4)]
[Display(Name = "Description")]
[InputInfoText("Describe Yourself")]
public string Description { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Is Active")]
public bool IsActive { get; set; }
[Required]
[Display(Name = "Age")]
public int Age { get; set; }
[Required]
[Display(Name = "My Car Type")]
public CarType MyCarType { get; set; }
[Required]
[Display(Name = "My Car Type Nullable")]
public CarType? MyCarTypeNullable { get; set; }
[Required]
[AbpRadioButton(Inline = true)]
[Display(Name = "Your Car Type")]
public CarType YourCarType { get; set; }
[DataType(DataType.Date)]
[Display(Name = "Day")]
public DateTime Day { get; set; }
[SelectItems(nameof(CountryList))]
[Display(Name = "Country")]
public string Country { get; set; }
[SelectItems(nameof(CountryList))]
[Display(Name = "Neighbor Countries")]
public List<string> NeighborCountries { get; set; }
[DynamicFormIgnore]
public string IgnoredProperty { get; set; }
}
public enum CarType
{
Sedan,
Hatchback,
StationWagon,
Coupe
}
}
}

89
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/FormElements.cshtml.cs

@ -7,14 +7,14 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class FormElementsModel : PageModel
{
public class FormElementsModel : PageModel
{
[BindProperty]
public SampleModel MyModel { get; set; }
[BindProperty]
public SampleModel MyModel { get; set; }
public List<SelectListItem> CityList { get; set; } = new List<SelectListItem>
public List<SelectListItem> CityList { get; set; } = new List<SelectListItem>
{
new SelectListItem { Value = "NY", Text = "New York"},
new SelectListItem { Value = "LDN", Text = "London"},
@ -22,59 +22,58 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
new SelectListItem { Value = "MOS", Text = "Moscow"}
};
public void OnGet()
{
MyModel = new SampleModel();
MyModel.SampleInput0 = "This is a disabled input.";
MyModel.SampleInput1 = "This is a readonly input.";
MyModel.CityRadio = "IST";
}
public void OnGet()
{
MyModel = new SampleModel();
MyModel.SampleInput0 = "This is a disabled input.";
MyModel.SampleInput1 = "This is a readonly input.";
MyModel.CityRadio = "IST";
}
public class SampleModel
{
public string Name { get; set; }
public class SampleModel
{
public string Name { get; set; }
public string SampleInput0 { get; set; }
public string SampleInput0 { get; set; }
public string SampleInput1 { get; set; }
public string SampleInput1 { get; set; }
public string SampleInput2 { get; set; }
public string SampleInput2 { get; set; }
public string LargeInput { get; set; }
public string LargeInput { get; set; }
public string SmallInput { get; set; }
public string SmallInput { get; set; }
[TextArea]
public string Description { get; set; }
[TextArea]
public string Description { get; set; }
public string EmailAddress { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
public string EmailAddress { get; set; }
public bool CheckMeOut { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
public bool DefaultCheckbox { get; set; }
public bool CheckMeOut { get; set; }
public bool DisabledCheckbox { get; set; }
public bool DefaultCheckbox { get; set; }
public CarType CarType { get; set; }
public bool DisabledCheckbox { get; set; }
public string City { get; set; }
public CarType CarType { get; set; }
[Display(Name="City")]
public string CityRadio { get; set; }
public string City { get; set; }
public List<string> Cities { get; set; }
}
[Display(Name = "City")]
public string CityRadio { get; set; }
public enum CarType
{
Sedan,
Hatchback,
StationWagon,
Coupe
}
public List<string> Cities { get; set; }
}
public enum CarType
{
Sedan,
Hatchback,
StationWagon,
Coupe
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Grids.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class GridsModel : PageModel
{
public class GridsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ListGroup.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class ListGroupsModel : PageModel
{
public class ListGroupsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Modals.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class ModalsModel : PageModel
{
public class ModalsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class NavsModel : PageModel
{
public class NavsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

15
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Paginator.cshtml.cs

@ -1,15 +1,14 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class PaginatorModel : PageModel
{
public class PaginatorModel : PageModel
{
public PagerModel PagerModel { get; set; }
public PagerModel PagerModel { get; set; }
public void OnGet(int currentPage, string sort)
{
PagerModel = new PagerModel(100, 10, currentPage, 10, "/Components/Paginator", sort);
}
public void OnGet(int currentPage, string sort)
{
PagerModel = new PagerModel(100, 10, currentPage, 10, "/Components/Paginator", sort);
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Popovers.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class PopoversModel : PageModel
{
public class PopoversModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ProgressBars.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class ProgressBarsModel : PageModel
{
public class ProgressBarsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tables.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class TablesModel : PageModel
{
public class TablesModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tabs.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class TabsModel : PageModel
{
public class TabsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tooltips.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages.Components;
public class TooltipsModel : PageModel
{
public class TooltipsModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Index.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Pages;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

67
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Program.cs

@ -5,44 +5,43 @@ using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo;
public class Program
{
public class Program
public static int Main(string[] args)
{
public static int Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug() //TODO: Should be configurable!
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")
.CreateLogger();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug() //TODO: Should be configurable!
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.File("Logs/logs.txt")
.CreateLogger();
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}

19
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Startup.cs

@ -2,18 +2,17 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo;
public class Startup
{
public class Startup
public void ConfigureServices(IServiceCollection services)
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoModule>();
}
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoModule>();
}
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}

73
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs

@ -11,53 +11,52 @@ using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo;
[DependsOn(
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiThemeSharedDemoModule),
typeof(AbpAutofacModule)
)]
public class AbpAspNetCoreMvcUiThemeBasicDemoModule : AbpModule
{
[DependsOn(
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAspNetCoreMvcUiThemeSharedDemoModule),
typeof(AbpAutofacModule)
)]
public class AbpAspNetCoreMvcUiThemeBasicDemoModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var env = context.Services.GetHostingEnvironment();
if (env.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedDemoModule>(Path.Combine(env.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo", Path.DirectorySeparatorChar)));
});
}
var env = context.Services.GetHostingEnvironment();
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles
.Get(StandardBundles.Styles.Global)
.AddFiles("/demo/styles/main.css");
});
Configure<AbpNavigationOptions>(options =>
if (env.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.MenuContributors.Add(new BasicThemeDemoMenuContributor());
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedDemoModule>(Path.Combine(env.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo", Path.DirectorySeparatorChar)));
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
Configure<AbpBundlingOptions>(options =>
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
options.StyleBundles
.Get(StandardBundles.Styles.Global)
.AddFiles("/demo/styles/main.css");
});
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new BasicThemeDemoMenuContributor());
});
}
app.UseStaticFiles();
app.UseRouting();
app.UseConfiguredEndpoints();
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseStaticFiles();
app.UseRouting();
app.UseConfiguredEndpoints();
}
}

37
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Menus/BasicThemeDemoMenuContributor.cs

@ -3,25 +3,25 @@ using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Menus
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Menus;
public class BasicThemeDemoMenuContributor : IMenuContributor
{
public class BasicThemeDemoMenuContributor : IMenuContributor
public Task ConfigureMenuAsync(MenuConfigurationContext context)
{
public Task ConfigureMenuAsync(MenuConfigurationContext context)
if (context.Menu.Name == StandardMenus.Main)
{
if(context.Menu.Name == StandardMenus.Main)
{
AddMainMenuItems(context);
}
return Task.CompletedTask;
AddMainMenuItems(context);
}
private void AddMainMenuItems(MenuConfigurationContext context)
{
var menuItem = new ApplicationMenuItem(BasicThemeDemoMenus.Components.Root, "Components");
return Task.CompletedTask;
}
var items = new List<ApplicationMenuItem>()
private void AddMainMenuItems(MenuConfigurationContext context)
{
var menuItem = new ApplicationMenuItem(BasicThemeDemoMenus.Components.Root, "Components");
var items = new List<ApplicationMenuItem>()
{
new ApplicationMenuItem(BasicThemeDemoMenus.Components.Alerts, "Alerts", url: "/Components/Alerts"),
new ApplicationMenuItem(BasicThemeDemoMenus.Components.Badges, "Badges", url: "/Components/Badges"),
@ -47,12 +47,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Menus
new ApplicationMenuItem(BasicThemeDemoMenus.Components.Tabs, "Tabs", url: "/Components/Tabs"),
new ApplicationMenuItem(BasicThemeDemoMenus.Components.Tooltips, "Tooltips", url: "/Components/Tooltips")
};
items.OrderBy(x => x.Name)
.ToList()
.ForEach(x => menuItem.AddItem(x));
context.Menu.AddItem(menuItem);
}
items.OrderBy(x => x.Name)
.ToList()
.ForEach(x => menuItem.AddItem(x));
context.Menu.AddItem(menuItem);
}
}

65
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Menus/BasicThemeDemoMenus.cs

@ -1,36 +1,35 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Menus
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Menus;
public class BasicThemeDemoMenus
{
public class BasicThemeDemoMenus
{
private const string Prefix = "BasicThemeDemo";
public const string Home = Prefix + ".Home";
private const string Prefix = "BasicThemeDemo";
public const string Home = Prefix + ".Home";
public static class Components
{
public const string Root = Prefix + ".Components";
public const string Alerts = Root + ".Alerts";
public const string Badges = Root + ".Badges";
public const string Borders = Root + ".Borders";
public const string Breadcrumbs = Root + ".Breadcrumbs";
public const string ButtonGroups = Root + ".ButtonGroups";
public const string Buttons = Root + ".Buttons";
public const string Cards = Root + ".Cards";
public const string Carousel = Root + ".Carousel";
public const string Collapse = Root + ".Collapse";
public const string Dropdowns = Root + ".Dropdowns";
public const string DynamicForms = Root + ".DynamicForms";
public const string FormElements = Root + ".FormElements";
public const string Grids = Root + ".Grids";
public const string ListGroups = Root + ".ListGroups";
public const string Modals = Root + ".Modals";
public const string Navbars = Root + ".Navbars";
public const string Navs = Root + ".Navs";
public const string Paginator = Root + ".Paginator";
public const string Popovers = Root + ".Popovers";
public const string ProgressBars = Root + ".ProgressBars";
public const string Tables = Root + ".Tables";
public const string Tabs = Root + ".Tabs";
public const string Tooltips = Root + ".Tooltips";
}
public static class Components
{
public const string Root = Prefix + ".Components";
public const string Alerts = Root + ".Alerts";
public const string Badges = Root + ".Badges";
public const string Borders = Root + ".Borders";
public const string Breadcrumbs = Root + ".Breadcrumbs";
public const string ButtonGroups = Root + ".ButtonGroups";
public const string Buttons = Root + ".Buttons";
public const string Cards = Root + ".Cards";
public const string Carousel = Root + ".Carousel";
public const string Collapse = Root + ".Collapse";
public const string Dropdowns = Root + ".Dropdowns";
public const string DynamicForms = Root + ".DynamicForms";
public const string FormElements = Root + ".FormElements";
public const string Grids = Root + ".Grids";
public const string ListGroups = Root + ".ListGroups";
public const string Modals = Root + ".Modals";
public const string Navbars = Root + ".Navbars";
public const string Navs = Root + ".Navs";
public const string Paginator = Root + ".Paginator";
public const string Popovers = Root + ".Popovers";
public const string ProgressBars = Root + ".ProgressBars";
public const string Tables = Root + ".Tables";
public const string Tabs = Root + ".Tabs";
public const string Tooltips = Root + ".Tooltips";
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Alerts/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Alerts
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Alerts;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Badges/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Badges
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Badges;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Borders/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Borders
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Borders;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Breadcrumbs/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Breadcrumbs
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Breadcrumbs;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ButtonGroups/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ButtonGroups
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ButtonGroups;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Buttons/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Buttons
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Buttons;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Cards/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Cards
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Cards;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Carousel/Index.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Carousel
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Carousel;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Collapse/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Collapse
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Collapse;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Dropdowns/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Dropdowns
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Dropdowns;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/DynamicForms/Index.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.DynamicForms
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.DynamicForms;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/FormElements/Index.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.FormElements
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.FormElements;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Grids/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Grids
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Grids;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

23
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Index.cshtml.cs

@ -3,20 +3,19 @@ using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Menus;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components;
public class IndexModel : AbpPageModel
{
public class IndexModel : AbpPageModel
{
public readonly IMenuManager _menuManager;
public readonly IMenuManager _menuManager;
public IndexModel(IMenuManager menuManager)
{
_menuManager = menuManager;
}
public IndexModel(IMenuManager menuManager)
{
_menuManager = menuManager;
}
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ListGroups/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ListGroups
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ListGroups;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Modals/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Modals
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Modals;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navbars/Index.cshtml.cs

@ -5,13 +5,12 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Navs/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Navs
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Navs;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

15
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Paginator/Index.cshtml.cs

@ -1,15 +1,14 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Pagination;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Paginator
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Paginator;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
{
public PagerModel PagerModel { get; set; }
public PagerModel PagerModel { get; set; }
public void OnGet(int currentPage = 1, string sort = null)
{
PagerModel = new PagerModel(100, 10, currentPage, 10, "/Components/Paginator", sort);
}
public void OnGet(int currentPage = 1, string sort = null)
{
PagerModel = new PagerModel(100, 10, currentPage, 10, "/Components/Paginator", sort);
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Popovers/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Popovers
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Popovers;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/ProgressBars/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ProgressBars
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.ProgressBars;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tables/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tables
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tables;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tabs/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tabs
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tabs;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Components/Tooltips/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tooltips
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages.Components.Tooltips;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

11
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Pages/Index.cshtml.cs

@ -1,12 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.Pages;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
public void OnGet()
{
public void OnGet()
{
}
}
}
}

67
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Program.cs

@ -4,44 +4,43 @@ using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo;
public class Program
{
public class Program
public static int Main(string[] args)
{
public static int Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog();
}

21
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Startup.cs

@ -2,18 +2,17 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo;
public class Startup
{
public class Startup
public void ConfigureServices(IServiceCollection services)
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<AbpAspNetCoreMvcUiThemeBasicDemoModule>();
}
services.AddApplication<AbpAspNetCoreMvcUiThemeBasicDemoModule>();
}
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
app.InitializeApplication();
}
}
}

Loading…
Cancel
Save