Change Skin -> Theme
To better align with commonly used terminology in industry renamed all references from Skin -> Theme.
This commit is contained in:
@ -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<Skin> Skins = await SkinService.GetSkinsAsync();
|
||||
foreach (Skin skin in Skins)
|
||||
List<Theme> 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;
|
||||
|
@ -7,7 +7,7 @@
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IPageService PageService
|
||||
@inject ISkinService SkinService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
<table class="form-group">
|
||||
<tr>
|
||||
@ -61,14 +61,14 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Skin: </label>
|
||||
<label for="Name" class="control-label">Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" bind="@skintype">
|
||||
<option value=""><Select Skin></option>
|
||||
@foreach (KeyValuePair<string, string> skin in skins)
|
||||
<select class="form-control" bind="@themetype">
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in themes)
|
||||
{
|
||||
<option value="@skin.Key">@skin.Value</option>
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
@ -118,7 +118,7 @@
|
||||
@functions {
|
||||
public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } }
|
||||
|
||||
Dictionary<string, string> skins = new Dictionary<string, string>();
|
||||
Dictionary<string, string> themes = new Dictionary<string, string>();
|
||||
Dictionary<string, string> panelayouts = new Dictionary<string, string>();
|
||||
|
||||
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<Skin> Skins = await SkinService.GetSkinsAsync();
|
||||
foreach (Skin skin in Skins)
|
||||
List<Theme> 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);
|
||||
|
@ -7,7 +7,7 @@
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IPageService PageService
|
||||
@inject ISkinService SkinService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
<table class="form-group">
|
||||
<tr>
|
||||
@ -61,14 +61,14 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Skin: </label>
|
||||
<label for="Name" class="control-label">Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" bind="@skintype">
|
||||
<option value=""><Select Skin></option>
|
||||
@foreach (KeyValuePair<string, string> skin in skins)
|
||||
<select class="form-control" bind="@themetype">
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in themes)
|
||||
{
|
||||
<option value="@skin.Key">@skin.Value</option>
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
@ -118,7 +118,7 @@
|
||||
@functions {
|
||||
public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } }
|
||||
|
||||
Dictionary<string, string> skins = new Dictionary<string, string>();
|
||||
Dictionary<string, string> themes = new Dictionary<string, string>();
|
||||
Dictionary<string, string> panelayouts = new Dictionary<string, string>();
|
||||
|
||||
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<Skin> Skins = await SkinService.GetSkinsAsync();
|
||||
foreach (Skin skin in Skins)
|
||||
List<Theme> 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;
|
||||
|
@ -7,7 +7,7 @@
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IPageService PageService
|
||||
@inject ISkinService SkinService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
<table class="form-group">
|
||||
<tr>
|
||||
@ -61,14 +61,14 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Skin: </label>
|
||||
<label for="Name" class="control-label">Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" bind="@skintype">
|
||||
<option value=""><Select Skin></option>
|
||||
@foreach (KeyValuePair<string, string> skin in skins)
|
||||
<select class="form-control" bind="@themetype">
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in themes)
|
||||
{
|
||||
<option value="@skin.Key">@skin.Value</option>
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
@ -118,7 +118,7 @@
|
||||
@functions {
|
||||
public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Admin; } }
|
||||
|
||||
Dictionary<string, string> skins = new Dictionary<string, string>();
|
||||
Dictionary<string, string> themes = new Dictionary<string, string>();
|
||||
Dictionary<string, string> panelayouts = new Dictionary<string, string>();
|
||||
|
||||
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<Skin> Skins = await SkinService.GetSkinsAsync();
|
||||
foreach (Skin skin in Skins)
|
||||
List<Theme> 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);
|
||||
|
@ -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)
|
||||
{
|
||||
<p><em>Loading...</em></p>
|
||||
}
|
||||
@ -19,10 +18,10 @@ else
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var Skin in Skins)
|
||||
@foreach (var theme in Themes)
|
||||
{
|
||||
<tr>
|
||||
<td>@Skin.Name</td>
|
||||
<td>@theme.Name</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
@ -32,10 +31,10 @@ else
|
||||
@functions {
|
||||
public override SecurityAccessLevelEnum SecurityAccessLevel { get { return SecurityAccessLevelEnum.Host; } }
|
||||
|
||||
List<Skin> Skins;
|
||||
List<Theme> Themes;
|
||||
|
||||
protected override async Task OnInitAsync()
|
||||
{
|
||||
Skins = await SkinService.GetSkinsAsync();
|
||||
Themes = await ThemeService.GetThemesAsync();
|
||||
}
|
||||
}
|
@ -4,8 +4,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ISkinService
|
||||
public interface IThemeService
|
||||
{
|
||||
Task<List<Skin>> GetSkinsAsync();
|
||||
Task<List<Theme>> GetThemesAsync();
|
||||
}
|
||||
}
|
||||
|
@ -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<Skin> skins;
|
||||
private List<Theme> 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<List<Skin>> GetSkinsAsync()
|
||||
public async Task<List<Theme>> GetThemesAsync()
|
||||
{
|
||||
if (skins == null)
|
||||
if (themes == null)
|
||||
{
|
||||
skins = await http.GetJsonAsync<List<Skin>>(apiurl);
|
||||
themes = await http.GetJsonAsync<List<Theme>>(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();
|
||||
}
|
||||
}
|
||||
}
|
@ -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";
|
||||
|
@ -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<ModuleDefinition> moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync();
|
||||
List<Models.Skin> skins = await SkinService.GetSkinsAsync();
|
||||
List<Models.Theme> themes = await ThemeService.GetThemesAsync();
|
||||
|
||||
bool reload = false;
|
||||
if (PageState == null)
|
||||
|
@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -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 ";"
|
||||
}
|
||||
}
|
@ -30,7 +30,7 @@ namespace Oqtane.Client
|
||||
{
|
||||
// register singleton core services
|
||||
services.AddSingleton<IModuleDefinitionService, ModuleDefinitionService>();
|
||||
services.AddSingleton<ISkinService, SkinService>();
|
||||
services.AddSingleton<IThemeService, ThemeService>();
|
||||
|
||||
// register scoped core services
|
||||
services.AddScoped<ITenantService, TenantService>();
|
||||
|
@ -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
|
||||
<div id="modal" class="modal" style="display: block">
|
@ -2,7 +2,7 @@
|
||||
using Oqtane.Shared;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
namespace Oqtane.Themes
|
||||
{
|
||||
public class ContainerBase : ComponentBase, IContainerControl
|
||||
{
|
@ -1,13 +1,13 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Oqtane.Services
|
||||
@using Oqtane.Models
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Shared
|
||||
@inherits SkinObjectBase
|
||||
@inherits ThemeObjectBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IUserService UserService
|
||||
@inject IModuleDefinitionService ModuleDefinitionService
|
||||
@inject ISkinService SkinService
|
||||
@inject IThemeService ThemeService
|
||||
@inject IModuleService ModuleService
|
||||
@inject IPageModuleService PageModuleService
|
||||
|
||||
@ -82,13 +82,14 @@
|
||||
|
||||
protected override async Task OnInitAsync()
|
||||
{
|
||||
//TODO: Move this to shared component. This is used in this control Add, Edit, and Delete controls as well
|
||||
moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync();
|
||||
List<Skin> skins = await SkinService.GetSkinsAsync();
|
||||
foreach (Skin skin in skins)
|
||||
List<Theme> 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));
|
||||
}
|
||||
}
|
||||
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule);
|
@ -1,7 +1,7 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Shared
|
||||
@using Microsoft.JSInterop
|
||||
@inherits SkinObjectBase
|
||||
@inherits ThemeObjectBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
@ -1,5 +1,5 @@
|
||||
@using Oqtane.Skins
|
||||
@inherits SkinObjectBase
|
||||
@using Oqtane.Themes
|
||||
@inherits ThemeObjectBase
|
||||
|
||||
<a href="@PageState.Uri.Scheme://@PageState.Uri.Authority"><img src="/Sites/@PageState.Site.SiteId/@PageState.Site.Logo" /></a>
|
||||
|
@ -1,8 +1,8 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Services
|
||||
@using Oqtane.Models;
|
||||
@inherits SkinObjectBase
|
||||
@inherits ThemeObjectBase
|
||||
@inject IPageService PageService
|
||||
@inject IUserService UserService
|
||||
|
@ -1,9 +1,9 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Shared;
|
||||
@using Microsoft.JSInterop
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
||||
@inherits SkinObjectBase
|
||||
@inherits ThemeObjectBase
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="@SetMode">
|
||||
@displayMode
|
@ -1,4 +1,4 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Services
|
||||
@using Oqtane.Models
|
||||
@inherits ContainerBase
|
@ -1,4 +1,4 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@inherits ContainerBase
|
||||
|
||||
@ModuleState.Title
|
@ -1,11 +1,11 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Shared
|
||||
@using Oqtane.Services;
|
||||
@using Oqtane.Models;
|
||||
@using Microsoft.JSInterop
|
||||
@inject IJSRuntime jsRuntime
|
||||
@inherits SkinObjectBase
|
||||
@inherits ThemeObjectBase
|
||||
|
||||
<NavLink class="btn btn-primary" href="@url">@name</NavLink>
|
||||
|
@ -1,5 +1,5 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Themes.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits ContainerBase
|
||||
<div class="container">
|
@ -1,4 +1,4 @@
|
||||
namespace Oqtane.Skins
|
||||
namespace Oqtane.Themes
|
||||
{
|
||||
public interface IContainerControl
|
||||
{
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
namespace Oqtane.Themes
|
||||
{
|
||||
public interface ISkin
|
||||
public interface ITheme
|
||||
{
|
||||
string Name { get; }
|
||||
string Version { get; }
|
8
Oqtane.Client/Themes/IThemeControl.cs
Normal file
8
Oqtane.Client/Themes/IThemeControl.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Oqtane.Themes
|
||||
{
|
||||
public interface IThemeControl
|
||||
{
|
||||
string Name { get; }
|
||||
string Panes { get; } // if a theme has different panes, delimit them with ";"
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Themes.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits ContainerBase
|
||||
<div class="container">
|
@ -1,8 +1,8 @@
|
||||
namespace Oqtane.Skins.Skin2
|
||||
namespace Oqtane.Themes.Theme1
|
||||
{
|
||||
public class Skin : ISkin
|
||||
public class Theme : ITheme
|
||||
{
|
||||
public string Name { get { return "Skin2"; } }
|
||||
public string Name { get { return "Theme1"; } }
|
||||
public string Version { get { return "1.0.0"; } }
|
||||
public string Owner { get { return ""; } }
|
||||
public string Url { get { return ""; } }
|
@ -1,7 +1,7 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Themes.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
@inherits ThemeBase
|
||||
|
||||
<div class="sidebar">
|
||||
<div align="center"><Logo /></div>
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<div class="main">
|
||||
<div class="top-row px-4">
|
||||
<h1>@PageState.Page.Name - Skin1</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
<h1>@PageState.Page.Name - Theme #1</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
@ -28,6 +28,6 @@
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Skin1"; } }
|
||||
public override string Name { get { return "Theme1"; } }
|
||||
public override string Panes { get { return "Left;Right"; } }
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Themes.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits ContainerBase
|
||||
<div class="container">
|
@ -1,8 +1,8 @@
|
||||
namespace Oqtane.Skins.Skin3
|
||||
namespace Oqtane.Themes.Theme2
|
||||
{
|
||||
public class Skin : ISkin
|
||||
public class Theme : ITheme
|
||||
{
|
||||
public string Name { get { return "Skin3"; } }
|
||||
public string Name { get { return "Theme2"; } }
|
||||
public string Version { get { return "1.0.0"; } }
|
||||
public string Owner { get { return ""; } }
|
||||
public string Url { get { return ""; } }
|
@ -1,7 +1,7 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Themes.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
@inherits ThemeBase
|
||||
|
||||
<div class="sidebar">
|
||||
<div align="center"><Logo /></div>
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<div class="main">
|
||||
<div class="top-row px-4">
|
||||
<h1>@PageState.Page.Name - Skin2</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
<h1>@PageState.Page.Name - Theme #2</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
@ -26,6 +26,6 @@
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Skin2"; } }
|
||||
public override string Name { get { return "Theme2"; } }
|
||||
public override string Panes { get { return "Top;Bottom"; } }
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
@inherits ThemeBase
|
||||
|
||||
<div class="row px-4">
|
||||
<div class="col-sm">
|
@ -1,8 +1,8 @@
|
||||
namespace Oqtane.Skins.Skin1
|
||||
namespace Oqtane.Themes.Theme3
|
||||
{
|
||||
public class Skin : ISkin
|
||||
public class Theme : ITheme
|
||||
{
|
||||
public string Name { get { return "Skin1"; } }
|
||||
public string Name { get { return "Theme3"; } }
|
||||
public string Version { get { return "1.0.0"; } }
|
||||
public string Owner { get { return ""; } }
|
||||
public string Url { get { return ""; } }
|
@ -1,7 +1,7 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Themes.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
@inherits ThemeBase
|
||||
|
||||
<div class="sidebar">
|
||||
<div align="center"><Logo /></div>
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<div class="main">
|
||||
<div class="top-row px-4">
|
||||
<h1>@PageState.Page.Name - Skin3</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
<h1>@PageState.Page.Name - Theme #3</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<PaneLayout />
|
||||
@ -21,6 +21,6 @@
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Skin3"; } }
|
||||
public override string Name { get { return "Theme3"; } }
|
||||
public override string Panes { get { return ""; } }
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Themes
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
@inherits ThemeBase
|
||||
|
||||
<div class="row px-4">
|
||||
<Pane Name="Top" />
|
@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
namespace Oqtane.Themes
|
||||
{
|
||||
public class SkinBase : ComponentBase, ISkinControl
|
||||
public class ThemeBase : ComponentBase, IThemeControl
|
||||
{
|
||||
[CascadingParameter]
|
||||
protected PageState PageState { get; set; }
|
@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
namespace Oqtane.Themes
|
||||
{
|
||||
public class SkinObjectBase : ComponentBase
|
||||
public class ThemeObjectBase : ComponentBase
|
||||
{
|
||||
[CascadingParameter]
|
||||
protected PageState PageState { get; set; }
|
Reference in New Issue
Block a user