diff --git a/Oqtane.Client/Themes/BlazorTheme/Default.razor b/Oqtane.Client/Themes/BlazorTheme/Default.razor index 81c7122a..bf62b5c5 100644 --- a/Oqtane.Client/Themes/BlazorTheme/Default.razor +++ b/Oqtane.Client/Themes/BlazorTheme/Default.razor @@ -1,6 +1,5 @@ @namespace Oqtane.Themes.BlazorTheme @inherits ThemeBase -@implements IThemeControl
@@ -31,11 +30,11 @@ public override List Resources => new List() { - new Resource { ResourceType = ResourceType.Stylesheet, Url = "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css", Integrity = "sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T", CrossOrigin = "anonymous" }, + new Resource { ResourceType = ResourceType.Stylesheet, Url = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css", Integrity = "sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk", CrossOrigin = "anonymous" }, new Resource { ResourceType = ResourceType.Stylesheet, Url = ThemePath() + "Theme.css" }, - new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://code.jquery.com/jquery-3.3.1.slim.min.js", Integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo", CrossOrigin = "anonymous" }, - new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", Integrity = "sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", CrossOrigin = "anonymous" }, - new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js", Integrity = "sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM", CrossOrigin = "anonymous" } + new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://code.jquery.com/jquery-3.5.1.slim.min.js", Integrity = "sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj", CrossOrigin = "anonymous" }, + new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js", Integrity = "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo", CrossOrigin = "anonymous" }, + new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js", Integrity = "sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI", CrossOrigin = "anonymous" } }; } \ No newline at end of file diff --git a/Oqtane.Client/Themes/ContainerBase.cs b/Oqtane.Client/Themes/ContainerBase.cs index 86cf85bd..a35c1478 100644 --- a/Oqtane.Client/Themes/ContainerBase.cs +++ b/Oqtane.Client/Themes/ContainerBase.cs @@ -7,5 +7,6 @@ namespace Oqtane.Themes { [CascadingParameter] protected Module ModuleState { get; set; } + } } diff --git a/Oqtane.Client/Themes/Controls/Breadcrumbs.razor b/Oqtane.Client/Themes/Controls/Breadcrumbs.razor index 310132f5..ef902a1c 100644 --- a/Oqtane.Client/Themes/Controls/Breadcrumbs.razor +++ b/Oqtane.Client/Themes/Controls/Breadcrumbs.razor @@ -1,6 +1,5 @@ @namespace Oqtane.Themes.Controls @inherits ThemeControlBase -@attribute [OqtaneIgnore] @if (BreadCrumbPages.Any()) { diff --git a/Oqtane.Client/Themes/Controls/ControlPanel.razor b/Oqtane.Client/Themes/Controls/ControlPanel.razor index 5c24be76..6d74b47f 100644 --- a/Oqtane.Client/Themes/Controls/ControlPanel.razor +++ b/Oqtane.Client/Themes/Controls/ControlPanel.razor @@ -1,6 +1,5 @@ @namespace Oqtane.Themes.Controls @inherits ThemeControlBase -@attribute [OqtaneIgnore] @inject NavigationManager NavigationManager @inject IUserService UserService @inject IModuleDefinitionService ModuleDefinitionService diff --git a/Oqtane.Client/Themes/Controls/Login.razor b/Oqtane.Client/Themes/Controls/Login.razor index ffa46d15..84ef808e 100644 --- a/Oqtane.Client/Themes/Controls/Login.razor +++ b/Oqtane.Client/Themes/Controls/Login.razor @@ -1,6 +1,5 @@ @namespace Oqtane.Themes.Controls @inherits LoginBase -@attribute [OqtaneIgnore] diff --git a/Oqtane.Client/Themes/Controls/Logo.razor b/Oqtane.Client/Themes/Controls/Logo.razor index e189b753..1fa496fb 100644 --- a/Oqtane.Client/Themes/Controls/Logo.razor +++ b/Oqtane.Client/Themes/Controls/Logo.razor @@ -1,6 +1,5 @@ @namespace Oqtane.Themes.Controls @inherits ThemeControlBase -@attribute [OqtaneIgnore] @if (PageState.Site.LogoFileId != null) { diff --git a/Oqtane.Client/Themes/Controls/MenuHorizontal.Razor b/Oqtane.Client/Themes/Controls/MenuHorizontal.Razor index 58159b13..4400ad71 100644 --- a/Oqtane.Client/Themes/Controls/MenuHorizontal.Razor +++ b/Oqtane.Client/Themes/Controls/MenuHorizontal.Razor @@ -1,6 +1,6 @@ @namespace Oqtane.Themes.Controls @inherits MenuBase -@attribute [OqtaneIgnore] + @if (MenuPages.Any()) { diff --git a/Oqtane.Client/Themes/Controls/MenuVertical.razor b/Oqtane.Client/Themes/Controls/MenuVertical.razor index d14573a1..a269df15 100644 --- a/Oqtane.Client/Themes/Controls/MenuVertical.razor +++ b/Oqtane.Client/Themes/Controls/MenuVertical.razor @@ -1,6 +1,6 @@ @namespace Oqtane.Themes.Controls @inherits MenuBase -@attribute [OqtaneIgnore] + @if (MenuPages.Any()) { diff --git a/Oqtane.Client/Themes/Controls/UserProfile.razor b/Oqtane.Client/Themes/Controls/UserProfile.razor index 2f6f0975..a5d95aeb 100644 --- a/Oqtane.Client/Themes/Controls/UserProfile.razor +++ b/Oqtane.Client/Themes/Controls/UserProfile.razor @@ -1,6 +1,6 @@ @namespace Oqtane.Themes.Controls @inherits ThemeControlBase -@attribute [OqtaneIgnore] + @inject NavigationManager NavigationManager diff --git a/Oqtane.Client/Themes/IContainerControl.cs b/Oqtane.Client/Themes/IContainerControl.cs index bfd77a9c..072dd70e 100644 --- a/Oqtane.Client/Themes/IContainerControl.cs +++ b/Oqtane.Client/Themes/IContainerControl.cs @@ -2,7 +2,6 @@ { public interface IContainerControl { - string Name { get; } // friendly name for a container - string Thumbnail { get; } // screen shot of a container - assumed to be in the ThemePath() folder + } } diff --git a/Oqtane.Client/Themes/ILayoutControl.cs b/Oqtane.Client/Themes/ILayoutControl.cs index 69f9cfd1..4aaa961a 100644 --- a/Oqtane.Client/Themes/ILayoutControl.cs +++ b/Oqtane.Client/Themes/ILayoutControl.cs @@ -2,9 +2,6 @@ { public interface ILayoutControl { - string Name { get; } // friendly name for a layout - string Thumbnail { get; } // screen shot of a layout - assumed to be in the ThemePath() folder - string Panes { get; } // identifies all panes in a theme ( delimited by "," or ";" ) } } diff --git a/Oqtane.Client/Themes/OqtaneTheme/Default.razor b/Oqtane.Client/Themes/OqtaneTheme/Default.razor index 5d4e4df9..1878ed09 100644 --- a/Oqtane.Client/Themes/OqtaneTheme/Default.razor +++ b/Oqtane.Client/Themes/OqtaneTheme/Default.razor @@ -1,6 +1,5 @@ @namespace Oqtane.Themes.OqtaneTheme @inherits ThemeBase -@implements IThemeControl
@@ -24,10 +23,10 @@ public override List Resources => new List() { - new Resource { ResourceType = ResourceType.Stylesheet, Url = "https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/cyborg/bootstrap.min.css", Integrity = "sha384-l7xaoY0cJM4h9xh1RfazbgJVUZvdtyLWPueWNtLAphf/UbBgOVzqbOTogxPwYLHM", CrossOrigin = "anonymous" }, + new Resource { ResourceType = ResourceType.Stylesheet, Url = "https://stackpath.bootstrapcdn.com/bootswatch/4.5.0/cyborg/bootstrap.min.css", Integrity = "sha384-GKugkVcT8wqoh3M8z1lqHbU+g6j498/ZT/zuXbepz7Dc09/otQZxTimkEMTkRWHP", CrossOrigin = "anonymous" }, new Resource { ResourceType = ResourceType.Stylesheet, Url = ThemePath() + "Theme.css" }, - new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://code.jquery.com/jquery-3.3.1.slim.min.js", Integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo", CrossOrigin = "anonymous" }, - new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", Integrity = "sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", CrossOrigin = "anonymous" }, - new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js", Integrity = "sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM", CrossOrigin = "anonymous" } + new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://code.jquery.com/jquery-3.5.1.slim.min.js", Integrity = "sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj", CrossOrigin = "anonymous" }, + new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js", Integrity = "sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo", CrossOrigin = "anonymous" }, + new Resource { ResourceType = ResourceType.Script, Bundle = "Bootstrap", Url = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js", Integrity = "sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI", CrossOrigin = "anonymous" } }; } diff --git a/Oqtane.Client/Themes/ThemeBase.cs b/Oqtane.Client/Themes/ThemeBase.cs index d4400ec1..32b9c564 100644 --- a/Oqtane.Client/Themes/ThemeBase.cs +++ b/Oqtane.Client/Themes/ThemeBase.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; namespace Oqtane.Themes { - public abstract class ThemeBase : ComponentBase + public abstract class ThemeBase : ComponentBase, IThemeControl { [Inject] protected IJSRuntime JSRuntime { get; set; } diff --git a/Oqtane.Client/Themes/ThemeControlBase.cs b/Oqtane.Client/Themes/ThemeControlBase.cs index 8cb6e763..ca60120b 100644 --- a/Oqtane.Client/Themes/ThemeControlBase.cs +++ b/Oqtane.Client/Themes/ThemeControlBase.cs @@ -1,5 +1,8 @@ -namespace Oqtane.Themes +using Oqtane.Shared; + +namespace Oqtane.Themes { + [OqtaneIgnore] public abstract class ThemeControlBase : ThemeBase { diff --git a/Oqtane.Client/UI/SiteRouter.razor b/Oqtane.Client/UI/SiteRouter.razor index 662202a7..c3142689 100644 --- a/Oqtane.Client/UI/SiteRouter.razor +++ b/Oqtane.Client/UI/SiteRouter.razor @@ -375,7 +375,7 @@ Type layouttype = Type.GetType(page.LayoutType); if (layouttype != null) { - var layoutobject = Activator.CreateInstance(layouttype) as ILayoutControl; + var layoutobject = Activator.CreateInstance(layouttype) as IThemeControl; if (layoutobject != null) { panes = layoutobject.Panes; diff --git a/Oqtane.Server/Repository/ThemeRepository.cs b/Oqtane.Server/Repository/ThemeRepository.cs index 4d8c26d3..24b57598 100644 --- a/Oqtane.Server/Repository/ThemeRepository.cs +++ b/Oqtane.Server/Repository/ThemeRepository.cs @@ -50,8 +50,9 @@ namespace Oqtane.Repository foreach (Type themeControlType in themeControlTypes) { // Check if type should be ignored - if (themeControlType.IsOqtaneIgnore() - ) continue; + if (themeControlType.IsOqtaneIgnore() || + themeControlType.GetInterfaces().Contains(typeof(ILayoutControl)) || + themeControlType.GetInterfaces().Contains(typeof(IContainerControl))) continue; // create namespace root typename string qualifiedThemeType = themeControlType.Namespace + ", " + themeControlType.Assembly.GetName().Name; @@ -109,7 +110,7 @@ namespace Oqtane.Repository .Where(item => item.GetInterfaces().Contains(typeof(ILayoutControl))).ToArray(); foreach (Type layouttype in layouttypes) { - var layoutobject = Activator.CreateInstance(layouttype) as ILayoutControl; + var layoutobject = Activator.CreateInstance(layouttype) as IThemeControl; theme.Layouts.Add( new ThemeControl { @@ -126,7 +127,7 @@ namespace Oqtane.Repository .Where(item => item.GetInterfaces().Contains(typeof(IContainerControl))).ToArray(); foreach (Type containertype in containertypes) { - var containerobject = Activator.CreateInstance(containertype) as IContainerControl; + var containerobject = Activator.CreateInstance(containertype) as IThemeControl; theme.Containers.Add( new ThemeControl {