diff --git a/Oqtane.Client/Modules/Admin/Modules/Settings.razor b/Oqtane.Client/Modules/Admin/Modules/Settings.razor index 98e78bdf..9216a0d5 100644 --- a/Oqtane.Client/Modules/Admin/Modules/Settings.razor +++ b/Oqtane.Client/Modules/Admin/Modules/Settings.razor @@ -105,7 +105,7 @@ protected override async Task OnInitializedAsync() { _title = ModuleState.Title; - _containers = ThemeService.GetContainerTypes(await ThemeService.GetThemesAsync()); + _containers = ThemeService.GetContainerTypes(await ThemeService.GetThemesAsync(), PageState.Page.ThemeType); _containerType = ModuleState.ContainerType; if (!string.IsNullOrEmpty(PageState.Page.DefaultContainerType) && _containerType == PageState.Page.DefaultContainerType) { diff --git a/Oqtane.Client/Modules/Admin/Pages/Add.razor b/Oqtane.Client/Modules/Admin/Pages/Add.razor index 8761ff3a..f5fb7a1a 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Add.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Add.razor @@ -116,27 +116,30 @@ - - - - - - + + @foreach (KeyValuePair panelayout in _panelayouts) { - + if (panelayout.Key == _layouttype) + { + + } + else + { + + } } - else - { - - } - } - - - + + + + } @@ -199,8 +202,8 @@ Cancel @code { - private Dictionary _themes; - private Dictionary _panelayouts; + private Dictionary _themes = new Dictionary(); + private Dictionary _panelayouts = new Dictionary(); private Dictionary _containers = new Dictionary(); private List _themeList; private List _pageList; @@ -233,9 +236,6 @@ _children = PageState.Pages.Where(item => item.ParentId == null).ToList(); _themes = ThemeService.GetThemeTypes(_themeList); - _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); - _containers = ThemeService.GetContainerTypes(_themeList); - _permissions = string.Empty; } catch (Exception ex) @@ -288,11 +288,15 @@ if (_themetype != "-") { _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); + _containers = ThemeService.GetContainerTypes(_themeList, _themetype); } else { _panelayouts = new Dictionary(); + _containers = new Dictionary(); } + _layouttype = "-"; + _containertype = "-"; StateHasChanged(); } catch (Exception ex) diff --git a/Oqtane.Client/Modules/Admin/Pages/Edit.razor b/Oqtane.Client/Modules/Admin/Pages/Edit.razor index b25f6b2e..4c399950 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Edit.razor @@ -127,27 +127,30 @@ - - - - - - + + @foreach (KeyValuePair panelayout in _panelayouts) { - + if (panelayout.Key == _layouttype) + { + + } + else + { + + } } - else - { - - } - } - - - + + + + } @@ -212,8 +215,8 @@ Cancel @code { - private Dictionary _themes; - private Dictionary _panelayouts; + private Dictionary _themes = new Dictionary(); + private Dictionary _panelayouts = new Dictionary(); private Dictionary _containers = new Dictionary(); private List _themeList; private List _pageList; @@ -257,7 +260,6 @@ _children = PageState.Pages.Where(item => item.ParentId == null).ToList(); _themes = ThemeService.GetThemeTypes(_themeList); - _containers = ThemeService.GetContainerTypes(_themeList); _pageId = Int32.Parse(PageState.QueryString["id"]); var page = PageState.Pages.FirstOrDefault(item => item.PageId == _pageId); @@ -291,12 +293,13 @@ { _themetype = "-"; } - _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); + _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, page.ThemeType); _layouttype = page.LayoutType; if (_layouttype == PageState.Site.DefaultLayoutType) { _layouttype = "-"; } + _containers = ThemeService.GetContainerTypes(_themeList, page.ThemeType); _containertype = page.DefaultContainerType; if (string.IsNullOrEmpty(_containertype)) { @@ -370,11 +373,15 @@ if (_themetype != "-") { _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); + _containers = ThemeService.GetContainerTypes(_themeList, _themetype); } else { _panelayouts = new Dictionary(); + _containers = new Dictionary(); } + _layouttype = "-"; + _containertype = "-"; StateHasChanged(); } catch (Exception ex) diff --git a/Oqtane.Client/Modules/Admin/Site/Index.razor b/Oqtane.Client/Modules/Admin/Site/Index.razor index 69a2bbfa..0f271b7a 100644 --- a/Oqtane.Client/Modules/Admin/Site/Index.razor +++ b/Oqtane.Client/Modules/Admin/Site/Index.razor @@ -56,6 +56,7 @@ - - - - - - - - + @if (_panelayouts.Count > 0) + { + + + + + + + + + } - + @foreach (KeyValuePair item in _themes) { @@ -46,27 +46,30 @@ else - - - - - - - - + @if (_panelayouts.Count > 0) + { + + + + + + + + + } - + @foreach (SiteTemplate siteTemplate in _siteTemplates) { @@ -218,10 +221,10 @@ else private string _name = string.Empty; private string _urls = string.Empty; - private string _themetype = string.Empty; - private string _layouttype = string.Empty; - private string _containertype = string.Empty; - private string _sitetemplatetype = string.Empty; + private string _themetype = "-"; + private string _layouttype = "-"; + private string _containertype = "-"; + private string _sitetemplatetype = "-"; public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host; @@ -231,7 +234,6 @@ else _tenants = await TenantService.GetTenantsAsync(); _urls = PageState.Alias.Name; _themes = ThemeService.GetThemeTypes(_themeList); - _containers = ThemeService.GetContainerTypes(_themeList); _siteTemplates = await SiteTemplateService.GetSiteTemplatesAsync(); } @@ -266,12 +268,15 @@ else if (_themetype != string.Empty) { _panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype); + _containers = ThemeService.GetContainerTypes(_themeList, _themetype); } else { _panelayouts = new Dictionary(); + _containers = new Dictionary(); } - + _layouttype = "-"; + _containertype = "-"; StateHasChanged(); } catch (Exception ex) @@ -283,7 +288,7 @@ else private async Task SaveSite() { - if (_tenantid != "-" && _name != string.Empty && _urls != string.Empty && !string.IsNullOrEmpty(_themetype) && (_panelayouts.Count == 0 || !string.IsNullOrEmpty(_layouttype)) && !string.IsNullOrEmpty(_containertype) && !string.IsNullOrEmpty(_sitetemplatetype)) + if (_tenantid != "-" && _name != string.Empty && _urls != string.Empty && _themetype != "-" && (_panelayouts.Count == 0 || _layouttype != "-") && _containertype != "-" && _sitetemplatetype != "-") { var duplicates = new List(); var aliases = await AliasService.GetAliasesAsync(); diff --git a/Oqtane.Client/Modules/Admin/Sites/Edit.razor b/Oqtane.Client/Modules/Admin/Sites/Edit.razor index 698892a7..75e6133f 100644 --- a/Oqtane.Client/Modules/Admin/Sites/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Sites/Edit.razor @@ -39,7 +39,7 @@ - - - - - - - - + @if (_panelayouts.Count > 0) + { + + + + + + + + + }