Control panel html facelift + naming fix
This commit is contained in:
parent
b9b89e6046
commit
45dabe554a
|
@ -11,7 +11,8 @@
|
||||||
|
|
||||||
@if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
|
@if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
<div class="app-controlpanel" style="@display">
|
<div class="app-controlpanel" style="@_display">
|
||||||
|
|
||||||
<div class="@CardClass">
|
<div class="@CardClass">
|
||||||
<div class="@HeaderClass">
|
<div class="@HeaderClass">
|
||||||
Control Panel
|
Control Panel
|
||||||
|
@ -20,132 +21,137 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="@BodyClass">
|
<div class="@BodyClass">
|
||||||
<ul class="nav flex-column">
|
|
||||||
@if (UserSecurity.IsAuthorized(PageState.User, Constants.AdminRole))
|
@if (UserSecurity.IsAuthorized(PageState.User, Constants.AdminRole))
|
||||||
{
|
{
|
||||||
<li class="nav-item px-3"><button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Admin"))>Admin Dashboard</button></li>
|
<div class="row">
|
||||||
<li class="nav-item px-3"> </li>
|
<div class="col">
|
||||||
<li class="nav-item px-3"><button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Add"))>Add Page</button></li>
|
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Admin"))>Admin Dashboard</button>
|
||||||
<li class="nav-item px-3"><button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Edit"))>Edit Page</button></li>
|
</div>
|
||||||
}
|
</div>
|
||||||
<li class="nav-item px-3">
|
<div class="row">
|
||||||
<button class="btn btn-primary btn-block mx-auto" @onclick="ConfirmDelete">Delete Page</button>
|
<div class="col">
|
||||||
@if (deleteconfirmation)
|
<label class="control-label">Page: </label>
|
||||||
{
|
</div>
|
||||||
<div class="app-admin-modal">
|
</div>
|
||||||
<div class="modal" tabindex="-1" role="dialog">
|
<div class="row">
|
||||||
<div class="modal-dialog">
|
<div class="col">
|
||||||
<div class="modal-content">
|
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Add"))>Add</button>
|
||||||
<div class="modal-header">
|
</div>
|
||||||
<h5 class="modal-title">Delete Page</h5>
|
<div class="col">
|
||||||
<button type="button" class="close" @onclick="ConfirmDelete" aria-label="Close">×</button>
|
<button type="button" class="btn btn-primary btn-block mx-auto" @onclick=@(async () => Navigate("Edit"))>Edit</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="col">
|
||||||
<p>Are You Sure You Want To Delete This Page?</p>
|
<button class="btn btn-danger btn-block mx-auto" @onclick="ConfirmDelete">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
</div>
|
||||||
<button type="button" class="btn btn-danger" @onclick="DeletePage">Delete</button>
|
}
|
||||||
<button type="button" class="btn btn-secondary" @onclick="ConfirmDelete">Cancel</button>
|
|
||||||
</div>
|
@if (_deleteConfirmation)
|
||||||
</div>
|
{
|
||||||
|
<div class="app-admin-modal">
|
||||||
|
<div class="modal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Delete Page</h5>
|
||||||
|
<button type="button" class="close" @onclick="ConfirmDelete" aria-label="Close">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>Are You Sure You Want To Delete This Page?</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-danger" @onclick="DeletePage">Delete</button>
|
||||||
|
<button type="button" class="btn btn-secondary" @onclick="ConfirmDelete">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
}
|
||||||
<hr class="app-rule" />
|
<hr class="app-rule"/>
|
||||||
<table class="table table-borderless">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<label for="Module" class="control-label">Module: </label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select class="form-control" @bind="@moduletype">
|
|
||||||
<option value="new">Add New Module</option>
|
|
||||||
<option value="existing">Add Existing Module</option>
|
|
||||||
</select>
|
|
||||||
@if (moduletype == "new")
|
|
||||||
{
|
|
||||||
@if (moduledefinitions != null)
|
|
||||||
{
|
|
||||||
<select class="form-control" @onchange="(e => CategoryChanged(e))">
|
|
||||||
<option value="-"><Common Modules></option>
|
|
||||||
@foreach (var category in categories)
|
|
||||||
{
|
|
||||||
<option value="@category">@category</option>
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
<select class="form-control" @bind="@moduledefinitionname">
|
|
||||||
<option value="-"><Select Module></option>
|
|
||||||
@foreach (var moduledefinition in moduledefinitions)
|
|
||||||
{
|
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, "Utilize", moduledefinition.Permissions))
|
|
||||||
{
|
|
||||||
<option value="@moduledefinition.ModuleDefinitionName">@moduledefinition.Name</option>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<select class="form-control" @onchange="(e => PageChanged(e))">
|
|
||||||
<option value="-"><Select Page></option>
|
|
||||||
@foreach (Page p in pages)
|
|
||||||
{
|
|
||||||
<option value="@p.PageId">@p.Name</option>
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
<select class="form-control" @bind="@moduleid">
|
|
||||||
<option value="-"><Select Module></option>
|
|
||||||
@foreach (Module module in modules)
|
|
||||||
{
|
|
||||||
<option value="@module.ModuleId">@module.Title</option>
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<label for="Module" class="control-label">Module: </label>
|
||||||
|
<select class="form-control" @bind="@_moduleType">
|
||||||
|
<option value="new">Add New Module</option>
|
||||||
|
<option value="existing">Add Existing Module</option>
|
||||||
|
</select>
|
||||||
|
@if (_moduleType == "new")
|
||||||
|
{
|
||||||
|
@if (_moduleDefinitions != null)
|
||||||
|
{
|
||||||
|
<select class="form-control" @onchange="(e => CategoryChanged(e))">
|
||||||
|
<option value="-"><Common Modules></option>
|
||||||
|
@foreach (var category in _categories)
|
||||||
|
{
|
||||||
|
<option value="@category">@category</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
<select class="form-control" @bind="@_moduleDefinitionName">
|
||||||
|
<option value="-"><Select Module></option>
|
||||||
|
@foreach (var moduledefinition in _moduleDefinitions)
|
||||||
|
{
|
||||||
|
if (UserSecurity.IsAuthorized(PageState.User, "Utilize", moduledefinition.Permissions))
|
||||||
|
{
|
||||||
|
<option value="@moduledefinition.ModuleDefinitionName">@moduledefinition.Name</option>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</select>
|
||||||
}
|
}
|
||||||
</td>
|
}
|
||||||
</tr>
|
else
|
||||||
<tr>
|
{
|
||||||
<td>
|
<select class="form-control" @onchange="(e => PageChanged(e))">
|
||||||
<label for="Title" class="control-label">Title: </label>
|
<option value="-"><Select Page></option>
|
||||||
</td>
|
@foreach (Page p in _pages)
|
||||||
<td>
|
|
||||||
<input type="text" name="Title" class="form-control" @bind="@title" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<label for="Pane" class="control-label">Pane: </label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select class="form-control" @bind="@pane">
|
|
||||||
<option value=""><Select Pane></option>
|
|
||||||
@foreach (string pane in PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
|
||||||
{
|
{
|
||||||
<option value="@pane">@pane Pane</option>
|
<option value="@p.PageId">@p.Name</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</td>
|
<select class="form-control" @bind="@_moduleId">
|
||||||
</tr>
|
<option value="-"><Select Module></option>
|
||||||
<tr>
|
@foreach (Module module in _modules)
|
||||||
<td>
|
|
||||||
<label for="Container" class="control-label">Container: </label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select class="form-control" @bind="@containertype">
|
|
||||||
@foreach (KeyValuePair<string, string> container in containers)
|
|
||||||
{
|
{
|
||||||
<option value="@container.Key">@container.Value</option>
|
<option value="@module.ModuleId">@module.Title</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</td>
|
}
|
||||||
</tr>
|
</div>
|
||||||
</table>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<label for="Title" class="control-label">Title: </label>
|
||||||
|
<input type="text" name="Title" class="form-control" @bind="@_title"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<label for="Pane" class="control-label">Pane: </label>
|
||||||
|
<select class="form-control" @bind="@_pane">
|
||||||
|
<option value=""><Select Pane></option>
|
||||||
|
@foreach (string pane in PageState.Page.Panes.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries))
|
||||||
|
{
|
||||||
|
<option value="@pane">@pane Pane</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<label for="Container" class="control-label">Container: </label>
|
||||||
|
<select class="form-control" @bind="@_containerType">
|
||||||
|
@foreach (KeyValuePair<string, string> container in _containers)
|
||||||
|
{
|
||||||
|
<option value="@container.Key">@container.Value</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<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>
|
||||||
|
@ -184,6 +190,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string ButtonClass { get; set; }
|
public string ButtonClass { get; set; }
|
||||||
|
|
||||||
|
@ -196,22 +203,22 @@
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string BodyClass { get; set; }
|
public string BodyClass { get; set; }
|
||||||
|
|
||||||
bool deleteconfirmation = false;
|
bool _deleteConfirmation = false;
|
||||||
string moduletype = "new";
|
string _moduleType = "new";
|
||||||
List<string> categories = new List<string>();
|
List<string> _categories = new List<string>();
|
||||||
List<ModuleDefinition> ModuleDefinitions;
|
List<ModuleDefinition> _allModuleDefinitions;
|
||||||
List<ModuleDefinition> moduledefinitions;
|
List<ModuleDefinition> _moduleDefinitions;
|
||||||
List<Page> pages = new List<Page>();
|
List<Page> _pages = new List<Page>();
|
||||||
string pageid = "-";
|
string _pageId = "-";
|
||||||
string moduleid = "-";
|
string _moduleId = "-";
|
||||||
List<Module> modules = new List<Module>();
|
List<Module> _modules = new List<Module>();
|
||||||
Dictionary<string, string> containers = new Dictionary<string, string>();
|
Dictionary<string, string> _containers = new Dictionary<string, string>();
|
||||||
string moduledefinitionname = "-";
|
string _moduleDefinitionName = "-";
|
||||||
string pane = "";
|
string _pane = "";
|
||||||
string title = "";
|
string _title = "";
|
||||||
string containertype = "";
|
string _containerType = "";
|
||||||
string display = "display: none;";
|
string _display = "display: none;";
|
||||||
string message = "";
|
string _message = "";
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
|
@ -234,68 +241,68 @@
|
||||||
|
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
|
||||||
{
|
{
|
||||||
pages?.Clear();
|
_pages?.Clear();
|
||||||
|
|
||||||
ModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
|
_allModuleDefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId);
|
||||||
foreach (ModuleDefinition moduledefinition in ModuleDefinitions)
|
foreach (ModuleDefinition moduledefinition in _allModuleDefinitions)
|
||||||
{
|
{
|
||||||
if (moduledefinition.Categories != "")
|
if (moduledefinition.Categories != "")
|
||||||
{
|
{
|
||||||
foreach (string category in moduledefinition.Categories.Split(','))
|
foreach (string category in moduledefinition.Categories.Split(','))
|
||||||
{
|
{
|
||||||
if (!categories.Contains(category))
|
if (!_categories.Contains(category))
|
||||||
{
|
{
|
||||||
categories.Add(category);
|
_categories.Add(category);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
moduledefinitions = ModuleDefinitions.Where(item => item.Categories == "").ToList();
|
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories == "").ToList();
|
||||||
foreach (Page p in PageState.Pages)
|
foreach (Page p in PageState.Pages)
|
||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, "View", p.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, "View", p.Permissions))
|
||||||
{
|
{
|
||||||
pages.Add(p);
|
_pages.Add(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var panes = PageState.Page.Panes.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
var panes = PageState.Page.Panes.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
pane = panes.Count() == 1 ? panes.SingleOrDefault() : "";
|
_pane = panes.Count() == 1 ? panes.SingleOrDefault() : "";
|
||||||
List<Theme> themes = await ThemeService.GetThemesAsync();
|
List<Theme> themes = await ThemeService.GetThemesAsync();
|
||||||
containers = ThemeService.GetContainerTypes(themes);
|
_containers = ThemeService.GetContainerTypes(themes);
|
||||||
containertype = PageState.Site.DefaultContainerType;
|
_containerType = PageState.Site.DefaultContainerType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CategoryChanged(ChangeEventArgs e)
|
private void CategoryChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
string category = (string)e.Value;
|
string category = (string) e.Value;
|
||||||
if (category == "-")
|
if (category == "-")
|
||||||
{
|
{
|
||||||
moduledefinitions = ModuleDefinitions.Where(item => item.Categories == "").ToList();
|
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories == "").ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
moduledefinitions = ModuleDefinitions.Where(item => item.Categories.Contains(category)).ToList();
|
_moduleDefinitions = _allModuleDefinitions.Where(item => item.Categories.Contains(category)).ToList();
|
||||||
}
|
}
|
||||||
moduledefinitionname = "-";
|
_moduleDefinitionName = "-";
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PageChanged(ChangeEventArgs e)
|
private void PageChanged(ChangeEventArgs e)
|
||||||
{
|
{
|
||||||
pageid = (string)e.Value;
|
_pageId = (string) e.Value;
|
||||||
modules?.Clear();
|
_modules?.Clear();
|
||||||
if (pageid != "-")
|
if (_pageId != "-")
|
||||||
{
|
{
|
||||||
foreach (Module module in PageState.Modules.Where(item => item.PageId == int.Parse(pageid) && !item.IsDeleted))
|
foreach (Module module in PageState.Modules.Where(item => item.PageId == int.Parse(_pageId) && !item.IsDeleted))
|
||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions))
|
||||||
{
|
{
|
||||||
modules.Add(module);
|
_modules.Add(module);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
moduleid = "-";
|
_moduleId = "-";
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,65 +310,67 @@
|
||||||
{
|
{
|
||||||
if (UserSecurity.IsAuthorized(PageState.User, "Edit", PageState.Page.Permissions))
|
if (UserSecurity.IsAuthorized(PageState.User, "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.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();
|
||||||
}
|
}
|
||||||
|
|
||||||
PageModule pagemodule = new PageModule();
|
var pageModule = new PageModule
|
||||||
pagemodule.PageId = (pageid == "-") ? PageState.Page.PageId : int.Parse(pageid);
|
|
||||||
pagemodule.ModuleId = int.Parse(moduleid);
|
|
||||||
pagemodule.Title = title;
|
|
||||||
if (pagemodule.Title == "")
|
|
||||||
{
|
{
|
||||||
if (moduletype == "new")
|
PageId = (_pageId == "-") ? PageState.Page.PageId : int.Parse(_pageId),
|
||||||
|
ModuleId = int.Parse(_moduleId),
|
||||||
|
Title = _title
|
||||||
|
};
|
||||||
|
if (pageModule.Title == "")
|
||||||
|
{
|
||||||
|
if (_moduleType == "new")
|
||||||
{
|
{
|
||||||
pagemodule.Title = moduledefinitions.Where(item => item.ModuleDefinitionName == moduledefinitionname).FirstOrDefault().Name;
|
pageModule.Title = _moduleDefinitions.FirstOrDefault(item => item.ModuleDefinitionName == _moduleDefinitionName)?.Name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pagemodule.Title = modules.Where(item => item.ModuleId == int.Parse(moduleid)).FirstOrDefault().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)
|
||||||
{
|
{
|
||||||
pagemodule.ContainerType = "";
|
pageModule.ContainerType = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = "-";
|
_moduleDefinitionName = "-";
|
||||||
pane = "";
|
_pane = "";
|
||||||
title = "";
|
_title = "";
|
||||||
containertype = "";
|
_containerType = "";
|
||||||
pageid = "-";
|
_pageId = "-";
|
||||||
moduleid = "-";
|
_moduleId = "-";
|
||||||
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl(Reload.Page));
|
NavigationManager.NavigateTo(NavigateUrl(Reload.Page));
|
||||||
}
|
}
|
||||||
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>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,15 +401,15 @@
|
||||||
|
|
||||||
private void ShowControlPanel()
|
private void ShowControlPanel()
|
||||||
{
|
{
|
||||||
message = "";
|
_message = "";
|
||||||
display = "width: 25%;";
|
_display = "width: 25%; minwidth:300px";
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideControlPanel()
|
private void HideControlPanel()
|
||||||
{
|
{
|
||||||
message = "";
|
_message = "";
|
||||||
display = "width: 0%;";
|
_display = "width: 0%;";
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,8 +420,8 @@
|
||||||
switch (location)
|
switch (location)
|
||||||
{
|
{
|
||||||
case "Admin":
|
case "Admin":
|
||||||
// get admin dashboard moduleid
|
// get admin dashboard moduleid
|
||||||
module = PageState.Modules.Where(item => item.ModuleDefinitionName == Constants.AdminDashboardModule).FirstOrDefault();
|
module = PageState.Modules.FirstOrDefault(item => item.ModuleDefinitionName == Constants.AdminDashboardModule);
|
||||||
if (module != null)
|
if (module != null)
|
||||||
{
|
{
|
||||||
NavigationManager.NavigateTo(EditUrl(PageState.Page.Path, module.ModuleId, "Index", ""));
|
NavigationManager.NavigateTo(EditUrl(PageState.Page.Path, module.ModuleId, "Index", ""));
|
||||||
|
@ -421,8 +430,8 @@
|
||||||
case "Add":
|
case "Add":
|
||||||
case "Edit":
|
case "Edit":
|
||||||
string url = "";
|
string url = "";
|
||||||
// get page management moduleid
|
// get page management moduleid
|
||||||
module = PageState.Modules.Where(item => item.ModuleDefinitionName == Constants.PageManagementModule).FirstOrDefault();
|
module = PageState.Modules.FirstOrDefault(item => item.ModuleDefinitionName == Constants.PageManagementModule);
|
||||||
if (module != null)
|
if (module != null)
|
||||||
{
|
{
|
||||||
switch (location)
|
switch (location)
|
||||||
|
@ -445,7 +454,7 @@
|
||||||
|
|
||||||
private void ConfirmDelete()
|
private void ConfirmDelete()
|
||||||
{
|
{
|
||||||
deleteconfirmation = !deleteconfirmation;
|
_deleteConfirmation = !_deleteConfirmation;
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,4 +483,5 @@
|
||||||
await logger.Log(page.PageId, null, PageState.User.UserId, GetType().AssemblyQualifiedName, "ControlPanel", LogFunction.Delete, LogLevel.Information, ex, "Page Deleted {Page} {Error}", page, ex.Message);
|
await logger.Log(page.PageId, null, PageState.User.UserId, GetType().AssemblyQualifiedName, "ControlPanel", LogFunction.Delete, LogLevel.Information, ex, "Page Deleted {Page} {Error}", page, ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user