commit
a4ed06f2fc
|
@ -1 +0,0 @@
|
||||||
This is the location where static resources for third party libraries should be located ( the third party library assemblies will be included in the /lib folder ). They should be placed in subfolders which match the naming convention of the third party library. When the module package is deployed the static resource subfolders will be extracted under the web root.
|
|
|
@ -117,8 +117,9 @@
|
||||||
{
|
{
|
||||||
if (firstRender)
|
if (firstRender)
|
||||||
{
|
{
|
||||||
await RichTextEditorInterop.CreateEditor(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
|
||||||
|
await interop.CreateEditor(
|
||||||
_editorElement,
|
_editorElement,
|
||||||
_toolBar,
|
_toolBar,
|
||||||
ReadOnly,
|
ReadOnly,
|
||||||
|
@ -126,14 +127,10 @@
|
||||||
Theme,
|
Theme,
|
||||||
DebugLevel);
|
DebugLevel);
|
||||||
|
|
||||||
await RichTextEditorInterop.LoadEditorContent(
|
await interop.LoadEditorContent(_editorElement, Content);
|
||||||
JsRuntime,
|
|
||||||
_editorElement, Content);
|
|
||||||
|
|
||||||
// preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
|
// preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
|
||||||
_original = await RichTextEditorInterop.GetHtml(
|
_original = await interop.GetHtml(_editorElement);
|
||||||
JsRuntime,
|
|
||||||
_editorElement);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,25 +143,22 @@
|
||||||
|
|
||||||
public async Task RefreshRichText()
|
public async Task RefreshRichText()
|
||||||
{
|
{
|
||||||
await RichTextEditorInterop.LoadEditorContent(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
await interop.LoadEditorContent(_editorElement, _content);
|
||||||
_editorElement, _content);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RefreshRawHtml()
|
public async Task RefreshRawHtml()
|
||||||
{
|
{
|
||||||
_content = await RichTextEditorInterop.GetHtml(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
_content = await interop.GetHtml(_editorElement);
|
||||||
_editorElement);
|
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> GetHtml()
|
public async Task<string> GetHtml()
|
||||||
{
|
{
|
||||||
// get rich text content
|
// get rich text content
|
||||||
string content = await RichTextEditorInterop.GetHtml(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
string content = await interop.GetHtml(_editorElement);
|
||||||
_editorElement);
|
|
||||||
|
|
||||||
if (_original != content)
|
if (_original != content)
|
||||||
{
|
{
|
||||||
|
@ -185,9 +179,8 @@
|
||||||
var fileid = _fileManager.GetFileId();
|
var fileid = _fileManager.GetFileId();
|
||||||
if (fileid != -1)
|
if (fileid != -1)
|
||||||
{
|
{
|
||||||
await RichTextEditorInterop.InsertImage(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
await interop.InsertImage(_editorElement, ContentUrl(fileid));
|
||||||
_editorElement, ContentUrl(fileid));
|
|
||||||
_filemanagervisible = false;
|
_filemanagervisible = false;
|
||||||
_message = string.Empty;
|
_message = string.Empty;
|
||||||
}
|
}
|
||||||
|
@ -207,22 +200,19 @@
|
||||||
// other rich text editor methods which can be used by developers
|
// other rich text editor methods which can be used by developers
|
||||||
public async Task<string> GetText()
|
public async Task<string> GetText()
|
||||||
{
|
{
|
||||||
return await RichTextEditorInterop.GetText(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
return await interop.GetText(_editorElement);
|
||||||
_editorElement);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string> GetContent()
|
public async Task<string> GetContent()
|
||||||
{
|
{
|
||||||
return await RichTextEditorInterop.GetContent(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
return await interop.GetContent(_editorElement);
|
||||||
_editorElement);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task EnableEditor(bool mode)
|
public async Task EnableEditor(bool mode)
|
||||||
{
|
{
|
||||||
await RichTextEditorInterop.EnableEditor(
|
var interop = new RichTextEditorInterop(JsRuntime);
|
||||||
JsRuntime,
|
await interop.EnableEditor(_editorElement, mode);
|
||||||
_editorElement, mode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,16 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Oqtane.Modules.Controls
|
namespace Oqtane.Modules.Controls
|
||||||
{
|
{
|
||||||
public static class RichTextEditorInterop
|
public class RichTextEditorInterop
|
||||||
{
|
{
|
||||||
internal static ValueTask<object> CreateEditor(
|
private readonly IJSRuntime _jsRuntime;
|
||||||
IJSRuntime jsRuntime,
|
|
||||||
|
public RichTextEditorInterop(IJSRuntime jsRuntime)
|
||||||
|
{
|
||||||
|
_jsRuntime = jsRuntime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task CreateEditor(
|
||||||
ElementReference quillElement,
|
ElementReference quillElement,
|
||||||
ElementReference toolbar,
|
ElementReference toolbar,
|
||||||
bool readOnly,
|
bool readOnly,
|
||||||
|
@ -15,66 +21,104 @@ namespace Oqtane.Modules.Controls
|
||||||
string theme,
|
string theme,
|
||||||
string debugLevel)
|
string debugLevel)
|
||||||
{
|
{
|
||||||
return jsRuntime.InvokeAsync<object>(
|
try
|
||||||
"interop.createQuill",
|
{
|
||||||
quillElement, toolbar, readOnly,
|
_jsRuntime.InvokeAsync<object>(
|
||||||
placeholder, theme, debugLevel);
|
"interop.createQuill",
|
||||||
|
quillElement, toolbar, readOnly,
|
||||||
|
placeholder, theme, debugLevel);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ValueTask<string> GetText(
|
public ValueTask<string> GetText(ElementReference quillElement)
|
||||||
IJSRuntime jsRuntime,
|
|
||||||
ElementReference quillElement)
|
|
||||||
{
|
{
|
||||||
return jsRuntime.InvokeAsync<string>(
|
try
|
||||||
"interop.getQuillText",
|
{
|
||||||
quillElement);
|
return _jsRuntime.InvokeAsync<string>(
|
||||||
|
"interop.getQuillText",
|
||||||
|
quillElement);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return new ValueTask<string>(Task.FromResult(string.Empty));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ValueTask<string> GetHtml(
|
public ValueTask<string> GetHtml(ElementReference quillElement)
|
||||||
IJSRuntime jsRuntime,
|
|
||||||
ElementReference quillElement)
|
|
||||||
{
|
{
|
||||||
return jsRuntime.InvokeAsync<string>(
|
try
|
||||||
"interop.getQuillHTML",
|
{
|
||||||
quillElement);
|
return _jsRuntime.InvokeAsync<string>(
|
||||||
|
"interop.getQuillHTML",
|
||||||
|
quillElement);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return new ValueTask<string>(Task.FromResult(string.Empty));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ValueTask<string> GetContent(
|
public ValueTask<string> GetContent(ElementReference quillElement)
|
||||||
IJSRuntime jsRuntime,
|
|
||||||
ElementReference quillElement)
|
|
||||||
{
|
{
|
||||||
return jsRuntime.InvokeAsync<string>(
|
try
|
||||||
"interop.getQuillContent",
|
{
|
||||||
quillElement);
|
return _jsRuntime.InvokeAsync<string>(
|
||||||
|
"interop.getQuillContent",
|
||||||
|
quillElement);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return new ValueTask<string>(Task.FromResult(string.Empty));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ValueTask<object> LoadEditorContent(
|
public Task LoadEditorContent(ElementReference quillElement, string content)
|
||||||
IJSRuntime jsRuntime,
|
|
||||||
ElementReference quillElement,
|
|
||||||
string content)
|
|
||||||
{
|
{
|
||||||
return jsRuntime.InvokeAsync<object>(
|
try
|
||||||
"interop.loadQuillContent",
|
{
|
||||||
quillElement, content);
|
_jsRuntime.InvokeAsync<object>(
|
||||||
|
"interop.loadQuillContent",
|
||||||
|
quillElement, content);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ValueTask<object> EnableEditor(
|
public Task EnableEditor(ElementReference quillElement, bool mode)
|
||||||
IJSRuntime jsRuntime,
|
|
||||||
ElementReference quillElement,
|
|
||||||
bool mode)
|
|
||||||
{
|
{
|
||||||
return jsRuntime.InvokeAsync<object>(
|
try
|
||||||
"interop.enableQuillEditor", quillElement, mode);
|
{
|
||||||
|
_jsRuntime.InvokeAsync<object>(
|
||||||
|
"interop.enableQuillEditor", quillElement, mode);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ValueTask<object> InsertImage(
|
public Task InsertImage(ElementReference quillElement, string imageUrl)
|
||||||
IJSRuntime jsRuntime,
|
|
||||||
ElementReference quillElement,
|
|
||||||
string imageUrl)
|
|
||||||
{
|
{
|
||||||
return jsRuntime.InvokeAsync<object>(
|
try
|
||||||
"interop.insertQuillImage",
|
{
|
||||||
quillElement, imageUrl);
|
_jsRuntime.InvokeAsync<object>(
|
||||||
|
"interop.insertQuillImage",
|
||||||
|
quillElement, imageUrl);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,9 @@
|
||||||
@inject IPageService PageService
|
@inject IPageService PageService
|
||||||
@inject IPageModuleService PageModuleService
|
@inject IPageModuleService PageModuleService
|
||||||
@inject ILogService logger
|
@inject ILogService logger
|
||||||
|
@inject ISettingService SettingService
|
||||||
|
|
||||||
@if (_moduleDefinitions != null && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions))
|
@if (_moduleDefinitions != null && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
<div class="app-controlpanel" style="@_display">
|
<div class="app-controlpanel" style="@_display">
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class="app-rule" />
|
<hr class="app-rule"/>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
|
@ -73,23 +74,23 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<hr class="app-rule" />
|
<hr class="app-rule"/>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<label for="Module" class="control-label">Module Management: </label>
|
<label for="Module" class="control-label">Module Management: </label>
|
||||||
<select class="form-control" @bind="@_moduleType">
|
<select class="form-control" @bind="@ModuleType">
|
||||||
<option value="new">Add New Module</option>
|
<option value="new">Add New Module</option>
|
||||||
<option value="existing">Add Existing Module</option>
|
<option value="existing">Add Existing Module</option>
|
||||||
</select>
|
</select>
|
||||||
@if (_moduleType == "new")
|
@if (ModuleType == "new")
|
||||||
{
|
{
|
||||||
@if (_moduleDefinitions != null)
|
@if (_moduleDefinitions != null)
|
||||||
{
|
{
|
||||||
<select class="form-control" @onchange="(e => CategoryChanged(e))">
|
<select class="form-control" @onchange="(e => CategoryChanged(e))">
|
||||||
@foreach (var category in _categories)
|
@foreach (var category in _categories)
|
||||||
{
|
{
|
||||||
if (category == _category)
|
if (category == Category)
|
||||||
{
|
{
|
||||||
<option value="@category" selected>@category Modules</option>
|
<option value="@category" selected>@category Modules</option>
|
||||||
}
|
}
|
||||||
|
@ -100,7 +101,7 @@
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<select class="form-control" @onchange="(e => ModuleChanged(e))">
|
<select class="form-control" @onchange="(e => ModuleChanged(e))">
|
||||||
@if (_moduleDefinitionName == "-")
|
@if (ModuleDefinitionName == "-")
|
||||||
{
|
{
|
||||||
<option value="-" selected><Select Module></option>
|
<option value="-" selected><Select Module></option>
|
||||||
}
|
}
|
||||||
|
@ -116,7 +117,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@((MarkupString)@_description)
|
@((MarkupString) Description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -128,7 +129,7 @@
|
||||||
<option value="@p.PageId">@p.Name</option>
|
<option value="@p.PageId">@p.Name</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<select class="form-control" @bind="@_moduleId">
|
<select class="form-control" @bind="@ModuleId">
|
||||||
<option value="-"><Select Module></option>
|
<option value="-"><Select Module></option>
|
||||||
@foreach (Module module in _modules)
|
@foreach (Module module in _modules)
|
||||||
{
|
{
|
||||||
|
@ -141,13 +142,13 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<label for="Title" class="control-label">Title: </label>
|
<label for="Title" class="control-label">Title: </label>
|
||||||
<input type="text" name="Title" class="form-control" @bind="@_title" />
|
<input type="text" name="Title" class="form-control" @bind="@Title"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<label for="Pane" class="control-label">Pane: </label>
|
<label for="Pane" class="control-label">Pane: </label>
|
||||||
<select class="form-control" @bind="@_pane">
|
<select class="form-control" @bind="@Pane">
|
||||||
<option value=""><Select Pane></option>
|
<option value=""><Select Pane></option>
|
||||||
@foreach (string pane in PageState.Page.Panes)
|
@foreach (string pane in PageState.Page.Panes)
|
||||||
{
|
{
|
||||||
|
@ -159,7 +160,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<label for="Container" class="control-label">Container: </label>
|
<label for="Container" class="control-label">Container: </label>
|
||||||
<select class="form-control" @bind="@_containerType">
|
<select class="form-control" @bind="@ContainerType">
|
||||||
@foreach (KeyValuePair<string, string> container in _containers)
|
@foreach (KeyValuePair<string, string> container in _containers)
|
||||||
{
|
{
|
||||||
<option value="@container.Key">@container.Value</option>
|
<option value="@container.Key">@container.Value</option>
|
||||||
|
@ -168,16 +169,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br/>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick="@AddModule">Add Module To Page</button>
|
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick="@AddModule">Add Module To Page</button>
|
||||||
@((MarkupString) _message)
|
@((MarkupString) Message)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions) || (PageState.Page.IsPersonalizable && PageState.User != null))
|
@if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions) || (PageState.Page.IsPersonalizable && PageState.User != null))
|
||||||
{
|
{
|
||||||
@if (PageState.Page.EditMode)
|
@if (PageState.Page.EditMode)
|
||||||
{
|
{
|
||||||
|
@ -202,32 +203,52 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions))
|
@if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
<button type="button" class="btn @ButtonClass" @onclick="ShowControlPanel">
|
<button type="button" class="btn @ButtonClass" @onclick="ShowControlPanel">
|
||||||
<span class="oi oi-cog"></span>
|
<span class="oi oi-cog"></span>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code{
|
||||||
|
|
||||||
private bool _deleteConfirmation = false;
|
private bool _deleteConfirmation = false;
|
||||||
private string _moduleType = "new";
|
|
||||||
private List<string> _categories = new List<string>();
|
private List<string> _categories = new List<string>();
|
||||||
private List<ModuleDefinition> _allModuleDefinitions;
|
private List<ModuleDefinition> _allModuleDefinitions;
|
||||||
private List<ModuleDefinition> _moduleDefinitions;
|
private List<ModuleDefinition> _moduleDefinitions;
|
||||||
private List<Page> _pages = new List<Page>();
|
private List<Page> _pages = new List<Page>();
|
||||||
private string _pageId = "-";
|
|
||||||
private string _moduleId = "-";
|
|
||||||
private List<Module> _modules = new List<Module>();
|
private List<Module> _modules = new List<Module>();
|
||||||
private Dictionary<string, string> _containers = new Dictionary<string, string>();
|
private Dictionary<string, string> _containers = new Dictionary<string, string>();
|
||||||
private string _moduleDefinitionName = "-";
|
|
||||||
private string _category = "Common";
|
|
||||||
private string _description = "";
|
|
||||||
private string _pane = "";
|
|
||||||
private string _title = "";
|
|
||||||
private string _containerType = "";
|
|
||||||
private string _display = "display: none;";
|
private string _display = "display: none;";
|
||||||
private string _message = "";
|
private string _category = "Common";
|
||||||
|
|
||||||
|
protected string PageId { get; private set; } = "-";
|
||||||
|
protected string ModuleId { get; private set; } = "-";
|
||||||
|
protected string ModuleType { get; private set; } = "new";
|
||||||
|
protected string ModuleDefinitionName { get; private set; } = "-";
|
||||||
|
|
||||||
|
protected string Category
|
||||||
|
{
|
||||||
|
get => _category;
|
||||||
|
private set
|
||||||
|
{
|
||||||
|
if (_category != value)
|
||||||
|
{
|
||||||
|
_category = value;
|
||||||
|
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(Category)).ToList();
|
||||||
|
ModuleDefinitionName = "-";
|
||||||
|
Description = "";
|
||||||
|
StateHasChanged();
|
||||||
|
_ = UpdateSettingsAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string Description { get; private set; } = "";
|
||||||
|
protected string Pane { get; private set; } = "";
|
||||||
|
protected string Title { get; private set; } = "";
|
||||||
|
protected string ContainerType { get; private set; } = "";
|
||||||
|
protected string Message { get; private set; } = "";
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string ButtonClass { get; set; }
|
public string ButtonClass { get; set; }
|
||||||
|
@ -241,7 +262,8 @@
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string BodyClass { get; set; }
|
public string BodyClass { get; set; }
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(ButtonClass))
|
if (string.IsNullOrEmpty(ButtonClass))
|
||||||
{
|
{
|
||||||
|
@ -263,131 +285,107 @@
|
||||||
BodyClass = "card-body";
|
BodyClass = "card-body";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
_pages?.Clear();
|
_pages?.Clear();
|
||||||
|
|
||||||
foreach (Page p in PageState.Pages)
|
foreach (Page p in PageState.Pages)
|
||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User,PermissionNames.View, p.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
||||||
{
|
{
|
||||||
_pages.Add(p);
|
_pages.Add(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
await LoadSettingsAsync();
|
||||||
|
|
||||||
var panes = PageState.Page.Panes;
|
var panes = PageState.Page.Panes;
|
||||||
_pane = panes.Count() == 1 ? panes.SingleOrDefault() : "";
|
Pane = panes.Count() == 1 ? panes.SingleOrDefault() : "";
|
||||||
var themes = await ThemeService.GetThemesAsync();
|
var themes = await ThemeService.GetThemesAsync();
|
||||||
_containers = ThemeService.GetContainerTypes(themes);
|
_containers = ThemeService.GetContainerTypes(themes);
|
||||||
_containerType = PageState.Site.DefaultContainerType;
|
ContainerType = PageState.Site.DefaultContainerType;
|
||||||
|
|
||||||
_allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
|
_allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
|
||||||
|
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(Category)).ToList();
|
||||||
|
|
||||||
_categories = new List<string>();
|
_categories = _allModuleDefinitions.SelectMany(m => m.Categories.Split(',')).Distinct().ToList();
|
||||||
foreach (ModuleDefinition moduledefinition in _allModuleDefinitions)
|
|
||||||
{
|
|
||||||
if (moduledefinition.Categories != "")
|
|
||||||
{
|
|
||||||
foreach (string category in moduledefinition.Categories.Split(','))
|
|
||||||
{
|
|
||||||
if (!_categories.Contains(category))
|
|
||||||
{
|
|
||||||
_categories.Add(category);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_category = "Common";
|
|
||||||
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(_category)).ToList();
|
|
||||||
_moduleDefinitionName = "-";
|
|
||||||
_description = "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CategoryChanged(ChangeEventArgs e)
|
private void CategoryChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
_category = (string) e.Value;
|
Category = (string) e.Value;
|
||||||
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(_category)).ToList();
|
|
||||||
_moduleDefinitionName = "-";
|
|
||||||
_description = "";
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ModuleChanged(ChangeEventArgs e)
|
private void ModuleChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
_moduleDefinitionName = (string)e.Value;
|
ModuleDefinitionName = (string) e.Value;
|
||||||
if (_moduleDefinitionName != "-")
|
if (ModuleDefinitionName != "-")
|
||||||
{
|
{
|
||||||
var moduleDefinition = _moduleDefinitions.FirstOrDefault(item => item.ModuleDefinitionName == _moduleDefinitionName);
|
var moduleDefinition = _moduleDefinitions.FirstOrDefault(item => item.ModuleDefinitionName == ModuleDefinitionName);
|
||||||
_description = "<br /><div class=\"alert alert-info\" role=\"alert\">" + moduleDefinition.Description + "</div>";
|
Description = "<br /><div class=\"alert alert-info\" role=\"alert\">" + moduleDefinition.Description + "</div>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_description = "";
|
Description = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PageChanged(ChangeEventArgs e)
|
private void PageChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
_pageId = (string) e.Value;
|
PageId = (string) e.Value;
|
||||||
_modules?.Clear();
|
if (PageId != "-")
|
||||||
|
|
||||||
if (_pageId != "-")
|
|
||||||
{
|
{
|
||||||
foreach (Module module in PageState.Modules.Where(item => item.PageId == int.Parse(_pageId) && !item.IsDeleted))
|
_modules = PageState.Modules
|
||||||
{
|
.Where(module => module.PageId == int.Parse(PageId)
|
||||||
if (UserSecurity.IsAuthorized(PageState.User,PermissionNames.View, module.Permissions))
|
&& !module.IsDeleted
|
||||||
{
|
&& UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))
|
||||||
_modules.Add(module);
|
.ToList();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
ModuleId = "-";
|
||||||
_moduleId = "-";
|
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AddModule()
|
private async Task AddModule()
|
||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
if ((_moduleType == "new" && _moduleDefinitionName != "-") || (_moduleType != "new" && _moduleId != "-"))
|
if ((ModuleType == "new" && ModuleDefinitionName != "-") || (ModuleType != "new" && ModuleId != "-"))
|
||||||
{
|
{
|
||||||
if (_moduleType == "new")
|
if (ModuleType == "new")
|
||||||
{
|
{
|
||||||
Module module = new Module();
|
Module module = new Module();
|
||||||
module.SiteId = PageState.Site.SiteId;
|
module.SiteId = PageState.Site.SiteId;
|
||||||
module.PageId = PageState.Page.PageId;
|
module.PageId = PageState.Page.PageId;
|
||||||
module.ModuleDefinitionName = _moduleDefinitionName;
|
module.ModuleDefinitionName = ModuleDefinitionName;
|
||||||
module.AllPages = false;
|
module.AllPages = false;
|
||||||
module.Permissions = PageState.Page.Permissions;
|
module.Permissions = PageState.Page.Permissions;
|
||||||
module = await ModuleService.AddModuleAsync(module);
|
module = await ModuleService.AddModuleAsync(module);
|
||||||
_moduleId = module.ModuleId.ToString();
|
ModuleId = module.ModuleId.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
var pageModule = new PageModule
|
var pageModule = new PageModule
|
||||||
{
|
{
|
||||||
PageId = PageState.Page.PageId,
|
PageId = PageState.Page.PageId,
|
||||||
ModuleId = int.Parse(_moduleId),
|
ModuleId = int.Parse(ModuleId),
|
||||||
Title = _title
|
Title = Title
|
||||||
};
|
};
|
||||||
if (pageModule.Title == "")
|
if (pageModule.Title == "")
|
||||||
{
|
{
|
||||||
if (_moduleType == "new")
|
if (ModuleType == "new")
|
||||||
{
|
{
|
||||||
pageModule.Title = _moduleDefinitions.FirstOrDefault(item => item.ModuleDefinitionName == _moduleDefinitionName)?.Name;
|
pageModule.Title = _moduleDefinitions.FirstOrDefault(item => item.ModuleDefinitionName == ModuleDefinitionName)?.Name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pageModule.Title = _modules.FirstOrDefault(item => item.ModuleId == int.Parse(_moduleId))?.Title;
|
pageModule.Title = _modules.FirstOrDefault(item => item.ModuleId == int.Parse(ModuleId))?.Title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pageModule.Pane = _pane;
|
pageModule.Pane = Pane;
|
||||||
pageModule.Order = int.MaxValue;
|
pageModule.Order = int.MaxValue;
|
||||||
pageModule.ContainerType = _containerType;
|
pageModule.ContainerType = ContainerType;
|
||||||
|
|
||||||
if (pageModule.ContainerType == PageState.Site.DefaultContainerType)
|
if (pageModule.ContainerType == PageState.Site.DefaultContainerType)
|
||||||
{
|
{
|
||||||
|
@ -397,32 +395,23 @@
|
||||||
await PageModuleService.AddPageModuleAsync(pageModule);
|
await PageModuleService.AddPageModuleAsync(pageModule);
|
||||||
await PageModuleService.UpdatePageModuleOrderAsync(pageModule.PageId, pageModule.Pane);
|
await PageModuleService.UpdatePageModuleOrderAsync(pageModule.PageId, pageModule.Pane);
|
||||||
|
|
||||||
_message = "<br /><div class=\"alert alert-success\" role=\"alert\">Module Added To Page</div>";
|
Message = "<br /><div class=\"alert alert-success\" role=\"alert\">Module Added To Page</div>";
|
||||||
|
|
||||||
_moduleDefinitionName = "-";
|
|
||||||
_description = "";
|
|
||||||
_pane = "";
|
|
||||||
_title = "";
|
|
||||||
_containerType = "";
|
|
||||||
_pageId = "-";
|
|
||||||
_moduleId = "-";
|
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl());
|
NavigationManager.NavigateTo(NavigateUrl());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_message = "<br /><div class=\"alert alert-warning\" role=\"alert\">You Must Select A Module</div>";
|
Message = "<br /><div class=\"alert alert-warning\" role=\"alert\">You Must Select A Module</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_message = "<br /><div class=\"alert alert-error\" role=\"alert\">Not Authorized</div>";
|
Message = "<br /><div class=\"alert alert-error\" role=\"alert\">Not Authorized</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ToggleEditMode(bool EditMode)
|
private async Task ToggleEditMode(bool EditMode)
|
||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
if (EditMode)
|
if (EditMode)
|
||||||
{
|
{
|
||||||
|
@ -432,6 +421,7 @@
|
||||||
{
|
{
|
||||||
PageState.EditMode = true;
|
PageState.EditMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + ((PageState.EditMode) ? "1" : "0")));
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + ((PageState.EditMode) ? "1" : "0")));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -447,14 +437,14 @@
|
||||||
|
|
||||||
private void ShowControlPanel()
|
private void ShowControlPanel()
|
||||||
{
|
{
|
||||||
_message = "";
|
Message = "";
|
||||||
_display = "width: 25%; min-width: 375px;";
|
_display = "width: 25%; min-width: 375px;";
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideControlPanel()
|
private void HideControlPanel()
|
||||||
{
|
{
|
||||||
_message = "";
|
Message = "";
|
||||||
_display = "width: 0%;";
|
_display = "width: 0%;";
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
@ -466,7 +456,7 @@
|
||||||
switch (location)
|
switch (location)
|
||||||
{
|
{
|
||||||
case "Admin":
|
case "Admin":
|
||||||
// get admin dashboard moduleid
|
// get admin dashboard moduleid
|
||||||
module = PageState.Modules.FirstOrDefault(item => item.ModuleDefinitionName == Constants.AdminDashboardModule);
|
module = PageState.Modules.FirstOrDefault(item => item.ModuleDefinitionName == Constants.AdminDashboardModule);
|
||||||
|
|
||||||
if (module != null)
|
if (module != null)
|
||||||
|
@ -478,7 +468,7 @@
|
||||||
case "Add":
|
case "Add":
|
||||||
case "Edit":
|
case "Edit":
|
||||||
string url = "";
|
string url = "";
|
||||||
// get page management moduleid
|
// get page management moduleid
|
||||||
module = PageState.Modules.FirstOrDefault(item => item.ModuleDefinitionName == Constants.PageManagementModule);
|
module = PageState.Modules.FirstOrDefault(item => item.ModuleDefinitionName == Constants.PageManagementModule);
|
||||||
|
|
||||||
if (module != null)
|
if (module != null)
|
||||||
|
@ -536,4 +526,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string settingName = "CP-category";
|
||||||
|
|
||||||
|
private async Task LoadSettingsAsync()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> settings = await SettingService.GetUserSettingsAsync(PageState.User.UserId);
|
||||||
|
_category = SettingService.GetSetting(settings, settingName, "Common");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateSettingsAsync()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> settings = await SettingService.GetUserSettingsAsync(PageState.User.UserId);
|
||||||
|
SettingService.SetSetting(settings, settingName, _category);
|
||||||
|
await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.JSInterop;
|
||||||
using Microsoft.JSInterop;
|
|
||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Oqtane.UI
|
namespace Oqtane.UI
|
||||||
|
@ -18,7 +16,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.setCookie",
|
"interop.setCookie",
|
||||||
name, value, days);
|
name, value, days);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -47,7 +45,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.updateTitle",
|
"interop.updateTitle",
|
||||||
title);
|
title);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -62,7 +60,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.includeMeta",
|
"interop.includeMeta",
|
||||||
id, attribute, name, content);
|
id, attribute, name, content);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -77,7 +75,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.includeLink",
|
"interop.includeLink",
|
||||||
id, rel, url, type, integrity, crossorigin);
|
id, rel, url, type, integrity, crossorigin);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -92,7 +90,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.includeScript",
|
"interop.includeScript",
|
||||||
id, src, content, location, integrity, crossorigin);
|
id, src, content, location, integrity, crossorigin);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -107,7 +105,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.includeLink",
|
"interop.includeLink",
|
||||||
id, "stylesheet", url, "text/css");
|
id, "stylesheet", url, "text/css");
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -122,7 +120,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.removeElementsById",
|
"interop.removeElementsById",
|
||||||
prefix, first, last);
|
prefix, first, last);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -152,7 +150,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.submitForm",
|
"interop.submitForm",
|
||||||
path, fields);
|
path, fields);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
@ -181,7 +179,7 @@ namespace Oqtane.UI
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeAsync<string>(
|
_jsRuntime.InvokeAsync<object>(
|
||||||
"interop.uploadFiles",
|
"interop.uploadFiles",
|
||||||
posturl, folder, id);
|
posturl, folder, id);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
|
|
||||||
if (alias.Path != "")
|
if (alias.Path != "")
|
||||||
{
|
{
|
||||||
path = path.Replace(alias.Path + "/", "");
|
path = path.Substring(alias.Path.Length + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract admin route elements from path
|
// extract admin route elements from path
|
||||||
|
|
23
Oqtane.Package/Oqtane.Client.nuspec
Normal file
23
Oqtane.Package/Oqtane.Client.nuspec
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>Oqtane.Client</id>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<authors>Shaun Walker</authors>
|
||||||
|
<owners>.NET Foundation</owners>
|
||||||
|
<title>Oqtane Framework</title>
|
||||||
|
<description>A modular application framework for Blazor</description>
|
||||||
|
<copyright>.NET Foundation</copyright>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<license type="expression">MIT</license>
|
||||||
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
|
<tags>oqtane framework</tags>
|
||||||
|
<releaseNotes>Initial Release</releaseNotes>
|
||||||
|
<summary>A modular application framework for Blazor</summary>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.dll" target="lib\netstandard2.1" />
|
||||||
|
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.pdb" target="lib\netstandard2.1" />
|
||||||
|
</files>
|
||||||
|
</package>
|
|
@ -17,12 +17,12 @@
|
||||||
<summary>A modular application framework for Blazor</summary>
|
<summary>A modular application framework for Blazor</summary>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.dll" target="lib" />
|
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.dll" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.pdb" target="lib" />
|
<file src="..\Oqtane.Client\bin\Release\netstandard2.1\Oqtane.Client.pdb" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.dll" target="lib" />
|
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.dll" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.pdb" target="lib" />
|
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.pdb" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.dll" target="lib" />
|
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.dll" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.pdb" target="lib" />
|
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.pdb" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Oqtane.Server\wwwroot\**\*.*" target="wwwroot" />
|
<file src="..\Oqtane.Server\wwwroot\**\*.*" target="wwwroot" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
23
Oqtane.Package/Oqtane.Server.nuspec
Normal file
23
Oqtane.Package/Oqtane.Server.nuspec
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>Oqtane.Server</id>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<authors>Shaun Walker</authors>
|
||||||
|
<owners>.NET Foundation</owners>
|
||||||
|
<title>Oqtane Framework</title>
|
||||||
|
<description>A modular application framework for Blazor</description>
|
||||||
|
<copyright>.NET Foundation</copyright>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<license type="expression">MIT</license>
|
||||||
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
|
<tags>oqtane framework</tags>
|
||||||
|
<releaseNotes>Initial Release</releaseNotes>
|
||||||
|
<summary>A modular application framework for Blazor</summary>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.dll" target="lib\netcoreapp3.1" />
|
||||||
|
<file src="..\Oqtane.Server\bin\Release\netcoreapp3.1\Oqtane.Server.pdb" target="lib\netcoreapp3.1" />
|
||||||
|
</files>
|
||||||
|
</package>
|
23
Oqtane.Package/Oqtane.Shared.nuspec
Normal file
23
Oqtane.Package/Oqtane.Shared.nuspec
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>Oqtane.Shared</id>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<authors>Shaun Walker</authors>
|
||||||
|
<owners>.NET Foundation</owners>
|
||||||
|
<title>Oqtane Framework</title>
|
||||||
|
<description>A modular application framework for Blazor</description>
|
||||||
|
<copyright>.NET Foundation</copyright>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<license type="expression">MIT</license>
|
||||||
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
|
<iconUrl>https://www.oqtane.org/Portals/0/icon.jpg</iconUrl>
|
||||||
|
<tags>oqtane framework</tags>
|
||||||
|
<releaseNotes>Initial Release</releaseNotes>
|
||||||
|
<summary>A modular application framework for Blazor</summary>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.dll" target="lib\netstandard2.1" />
|
||||||
|
<file src="..\Oqtane.Shared\bin\Release\netstandard2.1\Oqtane.Shared.pdb" target="lib\netstandard2.1" />
|
||||||
|
</files>
|
||||||
|
</package>
|
|
@ -1,3 +0,0 @@
|
||||||
DEL "*.nupkg"
|
|
||||||
nuget.exe pack Oqtane.Framework.nuspec
|
|
||||||
|
|
6
Oqtane.Package/release.cmd
Normal file
6
Oqtane.Package/release.cmd
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
DEL "*.nupkg"
|
||||||
|
nuget.exe pack Oqtane.Framework.nuspec
|
||||||
|
nuget.exe pack Oqtane.Client.nuspec
|
||||||
|
nuget.exe pack Oqtane.Server.nuspec
|
||||||
|
nuget.exe pack Oqtane.Shared.nuspec
|
||||||
|
|
|
@ -170,7 +170,7 @@ namespace Oqtane.Controllers
|
||||||
{
|
{
|
||||||
string rootPath;
|
string rootPath;
|
||||||
DirectoryInfo rootFolder = Directory.GetParent(_environment.ContentRootPath);
|
DirectoryInfo rootFolder = Directory.GetParent(_environment.ContentRootPath);
|
||||||
string templatePath = Utilities.PathCombine(rootFolder.FullName, "Oqtane.Client", "Modules", "Admin", "ModuleCreator", "Templates",moduleDefinition.Template,"\\");
|
string templatePath = Utilities.PathCombine(_environment.WebRootPath, "Modules", "Templates", moduleDefinition.Template,"\\");
|
||||||
|
|
||||||
if (moduleDefinition.Template == "internal")
|
if (moduleDefinition.Template == "internal")
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,16 +98,9 @@ namespace Oqtane.Infrastructure
|
||||||
ExtractFile(entry, filename);
|
ExtractFile(entry, filename);
|
||||||
break;
|
break;
|
||||||
case "wwwroot":
|
case "wwwroot":
|
||||||
filename = Path.Combine(sourceFolder, Utilities.PathCombine(entry.FullName.Replace("wwwroot", name).Split('/')));
|
filename = Path.Combine(webRootPath, Utilities.PathCombine(entry.FullName.Replace("wwwroot/", "").Split('/')));
|
||||||
ExtractFile(entry, filename);
|
ExtractFile(entry, filename);
|
||||||
break;
|
break;
|
||||||
case "content":
|
|
||||||
if (Path.GetDirectoryName(entry.FullName) != "content") // assets must be in subfolders
|
|
||||||
{
|
|
||||||
filename = Path.Combine(webRootPath, Utilities.PathCombine(entry.FullName.Replace("content", "").Split('/')));
|
|
||||||
ExtractFile(entry, filename);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace Oqtane.Infrastructure
|
||||||
{
|
{
|
||||||
MailMessage mailMessage = new MailMessage();
|
MailMessage mailMessage = new MailMessage();
|
||||||
mailMessage.From = new MailAddress(settings["SMTPUsername"], site.Name);
|
mailMessage.From = new MailAddress(settings["SMTPUsername"], site.Name);
|
||||||
|
mailMessage.Subject = notification.Subject;
|
||||||
if (notification.FromUserId != null)
|
if (notification.FromUserId != null)
|
||||||
{
|
{
|
||||||
mailMessage.Body = "From: " + notification.FromUser.DisplayName + "<" + notification.FromUser.Email + ">" + "\n";
|
mailMessage.Body = "From: " + notification.FromUser.DisplayName + "<" + notification.FromUser.Email + ">" + "\n";
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
<PackageReleaseNotes>Not for production use.</PackageReleaseNotes>
|
||||||
<RootNamespace>Oqtane</RootNamespace>
|
<RootNamespace>Oqtane</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="wwwroot\Modules\Templates\**" />
|
||||||
|
<Content Remove="wwwroot\Modules\Templates\**" />
|
||||||
|
<EmbeddedResource Remove="wwwroot\Modules\Templates\**" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Scripts\Master.0.9.0.sql" />
|
<EmbeddedResource Include="Scripts\Master.0.9.0.sql" />
|
||||||
<EmbeddedResource Include="Scripts\Tenant.0.9.0.sql" />
|
<EmbeddedResource Include="Scripts\Tenant.0.9.0.sql" />
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="3.1.4" />
|
||||||
<PackageReference Include="System.Net.Http.Json" Version="3.2.0" />
|
<PackageReference Include="System.Net.Http.Json" Version="3.2.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -23,12 +25,8 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Oqtane.Client">
|
<PackageReference Include="Oqtane.Client" Version="1.0.0" />
|
||||||
<HintPath>..\..\[RootFolder]\Oqtane.Client\bin\Debug\netstandard2.1\Oqtane.Client.dll</HintPath>
|
<PackageReference Include="Oqtane.Shared" Version="1.0.0" />
|
||||||
</Reference>
|
|
||||||
<Reference Include="Oqtane.Shared">
|
|
||||||
<HintPath>..\..\[RootFolder]\Oqtane.Client\bin\Debug\netstandard2.1\Oqtane.Shared.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
|
@ -20,13 +20,12 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.dll" target="lib" />
|
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.dll" target="lib\netstandard2.1" />
|
||||||
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.pdb" target="lib" />
|
<file src="..\Client\bin\Release\netstandard2.1\[Owner].[Module]s.Client.Oqtane.pdb" target="lib\netstandard2.1" />
|
||||||
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.dll" target="lib" />
|
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.dll" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" target="lib" />
|
<file src="..\Server\bin\Release\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" target="lib\netcoreapp3.1" />
|
||||||
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" target="lib" />
|
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" target="lib\netstandard2.1" />
|
||||||
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" target="lib" />
|
<file src="..\Shared\bin\Release\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" target="lib\netstandard2.1" />
|
||||||
<file src="..\Server\wwwroot\**\*.*" target="wwwroot" />
|
<file src="..\Server\wwwroot\**\*.*" target="wwwroot" />
|
||||||
<file src="..\Server\content\**\*.*" target="content" />
|
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
|
@ -4,3 +4,4 @@ XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.dll" ".
|
||||||
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Server\bin\Debug\netcoreapp3.1\[Owner].[Module]s.Server.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.dll" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
XCOPY "..\Shared\bin\Debug\netstandard2.1\[Owner].[Module]s.Shared.Oqtane.pdb" "..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\" /Y
|
||||||
|
XCOPY "..\Server\wwwroot\Modules\[Owner].[Module]s\*" "..\..\[RootFolder]\Oqtane.Server\wwwroot\Modules\[Owner].[Module]s\" /Y /S /I
|
|
@ -31,12 +31,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Oqtane.Server">
|
<PackageReference Include="Oqtane.Server" Version="1.0.0" />
|
||||||
<HintPath>..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\Oqtane.Server.dll</HintPath>
|
<PackageReference Include="Oqtane.Shared" Version="1.0.0" />
|
||||||
</Reference>
|
|
||||||
<Reference Include="Oqtane.Shared">
|
|
||||||
<HintPath>..\..\[RootFolder]\Oqtane.Server\bin\Debug\netcoreapp3.1\Oqtane.Shared.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
|
@ -0,0 +1 @@
|
||||||
|
/* Module Script */
|
|
@ -17,9 +17,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Oqtane.Shared">
|
<PackageReference Include="Oqtane.Shared" Version="1.0.0" />
|
||||||
<HintPath>..\..\[RootFolder]\Oqtane.Shared\bin\Debug\netstandard2.1\Oqtane.Shared.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
|
@ -0,0 +1 @@
|
||||||
|
/* Module Custom Styles */
|
|
@ -0,0 +1 @@
|
||||||
|
/* Module Script */
|
|
@ -0,0 +1 @@
|
||||||
|
This is the location where static resources such as images, style sheets, or scripts for this module will be located. Static assets can be organized in subfolders. When the module package is deployed the assets will be extracted under the web root in a folder that matches the module namespace.
|
|
@ -128,6 +128,7 @@ window.interop = {
|
||||||
else {
|
else {
|
||||||
script.innerHTML = content;
|
script.innerHTML = content;
|
||||||
}
|
}
|
||||||
|
script.async = false;
|
||||||
if (location === 'head') {
|
if (location === 'head') {
|
||||||
document.head.appendChild(script);
|
document.head.appendChild(script);
|
||||||
}
|
}
|
||||||
|
|
1
Oqtane.Server/wwwroot/js/quill1.3.6.min.js
vendored
1
Oqtane.Server/wwwroot/js/quill1.3.6.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user