Initial commit
This commit is contained in:
31
Oqtane.Client/Skins/AdminContainer.razor
Normal file
31
Oqtane.Client/Skins/AdminContainer.razor
Normal file
@ -0,0 +1,31 @@
|
||||
@using Oqtane.Shared
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits ContainerBase
|
||||
<div id="modal" class="modal" style="display: block">
|
||||
<div class="modal-content">
|
||||
<a href="@closeurl" class="close">x</a>
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
<h2><ModuleTitle /></h2>
|
||||
<hr style="width: 100%; color: gray; height: 1px; background-color:gray;" />
|
||||
</div>
|
||||
<div class="row px-4">
|
||||
<div class="container">
|
||||
<ModuleInstance />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
string closeurl;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
closeurl = PageState.Alias + PageState.Page.Path;
|
||||
}
|
||||
}
|
||||
|
17
Oqtane.Client/Skins/ContainerBase.cs
Normal file
17
Oqtane.Client/Skins/ContainerBase.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Oqtane.Shared;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
{
|
||||
public class ContainerBase : ComponentBase, IContainerControl
|
||||
{
|
||||
[CascadingParameter]
|
||||
protected PageState PageState { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
protected Module ModuleState { get; set; }
|
||||
|
||||
public virtual string Name { get; set; }
|
||||
}
|
||||
}
|
146
Oqtane.Client/Skins/Controls/ControlPanel.razor
Normal file
146
Oqtane.Client/Skins/Controls/ControlPanel.razor
Normal file
@ -0,0 +1,146 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Oqtane.Services
|
||||
@using Oqtane.Models
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Shared
|
||||
@inherits SkinObjectBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IUserService UserService
|
||||
@inject IModuleDefinitionService ModuleDefinitionService
|
||||
@inject ISkinService SkinService
|
||||
@inject IModuleService ModuleService
|
||||
@inject IPageModuleService PageModuleService
|
||||
|
||||
<div id="actions" class="overlay">
|
||||
<a href="javascript:void(0)" class="closebtn" onclick="closeActions()">x</a>
|
||||
<div class="overlay-content">
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="btn btn-primary" href="@PageUrl("Add")" Match="NavLinkMatch.All">Add Page</NavLink>
|
||||
</li>
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="btn btn-primary" href="@PageUrl("Edit")" Match="NavLinkMatch.All">Edit Page</NavLink>
|
||||
</li>
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="btn btn-primary" href="@PageUrl("Delete")" Match="NavLinkMatch.All">Delete Page</NavLink>
|
||||
</li>
|
||||
</ul>
|
||||
<hr style="width: 100%; color: white; height: 1px; background-color:white;" />
|
||||
<div class="container">
|
||||
<div class="form-group">
|
||||
<label for="Module" class="control-label" style="color: white !important;">Module: </label>
|
||||
@if (moduledefinitions != null)
|
||||
{
|
||||
<select class="form-control" bind="@moduledefinitionname">
|
||||
<option value=""><Select Module></option>
|
||||
@foreach (var moduledefinition in moduledefinitions)
|
||||
{
|
||||
<option value="@moduledefinition.ModuleDefinitionName">@moduledefinition.Name</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Pane" class="control-label" style="color: white !important;">Pane: </label>
|
||||
<select class="form-control" bind="@pane">
|
||||
<option value=""><Select Pane></option>
|
||||
@foreach (string pane in PageState.Page.Panes.Split(';'))
|
||||
{
|
||||
<option value="@pane">@pane Pane</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Title" class="control-label" style="color: white !important;">Title: </label>
|
||||
<input type="text" name="Title" class="form-control" bind="@title" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="Container" class="control-label" style="color: white !important;">Container: </label>
|
||||
<select class="form-control" bind="@containertype">
|
||||
<option value=""><Select Container></option>
|
||||
@foreach (KeyValuePair<string, string> container in containers)
|
||||
{
|
||||
<option value="@container.Key">@container.Value</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary" onclick="@AddModule">Add Module To Page</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="oi oi-menu" style="@display" onclick="openActions()"></span>
|
||||
|
||||
@functions {
|
||||
string display = "display: none";
|
||||
List<ModuleDefinition> moduledefinitions;
|
||||
Dictionary<string, string> containers = new Dictionary<string, string>();
|
||||
int pagemanagementmoduleid;
|
||||
string moduledefinitionname;
|
||||
string pane;
|
||||
string title = "";
|
||||
string containertype;
|
||||
|
||||
protected override async Task OnInitAsync()
|
||||
{
|
||||
moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync();
|
||||
List<Skin> skins = await SkinService.GetSkinsAsync();
|
||||
foreach (Skin skin in skins)
|
||||
{
|
||||
foreach (string container in skin.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
containers.Add(container, skin.Name + " - " + @Utilities.GetTypeNameClass(container));
|
||||
}
|
||||
}
|
||||
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule);
|
||||
pagemanagementmoduleid = modules.FirstOrDefault().ModuleId;
|
||||
if (UserService.IsAuthorized(PageState.User, PageState.Page.EditPermissions))
|
||||
{
|
||||
display = "display: inline";
|
||||
}
|
||||
}
|
||||
|
||||
private async Task AddModule()
|
||||
{
|
||||
Module module = new Module();
|
||||
module.SiteId = PageState.Site.SiteId;
|
||||
module.ModuleDefinitionName = moduledefinitionname;
|
||||
module.ViewPermissions = PageState.Page.ViewPermissions;
|
||||
module.EditPermissions = PageState.Page.EditPermissions;
|
||||
await ModuleService.AddModuleAsync(module);
|
||||
|
||||
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, moduledefinitionname);
|
||||
int ModuleId = modules.LastOrDefault().ModuleId;
|
||||
|
||||
PageModule pagemodule = new PageModule();
|
||||
pagemodule.PageId = PageState.Page.PageId;
|
||||
pagemodule.ModuleId = ModuleId;
|
||||
if (title == "")
|
||||
{
|
||||
title = moduledefinitions.Where(item => item.ModuleDefinitionName == moduledefinitionname).FirstOrDefault().Name;
|
||||
}
|
||||
pagemodule.Title = title;
|
||||
pagemodule.Pane = pane;
|
||||
pagemodule.Order = 0;
|
||||
pagemodule.ContainerType = containertype;
|
||||
await PageModuleService.AddPageModuleAsync(pagemodule);
|
||||
UriHelper.NavigateTo(PageState.Alias + PageState.Page.Path + "?reload=true");
|
||||
}
|
||||
|
||||
private string PageUrl(string action)
|
||||
{
|
||||
string url = "";
|
||||
switch (action)
|
||||
{
|
||||
case "Add":
|
||||
url = "admin/pages?mid=" + pagemanagementmoduleid.ToString() + "&ctl=" + action;
|
||||
break;
|
||||
case "Edit":
|
||||
url = "admin/pages?mid=" + pagemanagementmoduleid.ToString() + "&ctl=" + action + "&id=" + PageState.Page.PageId.ToString();
|
||||
break;
|
||||
case "Delete":
|
||||
url = "admin/pages?mid=" + pagemanagementmoduleid.ToString() + "&ctl=" + action + "&id=" + PageState.Page.PageId.ToString();
|
||||
break;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
41
Oqtane.Client/Skins/Controls/Login.razor
Normal file
41
Oqtane.Client/Skins/Controls/Login.razor
Normal file
@ -0,0 +1,41 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Shared
|
||||
@using Microsoft.JSInterop
|
||||
@inherits SkinObjectBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="@Click">@name</button>
|
||||
|
||||
@functions {
|
||||
string name = "";
|
||||
|
||||
protected override async Task OnInitAsync()
|
||||
{
|
||||
var interop = new Interop(jsRuntime);
|
||||
string user = await interop.GetCookie("user");
|
||||
|
||||
if (user == "")
|
||||
{
|
||||
name = "Login";
|
||||
}
|
||||
else
|
||||
{
|
||||
name = "Logout";
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Click()
|
||||
{
|
||||
if (name == "Login")
|
||||
{
|
||||
UriHelper.NavigateTo(PageState.Alias + "login");
|
||||
}
|
||||
else
|
||||
{
|
||||
var interop = new Interop(jsRuntime);
|
||||
await interop.SetCookie("user", "", 7);
|
||||
UriHelper.NavigateTo(PageState.Alias, true);
|
||||
}
|
||||
}
|
||||
}
|
5
Oqtane.Client/Skins/Controls/Logo.razor
Normal file
5
Oqtane.Client/Skins/Controls/Logo.razor
Normal file
@ -0,0 +1,5 @@
|
||||
@using Oqtane.Skins
|
||||
@inherits SkinObjectBase
|
||||
|
||||
<a href="@PageState.Uri.Scheme://@PageState.Uri.Authority"><img src="/Sites/@PageState.Site.SiteId/@PageState.Site.Logo" /></a>
|
||||
|
58
Oqtane.Client/Skins/Controls/Menu.razor
Normal file
58
Oqtane.Client/Skins/Controls/Menu.razor
Normal file
@ -0,0 +1,58 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Services
|
||||
@using Oqtane.Models;
|
||||
@inherits SkinObjectBase
|
||||
@inject IPageService PageService
|
||||
@inject IUserService UserService
|
||||
|
||||
<ul class="nav flex-column">
|
||||
@if (parent != null)
|
||||
{
|
||||
string url = PageState.Alias + parent.Path;
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="@parent.Path" Match="NavLinkMatch.All">
|
||||
<span class="oi oi-media-skip-backward" aria-hidden="true"></span> Back
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
@foreach (var p in pages)
|
||||
{
|
||||
if (p.IsNavigation && UserService.IsAuthorized(PageState.User, p.ViewPermissions))
|
||||
{
|
||||
string url = PageState.Alias + p.Path;
|
||||
<li class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="@url" Match="NavLinkMatch.All">
|
||||
<span class="oi @p.Icon" aria-hidden="true"></span> @p.Name
|
||||
</NavLink>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
|
||||
@functions {
|
||||
List<Page> pages;
|
||||
Page parent = null;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
// if current page has no children
|
||||
if (PageState.Pages.Where(item => item.ParentId == PageState.Page.PageId).FirstOrDefault() == null)
|
||||
{
|
||||
// display list of pages which have same parent as current page
|
||||
pages = PageState.Pages.Where(item => item.ParentId == PageState.Page.ParentId).ToList();
|
||||
// if current page has parent
|
||||
if (PageState.Page.ParentId != null)
|
||||
{
|
||||
parent = PageState.Pages.Where(item => item.PageId == PageState.Page.ParentId).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// display list of pages which are children of current page
|
||||
pages = PageState.Pages.Where(item => item.ParentId == PageState.Page.PageId).ToList();
|
||||
// current page is parent
|
||||
parent = PageState.Pages.Where(item => item.ParentId == PageState.Page.ParentId).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
44
Oqtane.Client/Skins/Controls/Mode.razor
Normal file
44
Oqtane.Client/Skins/Controls/Mode.razor
Normal file
@ -0,0 +1,44 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Shared;
|
||||
@using Microsoft.JSInterop
|
||||
@inject IJSRuntime jsRuntime
|
||||
|
||||
@inherits SkinObjectBase
|
||||
|
||||
<button type="button" class="btn btn-primary" onclick="@SetMode">
|
||||
@displayMode
|
||||
</button>
|
||||
|
||||
@functions {
|
||||
string displayMode = "";
|
||||
|
||||
protected override async Task OnInitAsync()
|
||||
{
|
||||
var interop = new Interop(jsRuntime);
|
||||
string value = await interop.GetCookie("blazor");
|
||||
|
||||
if (value == "client")
|
||||
{
|
||||
displayMode = "Server Mode";
|
||||
}
|
||||
else
|
||||
{
|
||||
displayMode = "Client Mode";
|
||||
}
|
||||
}
|
||||
|
||||
public async void SetMode()
|
||||
{
|
||||
var interop = new Interop(jsRuntime);
|
||||
string mode = await interop.GetCookie("blazor");
|
||||
if (mode == "client")
|
||||
{
|
||||
mode = "server";
|
||||
}
|
||||
else
|
||||
{
|
||||
mode = "client";
|
||||
}
|
||||
await interop.SetCookie("blazor", mode, 7);
|
||||
}
|
||||
}
|
92
Oqtane.Client/Skins/Controls/ModuleActions.razor
Normal file
92
Oqtane.Client/Skins/Controls/ModuleActions.razor
Normal file
@ -0,0 +1,92 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Services
|
||||
@using Oqtane.Models
|
||||
@inherits ContainerBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject IUserService UserService
|
||||
@inject IPageModuleService PageModuleService
|
||||
|
||||
<div class="dropdown" style="@display">
|
||||
<button class="btn dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
@foreach (var action in actions)
|
||||
{
|
||||
<a class="dropdown-item" onclick="@(async () => await ModuleAction(action.Action))">@action.Name</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
string display = "display: none";
|
||||
List<ActionViewModel> actions;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
actions = new List<ActionViewModel>();
|
||||
if (ModuleState.PaneModuleIndex > 0)
|
||||
{
|
||||
actions.Add(new ActionViewModel { Action = "up", Name = "Move Up" });
|
||||
}
|
||||
if (ModuleState.PaneModuleIndex < (ModuleState.PaneModuleCount - 1))
|
||||
{
|
||||
actions.Add(new ActionViewModel { Action = "down", Name = "Move Down" });
|
||||
}
|
||||
foreach (string pane in PageState.Page.Panes.Split(';'))
|
||||
{
|
||||
if (pane != ModuleState.Pane)
|
||||
{
|
||||
actions.Add(new ActionViewModel { Action = pane, Name = "Move To " + pane + " Pane" });
|
||||
}
|
||||
}
|
||||
actions.Add(new ActionViewModel { Action = "settings", Name = "Settings" });
|
||||
actions.Add(new ActionViewModel { Action = "delete", Name = "Delete" });
|
||||
|
||||
if (UserService.IsAuthorized(PageState.User, ModuleState.EditPermissions))
|
||||
{
|
||||
display = "display: inline";
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task ModuleAction(string action)
|
||||
{
|
||||
PageModule pagemodule = new PageModule();
|
||||
pagemodule.PageModuleId = ModuleState.PageModuleId;
|
||||
pagemodule.PageId = ModuleState.PageId;
|
||||
pagemodule.ModuleId = ModuleState.ModuleId;
|
||||
pagemodule.Title = ModuleState.Title;
|
||||
pagemodule.Pane = ModuleState.Pane;
|
||||
pagemodule.Order = ModuleState.Order;
|
||||
pagemodule.ContainerType = ModuleState.ContainerType;
|
||||
|
||||
string path = PageState.Page.Path + "?reload=true";
|
||||
switch (action)
|
||||
{
|
||||
case "up":
|
||||
pagemodule.Order += -1;
|
||||
await PageModuleService.UpdatePageModuleAsync(pagemodule);
|
||||
break;
|
||||
case "down":
|
||||
pagemodule.Order += 1;
|
||||
await PageModuleService.UpdatePageModuleAsync(pagemodule);
|
||||
break;
|
||||
case "settings":
|
||||
if (path == "") { path += "/"; }
|
||||
path = PageState.Page.Path + "?mid=" + pagemodule.ModuleId.ToString() + "&ctl=Settings";
|
||||
break;
|
||||
case "delete":
|
||||
await PageModuleService.DeletePageModuleAsync(pagemodule.PageModuleId);
|
||||
break;
|
||||
default: // move to pane
|
||||
pagemodule.Pane = action;
|
||||
await PageModuleService.UpdatePageModuleAsync(pagemodule);
|
||||
break;
|
||||
}
|
||||
UriHelper.NavigateTo(PageState.Alias + path);
|
||||
}
|
||||
|
||||
public class ActionViewModel
|
||||
{
|
||||
public string Action { set; get; }
|
||||
public string Name { set; get; }
|
||||
}
|
||||
}
|
4
Oqtane.Client/Skins/Controls/ModuleTitle.razor
Normal file
4
Oqtane.Client/Skins/Controls/ModuleTitle.razor
Normal file
@ -0,0 +1,4 @@
|
||||
@using Oqtane.Skins
|
||||
@inherits ContainerBase
|
||||
|
||||
@ModuleState.Title
|
36
Oqtane.Client/Skins/Controls/Profile.razor
Normal file
36
Oqtane.Client/Skins/Controls/Profile.razor
Normal file
@ -0,0 +1,36 @@
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Shared
|
||||
@using Oqtane.Services;
|
||||
@using Oqtane.Models;
|
||||
@using Microsoft.JSInterop
|
||||
@inject IJSRuntime jsRuntime
|
||||
@inherits SkinObjectBase
|
||||
|
||||
<NavLink class="btn btn-primary" href="@url">@name</NavLink>
|
||||
|
||||
@functions {
|
||||
string name = "";
|
||||
string url = "";
|
||||
|
||||
protected override async Task OnInitAsync()
|
||||
{
|
||||
var interop = new Interop(jsRuntime);
|
||||
string userid = await interop.GetCookie("user");
|
||||
|
||||
if (userid == "")
|
||||
{
|
||||
name = "Register";
|
||||
url = "register";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PageState.User != null)
|
||||
{
|
||||
name = PageState.User.DisplayName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
10
Oqtane.Client/Skins/DefaultContainer.razor
Normal file
10
Oqtane.Client/Skins/DefaultContainer.razor
Normal file
@ -0,0 +1,10 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits ContainerBase
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
<ModuleActions /><ModuleInstance />
|
||||
</div>
|
||||
</div>
|
||||
|
7
Oqtane.Client/Skins/IContainerControl.cs
Normal file
7
Oqtane.Client/Skins/IContainerControl.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Oqtane.Skins
|
||||
{
|
||||
public interface IContainerControl
|
||||
{
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
15
Oqtane.Client/Skins/ISkin.cs
Normal file
15
Oqtane.Client/Skins/ISkin.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
{
|
||||
public interface ISkin
|
||||
{
|
||||
string Name { get; }
|
||||
string Version { get; }
|
||||
string Owner { get; }
|
||||
string Url { get; }
|
||||
string Contact { get; }
|
||||
string License { get; }
|
||||
string Dependencies { get; }
|
||||
}
|
||||
}
|
8
Oqtane.Client/Skins/ISkinControl.cs
Normal file
8
Oqtane.Client/Skins/ISkinControl.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Oqtane.Skins
|
||||
{
|
||||
public interface ISkinControl
|
||||
{
|
||||
string Name { get; }
|
||||
string Panes { get; } // if a skin has different panes, delimit them with ";"
|
||||
}
|
||||
}
|
15
Oqtane.Client/Skins/Skin1/Container1.razor
Normal file
15
Oqtane.Client/Skins/Skin1/Container1.razor
Normal file
@ -0,0 +1,15 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits ContainerBase
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
<ModuleActions /><h2><ModuleTitle /></h2>
|
||||
<hr style="width: 100%; color: gray; height: 1px; background-color:gray;" />
|
||||
</div>
|
||||
<div class="row px-4">
|
||||
<div class="container">
|
||||
<ModuleInstance />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
13
Oqtane.Client/Skins/Skin1/Skin.cs
Normal file
13
Oqtane.Client/Skins/Skin1/Skin.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Oqtane.Skins.Skin1
|
||||
{
|
||||
public class Skin : ISkin
|
||||
{
|
||||
public string Name { get { return "Skin1"; } }
|
||||
public string Version { get { return "1.0.0"; } }
|
||||
public string Owner { get { return ""; } }
|
||||
public string Url { get { return ""; } }
|
||||
public string Contact { get { return ""; } }
|
||||
public string License { get { return ""; } }
|
||||
public string Dependencies { get { return ""; } }
|
||||
}
|
||||
}
|
33
Oqtane.Client/Skins/Skin1/Skin1.razor
Normal file
33
Oqtane.Client/Skins/Skin1/Skin1.razor
Normal file
@ -0,0 +1,33 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
|
||||
<div class="sidebar">
|
||||
<div align="center"><Logo /></div>
|
||||
<Menu />
|
||||
</div>
|
||||
|
||||
<div class="main">
|
||||
<div class="top-row px-4">
|
||||
<h1>@PageState.Page.Name - Skin1</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
<div class="col-sm">
|
||||
<Pane Name="Left" />
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<Pane Name="Right" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-4">
|
||||
<Pane Name="Admin" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Skin1"; } }
|
||||
public override string Panes { get { return "Left;Right"; } }
|
||||
}
|
15
Oqtane.Client/Skins/Skin2/Container2.razor
Normal file
15
Oqtane.Client/Skins/Skin2/Container2.razor
Normal file
@ -0,0 +1,15 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits ContainerBase
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
<ModuleActions /><h2><ModuleTitle /></h2>
|
||||
<hr style="width: 100%; color: gray; height: 1px; background-color:gray;" />
|
||||
</div>
|
||||
<div class="row px-4">
|
||||
<div class="container">
|
||||
<ModuleInstance />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
13
Oqtane.Client/Skins/Skin2/Skin.cs
Normal file
13
Oqtane.Client/Skins/Skin2/Skin.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Oqtane.Skins.Skin2
|
||||
{
|
||||
public class Skin : ISkin
|
||||
{
|
||||
public string Name { get { return "Skin2"; } }
|
||||
public string Version { get { return "1.0.0"; } }
|
||||
public string Owner { get { return ""; } }
|
||||
public string Url { get { return ""; } }
|
||||
public string Contact { get { return ""; } }
|
||||
public string License { get { return ""; } }
|
||||
public string Dependencies { get { return ""; } }
|
||||
}
|
||||
}
|
31
Oqtane.Client/Skins/Skin2/Skin2.razor
Normal file
31
Oqtane.Client/Skins/Skin2/Skin2.razor
Normal file
@ -0,0 +1,31 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
|
||||
<div class="sidebar">
|
||||
<div align="center"><Logo /></div>
|
||||
<Menu />
|
||||
</div>
|
||||
|
||||
<div class="main">
|
||||
<div class="top-row px-4">
|
||||
<h1>@PageState.Page.Name - Skin2</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row px-4">
|
||||
<Pane Name="Top" />
|
||||
</div>
|
||||
<div class="row px-4">
|
||||
<Pane Name="Bottom" />
|
||||
</div>
|
||||
<div class="row px-4">
|
||||
<Pane Name="Admin" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Skin2"; } }
|
||||
public override string Panes { get { return "Top;Bottom"; } }
|
||||
}
|
17
Oqtane.Client/Skins/Skin3/HorizontalLayout.razor
Normal file
17
Oqtane.Client/Skins/Skin3/HorizontalLayout.razor
Normal file
@ -0,0 +1,17 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
|
||||
<div class="row px-4">
|
||||
<div class="col-sm">
|
||||
<Pane Name="Left" />
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<Pane Name="Right" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Horizontal Layout"; } }
|
||||
public override string Panes { get { return "Left;Right"; } }
|
||||
}
|
13
Oqtane.Client/Skins/Skin3/Skin.cs
Normal file
13
Oqtane.Client/Skins/Skin3/Skin.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Oqtane.Skins.Skin3
|
||||
{
|
||||
public class Skin : ISkin
|
||||
{
|
||||
public string Name { get { return "Skin3"; } }
|
||||
public string Version { get { return "1.0.0"; } }
|
||||
public string Owner { get { return ""; } }
|
||||
public string Url { get { return ""; } }
|
||||
public string Contact { get { return ""; } }
|
||||
public string License { get { return ""; } }
|
||||
public string Dependencies { get { return ""; } }
|
||||
}
|
||||
}
|
26
Oqtane.Client/Skins/Skin3/Skin3.razor
Normal file
26
Oqtane.Client/Skins/Skin3/Skin3.razor
Normal file
@ -0,0 +1,26 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Skins.Controls
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
|
||||
<div class="sidebar">
|
||||
<div align="center"><Logo /></div>
|
||||
<Menu />
|
||||
</div>
|
||||
|
||||
<div class="main">
|
||||
<div class="top-row px-4">
|
||||
<h1>@PageState.Page.Name - Skin3</h1> <div class="ml-md-auto"><Profile /> <Login /> <ControlPanel /></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<PaneLayout />
|
||||
<div class="row px-4">
|
||||
<Pane Name="Admin" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Skin3"; } }
|
||||
public override string Panes { get { return ""; } }
|
||||
}
|
15
Oqtane.Client/Skins/Skin3/VerticalLayout.razor
Normal file
15
Oqtane.Client/Skins/Skin3/VerticalLayout.razor
Normal file
@ -0,0 +1,15 @@
|
||||
@using Oqtane.Skins
|
||||
@using Oqtane.Client.Shared
|
||||
@inherits SkinBase
|
||||
|
||||
<div class="row px-4">
|
||||
<Pane Name="Top" />
|
||||
</div>
|
||||
<div class="row px-4">
|
||||
<Pane Name="Bottom" />
|
||||
</div>
|
||||
|
||||
@functions {
|
||||
public override string Name { get { return "Vertical Layout"; } }
|
||||
public override string Panes { get { return "Top;Bottom"; } }
|
||||
}
|
13
Oqtane.Client/Skins/SkinBase.cs
Normal file
13
Oqtane.Client/Skins/SkinBase.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
{
|
||||
public class SkinBase : ComponentBase, ISkinControl
|
||||
{
|
||||
[CascadingParameter]
|
||||
protected PageState PageState { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Panes { get; set; }
|
||||
}
|
||||
}
|
11
Oqtane.Client/Skins/SkinObjectBase.cs
Normal file
11
Oqtane.Client/Skins/SkinObjectBase.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Skins
|
||||
{
|
||||
public class SkinObjectBase : ComponentBase
|
||||
{
|
||||
[CascadingParameter]
|
||||
protected PageState PageState { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user