diff --git a/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor b/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor index 56d523f6..c323d4a9 100644 --- a/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor +++ b/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor @@ -6,7 +6,7 @@ @using Oqtane.Client.Modules.Controls @inherits ModuleBase @inject IUriHelper UriHelper -@inject ISkinService SkinService +@inject IThemeService ThemeService @inject IModuleService ModuleService @inject IPageModuleService PageModuleService @@ -80,12 +80,12 @@ protected override async Task OnInitAsync() { title = ModuleState.Title; - List Skins = await SkinService.GetSkinsAsync(); - foreach (Skin skin in Skins) + List Themes = await ThemeService.GetThemesAsync(); + foreach (Theme theme in Themes) { - foreach (string container in skin.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string container in theme.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - containers.Add(container, skin.Name + " - " + @Utilities.GetTypeNameClass(container)); + containers.Add(container, theme.Name + " - " + @Utilities.GetTypeNameClass(container)); } } containertype = ModuleState.ContainerType; diff --git a/Oqtane.Client/Modules/Admin/Pages/Add.razor b/Oqtane.Client/Modules/Admin/Pages/Add.razor index 4ada70e9..91371a4e 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Add.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Add.razor @@ -7,7 +7,7 @@ @inherits ModuleBase @inject IUriHelper UriHelper @inject IPageService PageService -@inject ISkinService SkinService +@inject IThemeService ThemeService @@ -61,14 +61,14 @@ @@ -118,7 +118,7 @@ @functions { public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } } - Dictionary skins = new Dictionary(); + Dictionary themes = new Dictionary(); Dictionary panelayouts = new Dictionary(); string name; @@ -126,7 +126,7 @@ string parentid; string order = ""; string isnavigation = "True"; - string skintype; + string themetype; string layouttype = ""; string icon = ""; string viewpermissions = "All Users"; @@ -134,16 +134,16 @@ protected override async Task OnInitAsync() { - List Skins = await SkinService.GetSkinsAsync(); - foreach (Skin skin in Skins) + List Themes = await ThemeService.GetThemesAsync(); + foreach (Theme theme in Themes) { - foreach (string skincontrol in skin.SkinControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string themecontrol in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - skins.Add(skincontrol, skin.Name + " - " + @Utilities.GetTypeNameClass(skincontrol)); + themes.Add(themecontrol, theme.Name + " - " + @Utilities.GetTypeNameClass(themecontrol)); } - foreach (string panelayout in skin.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - panelayouts.Add(panelayout, skin.Name + " - " + @Utilities.GetTypeNameClass(panelayout)); + panelayouts.Add(panelayout, theme.Name + " - " + @Utilities.GetTypeNameClass(panelayout)); } } } @@ -164,7 +164,7 @@ p.Path = path; p.Order = (order == null ? 1 : Int32.Parse(order)); p.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation)); - p.SkinType = skintype; + p.ThemeType = themetype; p.LayoutType = (layouttype == null ? "" : layouttype); p.Icon = (icon == null ? "" : icon); Type type; @@ -174,7 +174,7 @@ } else { - type = Type.GetType(skintype); + type = Type.GetType(themetype); } System.Reflection.PropertyInfo property = type.GetProperty("Panes"); p.Panes = (string)property.GetValue(Activator.CreateInstance(type), null); diff --git a/Oqtane.Client/Modules/Admin/Pages/Delete.razor b/Oqtane.Client/Modules/Admin/Pages/Delete.razor index 7a76fa3f..e3d04920 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Delete.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Delete.razor @@ -7,7 +7,7 @@ @inherits ModuleBase @inject IUriHelper UriHelper @inject IPageService PageService -@inject ISkinService SkinService +@inject IThemeService ThemeService
- + - + + @foreach (KeyValuePair item in themes) { - + }
@@ -61,14 +61,14 @@ @@ -118,7 +118,7 @@ @functions { public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } } - Dictionary skins = new Dictionary(); + Dictionary themes = new Dictionary(); Dictionary panelayouts = new Dictionary(); int PageId; @@ -127,7 +127,7 @@ string parentid; string order; string isnavigation; - string skintype; + string themetype; string layouttype; string icon; string viewpermissions; @@ -135,16 +135,16 @@ protected override async Task OnInitAsync() { - List Skins = await SkinService.GetSkinsAsync(); - foreach (Skin skin in Skins) + List Themes = await ThemeService.GetThemesAsync(); + foreach (Theme theme in Themes) { - foreach (string skincontrol in skin.SkinControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string themecontrol in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - skins.Add(skincontrol, skin.Name + " - " + @Utilities.GetTypeNameClass(skincontrol)); + themes.Add(themecontrol, theme.Name + " - " + @Utilities.GetTypeNameClass(themecontrol)); } - foreach (string panelayout in skin.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - panelayouts.Add(panelayout, skin.Name + " - " + @Utilities.GetTypeNameClass(panelayout)); + panelayouts.Add(panelayout, theme.Name + " - " + @Utilities.GetTypeNameClass(panelayout)); } } @@ -157,7 +157,7 @@ order = p.Order.ToString(); isnavigation = p.IsNavigation.ToString(); - skintype = p.SkinType; + themetype = p.ThemeType; layouttype = p.LayoutType; icon = p.Icon; viewpermissions = p.ViewPermissions; diff --git a/Oqtane.Client/Modules/Admin/Pages/Edit.razor b/Oqtane.Client/Modules/Admin/Pages/Edit.razor index 814ff3d7..9a1abda6 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Edit.razor @@ -7,7 +7,7 @@ @inherits ModuleBase @inject IUriHelper UriHelper @inject IPageService PageService -@inject ISkinService SkinService +@inject IThemeService ThemeService
- + - + + @foreach (KeyValuePair item in themes) { - + }
@@ -61,14 +61,14 @@ @@ -118,7 +118,7 @@ @functions { public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } } - Dictionary skins = new Dictionary(); + Dictionary themes = new Dictionary(); Dictionary panelayouts = new Dictionary(); int PageId; @@ -127,7 +127,7 @@ string parentid; string order; string isnavigation; - string skintype; + string themetype; string layouttype; string icon; string viewpermissions; @@ -135,16 +135,16 @@ protected override async Task OnInitAsync() { - List Skins = await SkinService.GetSkinsAsync(); - foreach (Skin skin in Skins) + List Themes = await ThemeService.GetThemesAsync(); + foreach (Theme theme in Themes) { - foreach (string skincontrol in skin.SkinControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string themeControl in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - skins.Add(skincontrol, skin.Name + " - " + @Utilities.GetTypeNameClass(skincontrol)); + themes.Add(themeControl, theme.Name + " - " + @Utilities.GetTypeNameClass(themeControl)); } - foreach (string panelayout in skin.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { - panelayouts.Add(panelayout, skin.Name + " - " + @Utilities.GetTypeNameClass(panelayout)); + panelayouts.Add(panelayout, theme.Name + " - " + @Utilities.GetTypeNameClass(panelayout)); } } @@ -164,7 +164,7 @@ } order = p.Order.ToString(); isnavigation = p.IsNavigation.ToString(); - skintype = p.SkinType; + themetype = p.ThemeType; layouttype = p.LayoutType; icon = p.Icon; viewpermissions = p.ViewPermissions; @@ -188,7 +188,7 @@ p.Path = path; p.Order = (order == null ? 1 : Int32.Parse(order)); p.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation)); - p.SkinType = skintype; + p.ThemeType = themetype; p.LayoutType = (layouttype == null ? "" : layouttype); p.Icon = (icon == null ? "" : icon); Type type; @@ -198,7 +198,7 @@ } else { - type = Type.GetType(skintype); + type = Type.GetType(themetype); } System.Reflection.PropertyInfo property = type.GetProperty("Panes"); p.Panes = (string)property.GetValue(Activator.CreateInstance(type), null); diff --git a/Oqtane.Client/Modules/Admin/Skins/Index.razor b/Oqtane.Client/Modules/Admin/Themes/Index.razor similarity index 69% rename from Oqtane.Client/Modules/Admin/Skins/Index.razor rename to Oqtane.Client/Modules/Admin/Themes/Index.razor index c3815cc4..ac89230e 100644 --- a/Oqtane.Client/Modules/Admin/Skins/Index.razor +++ b/Oqtane.Client/Modules/Admin/Themes/Index.razor @@ -1,12 +1,11 @@ @using Oqtane.Services @using Oqtane.Models @using Oqtane.Modules -@using Oqtane.Client.Modules.Controls @inherits ModuleBase -@inject ISkinService SkinService +@inject IThemeService ThemeService -@if (Skins == null) +@if (Themes == null) {

Loading...

} @@ -19,10 +18,10 @@ else
- @foreach (var Skin in Skins) + @foreach (var theme in Themes) { - + } @@ -32,10 +31,10 @@ else @functions { public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Host; } } - List Skins; + List Themes; protected override async Task OnInitAsync() { - Skins = await SkinService.GetSkinsAsync(); + Themes = await ThemeService.GetThemesAsync(); } } \ No newline at end of file diff --git a/Oqtane.Client/Services/ISkinService.cs b/Oqtane.Client/Services/ISkinService.cs index cf5ee6aa..413960f9 100644 --- a/Oqtane.Client/Services/ISkinService.cs +++ b/Oqtane.Client/Services/ISkinService.cs @@ -4,8 +4,8 @@ using System.Threading.Tasks; namespace Oqtane.Services { - public interface ISkinService + public interface IThemeService { - Task> GetSkinsAsync(); + Task> GetThemesAsync(); } } diff --git a/Oqtane.Client/Services/SkinService.cs b/Oqtane.Client/Services/ThemeService.cs similarity index 64% rename from Oqtane.Client/Services/SkinService.cs rename to Oqtane.Client/Services/ThemeService.cs index d45b25e1..0cccd098 100644 --- a/Oqtane.Client/Services/SkinService.cs +++ b/Oqtane.Client/Services/ThemeService.cs @@ -9,33 +9,33 @@ using System; namespace Oqtane.Services { - public class SkinService : ServiceBase, ISkinService + public class ThemeService : ServiceBase, IThemeService { private readonly HttpClient http; private readonly string apiurl; - private List skins; + private List themes; - public SkinService(HttpClient http, IUriHelper urihelper) + public ThemeService(HttpClient http, IUriHelper urihelper) { this.http = http; - apiurl = CreateApiUrl(urihelper.GetAbsoluteUri(), "Skin"); + apiurl = CreateApiUrl(urihelper.GetAbsoluteUri(), "Theme"); } - public async Task> GetSkinsAsync() + public async Task> GetThemesAsync() { - if (skins == null) + if (themes == null) { - skins = await http.GetJsonAsync>(apiurl); + themes = await http.GetJsonAsync>(apiurl); // get list of loaded assemblies Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); - foreach (Skin skin in skins) + foreach (Theme theme in themes) { - if (skin.Dependencies != "") + if (theme.Dependencies != "") { - foreach (string dependency in skin.Dependencies.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + foreach (string dependency in theme.Dependencies.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { string assemblyname = dependency.Replace(".dll", ""); if (assemblies.Where(item => item.FullName.StartsWith(assemblyname + ",")).FirstOrDefault() == null) @@ -46,15 +46,15 @@ namespace Oqtane.Services } } } - if (assemblies.Where(item => item.FullName.StartsWith(skin.AssemblyName + ",")).FirstOrDefault() == null) + if (assemblies.Where(item => item.FullName.StartsWith(theme.AssemblyName + ",")).FirstOrDefault() == null) { // download assembly from server and load - var bytes = await http.GetByteArrayAsync("_framework/_bin/" + skin.AssemblyName + ".dll"); + var bytes = await http.GetByteArrayAsync("_framework/_bin/" + theme.AssemblyName + ".dll"); Assembly.Load(bytes); } } } - return skins.OrderBy(item => item.Name).ToList(); + return themes.OrderBy(item => item.Name).ToList(); } } } diff --git a/Oqtane.Client/Shared/Constants.cs b/Oqtane.Client/Shared/Constants.cs index f03970ad..54d2d35f 100644 --- a/Oqtane.Client/Shared/Constants.cs +++ b/Oqtane.Client/Shared/Constants.cs @@ -2,9 +2,9 @@ { public class Constants { - public const string DefaultPage = "Oqtane.Client.Shared.Skin, Oqtane.Client"; + public const string DefaultPage = "Oqtane.Client.Shared.Theme, Oqtane.Client"; public const string DefaultContainer = "Oqtane.Client.Shared.Container, Oqtane.Client"; - public const string DefaultAdminContainer = "Oqtane.Client.Skins.AdminContainer, Oqtane.Client"; + public const string DefaultAdminContainer = "Oqtane.Client.Themes.AdminContainer, Oqtane.Client"; public const string DefaultSettingsControl = "Oqtane.Client.Modules.Admin.ModuleSettings.Index, Oqtane.Client"; public const string PageManagementModule = "Oqtane.Client.Modules.Admin.Pages, Oqtane.Client"; public const string DefaultControl = "Index"; diff --git a/Oqtane.Client/Shared/SiteRouter.razor b/Oqtane.Client/Shared/SiteRouter.razor index 7738a170..6b2709fa 100644 --- a/Oqtane.Client/Shared/SiteRouter.razor +++ b/Oqtane.Client/Shared/SiteRouter.razor @@ -13,7 +13,7 @@ @inject IUserService UserService @inject IModuleService ModuleService @inject IModuleDefinitionService ModuleDefinitionService -@inject ISkinService SkinService +@inject IThemeService ThemeService @DynamicComponent @@ -64,7 +64,7 @@ private async Task Refresh() { List moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(); - List skins = await SkinService.GetSkinsAsync(); + List themes = await ThemeService.GetThemesAsync(); bool reload = false; if (PageState == null) diff --git a/Oqtane.Client/Shared/Skin.razor b/Oqtane.Client/Shared/Theme.razor similarity index 62% rename from Oqtane.Client/Shared/Skin.razor rename to Oqtane.Client/Shared/Theme.razor index 7402359e..b3a0a0ec 100644 --- a/Oqtane.Client/Shared/Skin.razor +++ b/Oqtane.Client/Shared/Theme.razor @@ -11,16 +11,16 @@ { DynamicComponent = builder => { - Type skinType = Type.GetType(PageState.Page.SkinType); - if (skinType != null) + Type themeType = Type.GetType(PageState.Page.ThemeType); + if (themeType != null) { - builder.OpenComponent(0, skinType); + builder.OpenComponent(0, themeType); builder.CloseComponent(); } else { - // skin does not exist with type specified - } + // theme does not exist with type specified + } }; } } diff --git a/Oqtane.Client/Skins/ISkinControl.cs b/Oqtane.Client/Skins/ISkinControl.cs deleted file mode 100644 index e4ff116c..00000000 --- a/Oqtane.Client/Skins/ISkinControl.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Oqtane.Skins -{ - public interface ISkinControl - { - string Name { get; } - string Panes { get; } // if a skin has different panes, delimit them with ";" - } -} diff --git a/Oqtane.Client/Startup.cs b/Oqtane.Client/Startup.cs index bd70e41c..24e6152a 100644 --- a/Oqtane.Client/Startup.cs +++ b/Oqtane.Client/Startup.cs @@ -30,7 +30,7 @@ namespace Oqtane.Client { // register singleton core services services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); // register scoped core services services.AddScoped(); diff --git a/Oqtane.Client/Skins/AdminContainer.razor b/Oqtane.Client/Themes/AdminContainer.razor similarity index 92% rename from Oqtane.Client/Skins/AdminContainer.razor rename to Oqtane.Client/Themes/AdminContainer.razor index f6915d57..9f5937d3 100644 --- a/Oqtane.Client/Skins/AdminContainer.razor +++ b/Oqtane.Client/Themes/AdminContainer.razor @@ -1,6 +1,6 @@ @using Oqtane.Shared -@using Oqtane.Skins -@using Oqtane.Client.Skins.Controls +@using Oqtane.Themes +@using Oqtane.Client.Themes.Controls @using Oqtane.Client.Shared @inherits ContainerBase
- + - + + @foreach (KeyValuePair item in themes) { - + }
@Skin.Name@theme.Name