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 @@
-
-
-
- |
-
-
+ |
+
+ }
@@ -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)
+ @if (_panelayouts.Count > 0)
+ {
+
+
+
+ |
+
+
+
+ @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 @@
|
ThemeChanged(e))">
+
@foreach (KeyValuePair item in _themes)
{
if (item.Key == _themetype)
@@ -70,25 +71,30 @@
|
-
-
-
- |
-
-
- @foreach (KeyValuePair panelayout in _panelayouts)
- {
-
- }
-
- |
-
+ @if (_panelayouts.Count > 0)
+ {
+
+
+
+ |
+
+
+
+ @foreach (KeyValuePair panelayout in _panelayouts)
+ {
+
+ }
+
+ |
+
+ }
|
+
@foreach (KeyValuePair container in _containers)
{
@@ -205,9 +211,9 @@
}
@code {
- private Dictionary _themes;
- private Dictionary _panelayouts;
- private Dictionary _containers;
+ private Dictionary _themes = new Dictionary();
+ private Dictionary _panelayouts = new Dictionary();
+ private Dictionary _containers = new Dictionary();
private List _themeList;
private string _name = string.Empty;
private List _tenantList;
@@ -218,9 +224,9 @@
private FileManager _logofilemanager;
private int _faviconfileid = -1;
private FileManager _faviconfilemanager;
- private string _themetype;
- private string _layouttype;
- private string _containertype;
+ private string _themetype = "-";
+ private string _layouttype = "-";
+ private string _containertype = "-";
private string _allowregistration;
private string _smtphost = string.Empty;
private string _smtpport = string.Empty;
@@ -271,6 +277,7 @@
_themetype = site.DefaultThemeType;
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
_layouttype = site.DefaultLayoutType;
+ _containers = ThemeService.GetContainerTypes(_themeList, _themetype);
_containertype = site.DefaultContainerType;
_allowregistration = site.AllowRegistration.ToString();
@@ -313,7 +320,7 @@
}
_themes = ThemeService.GetThemeTypes(_themeList);
- _containers = ThemeService.GetContainerTypes(_themeList);
+ _containers = ThemeService.GetContainerTypes(_themeList, _themetype);
}
catch (Exception ex)
{
@@ -330,11 +337,15 @@
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)
@@ -348,7 +359,7 @@
{
try
{
- if (_name != string.Empty && _urls != string.Empty && !string.IsNullOrEmpty(_themetype) && (_panelayouts.Count == 0 || !string.IsNullOrEmpty(_layouttype)) && !string.IsNullOrEmpty(_containertype))
+ if (_name != string.Empty && _urls != string.Empty && _themetype != "-" && (_panelayouts.Count == 0 || _layouttype != "-") && _containertype != "-")
{
var unique = true;
foreach (string name in _urls.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
@@ -373,7 +384,7 @@
}
site.DefaultThemeType = _themetype;
- site.DefaultLayoutType = (_layouttype == null ? string.Empty : _layouttype);
+ site.DefaultLayoutType = (_layouttype == "-" ? string.Empty : _layouttype);
site.DefaultContainerType = _containertype;
site.AllowRegistration = (_allowregistration == null ? true : Boolean.Parse(_allowregistration));
site.IsDeleted = (_isdeleted == null ? true : Boolean.Parse(_isdeleted));
diff --git a/Oqtane.Client/Modules/Admin/Sites/Add.razor b/Oqtane.Client/Modules/Admin/Sites/Add.razor
index 40ac6f39..2704f6cb 100644
--- a/Oqtane.Client/Modules/Admin/Sites/Add.razor
+++ b/Oqtane.Client/Modules/Admin/Sites/Add.razor
@@ -38,7 +38,7 @@ else
|
ThemeChanged(e))">
-
+
@foreach (KeyValuePair item in _themes)
{
@@ -46,27 +46,30 @@ else
|
-
-
-
- |
-
-
-
- @foreach (KeyValuePair panelayout in _panelayouts)
- {
-
- }
-
- |
-
+ @if (_panelayouts.Count > 0)
+ {
+
+
+
+ |
+
+
+
+ @foreach (KeyValuePair panelayout in _panelayouts)
+ {
+
+ }
+
+ |
+
+ }
|
-
+
@foreach (KeyValuePair container in _containers)
{
@@ -80,7 +83,7 @@ else
|
-
+
@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 @@
|
ThemeChanged(e))">
-
+
@foreach (KeyValuePair item in _themes)
{
if (item.Key == _themetype)
@@ -54,27 +54,30 @@
|
-
-
-
- |
-
-
-
- @foreach (KeyValuePair panelayout in _panelayouts)
- {
-
- }
-
- |
-
+ @if (_panelayouts.Count > 0)
+ {
+
+
+
+ |
+
+
+
+ @foreach (KeyValuePair panelayout in _panelayouts)
+ {
+
+ }
+
+ |
+
+ }
|
-
+
@foreach (KeyValuePair container in _containers)
{
@@ -103,9 +106,9 @@
}
@code {
- private Dictionary _themes;
- private Dictionary _panelayouts;
- private Dictionary _containers;
+ private Dictionary _themes = new Dictionary();
+ private Dictionary _panelayouts = new Dictionary();
+ private Dictionary _containers = new Dictionary();
private Alias _alias;
private List _themeList;
private string _name = string.Empty;
@@ -147,9 +150,11 @@
_urls += alias.Name + "\n";
}
+ _themes = ThemeService.GetThemeTypes(_themeList);
_themetype = site.DefaultThemeType;
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
_layouttype = site.DefaultLayoutType;
+ _containers = ThemeService.GetContainerTypes(_themeList, _themetype);
_containertype = site.DefaultContainerType;
_createdby = site.CreatedBy;
_createdon = site.CreatedOn;
@@ -159,9 +164,6 @@
_deletedon = site.DeletedOn;
_isdeleted = site.IsDeleted.ToString();
}
-
- _themes = ThemeService.GetThemeTypes(_themeList);
- _containers = ThemeService.GetContainerTypes(_themeList);
}
catch (Exception ex)
{
@@ -178,12 +180,15 @@
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)
@@ -197,7 +202,7 @@
{
try
{
- if (_name != string.Empty && _urls != string.Empty && !string.IsNullOrEmpty(_themetype) && (_panelayouts.Count == 0 || !string.IsNullOrEmpty(_layouttype)) && !string.IsNullOrEmpty(_containertype))
+ if (_name != string.Empty && _urls != string.Empty && _themetype != "-" && (_panelayouts.Count == 0 || _layouttype != "-") && _containertype != "-")
{
var unique = true;
foreach (string name in _urls.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
diff --git a/Oqtane.Client/Services/Interfaces/IThemeService.cs b/Oqtane.Client/Services/Interfaces/IThemeService.cs
index 8756042b..32bb01ad 100644
--- a/Oqtane.Client/Services/Interfaces/IThemeService.cs
+++ b/Oqtane.Client/Services/Interfaces/IThemeService.cs
@@ -9,7 +9,7 @@ namespace Oqtane.Services
Task> GetThemesAsync();
Dictionary GetThemeTypes(List themes);
Dictionary GetPaneLayoutTypes(List themes, string themeName);
- Dictionary GetContainerTypes(List themes);
+ Dictionary GetContainerTypes(List themes, string themeName);
Task InstallThemesAsync();
Task DeleteThemeAsync(string themeName);
}
diff --git a/Oqtane.Client/Services/ThemeService.cs b/Oqtane.Client/Services/ThemeService.cs
index ddb47158..a2250d95 100644
--- a/Oqtane.Client/Services/ThemeService.cs
+++ b/Oqtane.Client/Services/ThemeService.cs
@@ -43,8 +43,8 @@ namespace Oqtane.Services
{
var selectablePaneLayouts = new Dictionary();
foreach (Theme theme in themes)
- {
- if (themeName.StartsWith(theme.ThemeName))
+ {
+ if (Utilities.GetTypeName(themeName).StartsWith(Utilities.GetTypeName(theme.ThemeName)))
{
foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
@@ -55,14 +55,17 @@ namespace Oqtane.Services
return selectablePaneLayouts;
}
- public Dictionary GetContainerTypes(List themes)
+ public Dictionary GetContainerTypes(List themes, string themeName)
{
var selectableContainers = new Dictionary();
foreach (Theme theme in themes)
{
- foreach (string container in theme.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
+ if (Utilities.GetTypeName(themeName).StartsWith(Utilities.GetTypeName(theme.ThemeName)))
{
- selectableContainers.Add(container, theme.Name + " - " + @Utilities.GetTypeNameLastSegment(container, 0));
+ foreach (string container in theme.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
+ {
+ selectableContainers.Add(container, theme.Name + " - " + @Utilities.GetTypeNameLastSegment(container, 0));
+ }
}
}
return selectableContainers;
diff --git a/Oqtane.Client/Themes/Controls/ControlPanel.razor b/Oqtane.Client/Themes/Controls/ControlPanel.razor
index 2da8f847..8fa031d5 100644
--- a/Oqtane.Client/Themes/Controls/ControlPanel.razor
+++ b/Oqtane.Client/Themes/Controls/ControlPanel.razor
@@ -301,7 +301,7 @@
var panes = PageState.Page.Panes;
Pane = panes.Count() == 1 ? panes.SingleOrDefault() : "";
var themes = await ThemeService.GetThemesAsync();
- _containers = ThemeService.GetContainerTypes(themes);
+ _containers = ThemeService.GetContainerTypes(themes, PageState.Page.ThemeType);
ContainerType = PageState.Site.DefaultContainerType;
_allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
|