improving admin components
This commit is contained in:
parent
b9d70dd11a
commit
f56d1fe543
|
@ -4,26 +4,8 @@
|
|||
@inject IFileService FileService
|
||||
@inject IFolderService FolderService
|
||||
|
||||
@if (_folders != null)
|
||||
{
|
||||
<div class="container-fluid">
|
||||
<div class="form-group">
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#Upload" role="tab">
|
||||
Upload Files
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Download" role="tab">
|
||||
Download Files
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="Upload" class="tab-pane fade show active" role="tabpanel">
|
||||
<TabStrip>
|
||||
<TabPanel Name="Upload" Heading="Upload Files">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -34,12 +16,15 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="Download" class="tab-pane fade" role="tabpanel">
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
</TabPanel>
|
||||
<TabPanel Name="Download" Heading="Download Files">
|
||||
@if (_folders != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="url" HelpText="Enter the file url">Url: </Label>
|
||||
<Label For="url" HelpText="Enter the url of the file you wish to download">Url: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="url" class="form-control" @bind="@url" />
|
||||
|
@ -47,7 +32,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="folder" HelpText="Select the folder the file is in">Folder: </Label>
|
||||
<Label For="folder" HelpText="Select the folder to save the file in">Folder: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="folder" class="form-control" @bind="@_folderId">
|
||||
|
@ -60,14 +45,11 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary" @onclick="Download">Download</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<button type="button" class="btn btn-success" @onclick="Download">Download</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
}
|
||||
</TabPanel>
|
||||
</TabStrip>
|
||||
|
||||
@code {
|
||||
private string url = string.Empty;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<Label For="permissions" HelpText="Select the permissions you want for the file">Permissions: </Label>
|
||||
<Label For="permissions" HelpText="Select the permissions you want for the folder">Permissions: </Label>
|
||||
<PermissionGrid EntityName="@EntityNames.Folder" PermissionNames="Browse,View,Edit" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
@inject IModuleDefinitionService ModuleDefinitionService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<TabStrip>
|
||||
<TabPanel Name="Definition">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -13,21 +15,101 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<Label For="permissions" HelpText="Select who you want to access the module">Permissions: </Label>
|
||||
<td>
|
||||
<Label For="version" HelpText="The version of the module">Version: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="version" class="form-control" @bind="@_version" disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="categories" HelpText="Comma delimited list of module categories">Categories: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="categories" class="form-control" @bind="@_categories" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<Section Name="Information">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="moduledefinitionname" HelpText="The internal name of the module">Internal Name: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="moduledefinitionname" class="form-control" @bind="@_moduledefinitionname" disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="description" HelpText="The description of the module">Description: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<textarea id="description" class="form-control" @bind="@_description" rows="2" disabled></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="owner" HelpText="The owner or creator of the module">Owner: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="owner" class="form-control" @bind="@_owner" disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="url" HelpText="The reference url of the module">Reference Url: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="url" class="form-control" @bind="@_url" disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="contact" HelpText="The contact for the module">Contact: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="contact" class="form-control" @bind="@_contact" disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="license" HelpText="The license of the module">License: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<textarea id="license" class="form-control" @bind="@_license" rows="5" disabled></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</Section>
|
||||
</TabPanel>
|
||||
<TabPanel Name="Permissions">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<PermissionGrid EntityName="@EntityNames.ModuleDefinition" PermissionNames="@PermissionNames.Utilize" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</TabPanel>
|
||||
</TabStrip>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveModuleDefinition">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<br />
|
||||
<br />
|
||||
<br /><br />
|
||||
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
|
||||
|
||||
@code {
|
||||
private int _moduleDefinitionId;
|
||||
private string _name;
|
||||
private string _version;
|
||||
private string _categories;
|
||||
private string _moduledefinitionname = "";
|
||||
private string _description = "";
|
||||
private string _owner = "";
|
||||
private string _url = "";
|
||||
private string _contact = "";
|
||||
private string _license = "";
|
||||
private string _permissions;
|
||||
private string _createdby;
|
||||
private DateTime _createdon;
|
||||
|
@ -49,6 +131,14 @@
|
|||
if (moduleDefinition != null)
|
||||
{
|
||||
_name = moduleDefinition.Name;
|
||||
_version = moduleDefinition.Version;
|
||||
_categories = moduleDefinition.Categories;
|
||||
_moduledefinitionname = moduleDefinition.ModuleDefinitionName;
|
||||
_description = moduleDefinition.Description;
|
||||
_owner = moduleDefinition.Owner;
|
||||
_url = moduleDefinition.Url;
|
||||
_contact = moduleDefinition.Contact;
|
||||
_license = moduleDefinition.License;
|
||||
_permissions = moduleDefinition.Permissions;
|
||||
_createdby = moduleDefinition.CreatedBy;
|
||||
_createdon = moduleDefinition.CreatedOn;
|
||||
|
|
|
@ -5,32 +5,11 @@
|
|||
@inject IModuleService ModuleService
|
||||
@inject IPageModuleService PageModuleService
|
||||
|
||||
<TabStrip>
|
||||
<TabPanel Name="Settings" Heading="Module Settings">
|
||||
@if (_containers != null)
|
||||
{
|
||||
<div class="container-fluid">
|
||||
<div class="form-group">
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#Settings" role="tab">
|
||||
Module Settings
|
||||
</a>
|
||||
</li>
|
||||
@if (_settingsModuleType != null)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#ModuleSettings" role="tab">
|
||||
@_settingstitle
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="Settings" class="tab-pane fade show active" role="tabpanel">
|
||||
<br />
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="title" HelpText="Enter the title of the module">Title: </Label>
|
||||
|
@ -53,12 +32,6 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<Label For="permissions" HelpText="Who do you want to be able to access the module">Permissions: </Label>
|
||||
<PermissionGrid EntityName="@EntityNames.Module" PermissionNames="@_permissionNames" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="page" HelpText="The page that the module is on">Page: </Label>
|
||||
|
@ -67,28 +40,38 @@
|
|||
<select id="page" class="form-control" @bind="@_pageId">
|
||||
@foreach (Page p in PageState.Pages)
|
||||
{
|
||||
<option value="@p.PageId">@p.Name</option>
|
||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
||||
{
|
||||
<option value="@p.PageId">@(new string('-', p.Level * 2))@(p.Name)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
</TabPanel>
|
||||
<TabPanel Name="Permissions">
|
||||
@if (_containers != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<PermissionGrid EntityName="@EntityNames.Module" PermissionNames="@_permissionNames" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
</TabPanel>
|
||||
@if (_settingsModuleType != null)
|
||||
{
|
||||
<div id="ModuleSettings" class="tab-pane fade" role="tabpanel">
|
||||
<br />
|
||||
<TabPanel Name="ModuleSettings" Heading="@_settingstitle">
|
||||
@DynamicComponent
|
||||
</div>
|
||||
</TabPanel>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</TabStrip>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveModule">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
}
|
||||
|
||||
@code {
|
||||
private Dictionary<string, string> _containers;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
@inject IPageService PageService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
<TabStrip>
|
||||
<TabPanel Name="Settings">
|
||||
@if (_themeList != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
|
@ -17,23 +19,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Title" HelpText="Enter the page title">Title: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Title" class="form-control" @bind="@_title" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Path" HelpText="Enter the path for the page">Path: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Path" class="form-control" @bind="@_path" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Parent" HelpText="Select the parent for the page">Parent: </Label>
|
||||
<Label For="Parent" HelpText="Select the parent for the page in the site hierarchy">Parent: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Parent" class="form-control" @onchange="(e => ParentChanged(e))">
|
||||
|
@ -47,7 +33,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Insert" HelpText="Select the insert for the page">Insert: </Label>
|
||||
<Label For="Insert" HelpText="Select the location where you would like the page to be inserted in relation to other pages">Insert: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Insert" class="form-control" @bind="@_insert">
|
||||
|
@ -61,7 +47,7 @@
|
|||
</select>
|
||||
@if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">"))
|
||||
{
|
||||
<select id="Insert" class="form-control" @bind="@_childid">
|
||||
<select class="form-control" @bind="@_childid">
|
||||
<option value="-1"><Select Page></option>
|
||||
@foreach (Page page in _children)
|
||||
{
|
||||
|
@ -73,7 +59,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Navigation" HelpText="Select whether the page has navigation bar">Navigation? </Label>
|
||||
<Label For="Navigation" HelpText="Select whether the page is part of the site navigation or hidden">Navigation? </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Navigation" class="form-control" @bind="@_isnavigation">
|
||||
|
@ -84,26 +70,84 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Url" HelpText="Enter the url for the page">Url: </Label>
|
||||
<Label For="Path" HelpText="Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used.">Url Path: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Path" class="form-control" @bind="@_path" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Url" HelpText="Optionally enter a url which this page should redirect to when a user navigates to it">Redirect: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Url" class="form-control" @bind="@_url" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<Section Name="Appearance">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Personalizable" HelpText="Do you want the page to be personalized by users">Personalizable? </Label>
|
||||
<Label For="Title" HelpText="Optionally enter the page title. If you do not provide a page title, the page name will be used.">Title: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Personalizable" class="form-control" @bind="@_ispersonalizable">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
<input id="Title" class="form-control" @bind="@_title" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Theme" HelpText="Select the theme for this page">Theme: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Theme" class="form-control" @onchange="(e => ThemeChanged(e))">
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in _themes)
|
||||
{
|
||||
if (item.Key == _themetype)
|
||||
{
|
||||
<option value="@item.Key" selected>@item.Value</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Default-Mode" HelpText="Select the default mode you want for the page">Default Mode? </Label>
|
||||
<Label For="Layout" HelpText="Select a layout for the page (if the selected theme supports it)">Layout: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Layout" class="form-control" @bind="@_layouttype">
|
||||
<option value=""><Select Layout></option>
|
||||
@foreach (KeyValuePair<string, string> panelayout in _panelayouts)
|
||||
{
|
||||
if (panelayout.Key == _layouttype)
|
||||
{
|
||||
<option value="@panelayout.Key" selected>@panelayout.Value</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@panelayout.Key">@panelayout.Value</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Icon" HelpText="Optionally provide an icon for this page which will be displayed in the site navigation">Icon: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Icon" class="form-control" @bind="@_icon" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Default-Mode" HelpText="Select the default administration mode you want for this page">Default Mode? </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Default-Mode" class="form-control" @bind="@_mode">
|
||||
|
@ -114,54 +158,35 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Theme" HelpText="Select the theme you want for the page">Theme: </Label>
|
||||
<Label For="Personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content">Personalizable? </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Theme" class="form-control" @onchange="(e => ThemeChanged(e))">
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in _themes)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
<select id="Personalizable" class="form-control" @bind="@_ispersonalizable">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Layout" HelpText="Select the layout for the page">Layout: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Layout" class="form-control" @bind="@_layouttype">
|
||||
<option value=""><Select Layout></option>
|
||||
@foreach (KeyValuePair<string, string> panelayout in _panelayouts)
|
||||
{
|
||||
<option value="@panelayout.Key">@panelayout.Value</option>
|
||||
</table>
|
||||
</Section>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</TabPanel>
|
||||
<TabPanel Name="Permissions">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Icon" HelpText="Enter the icon for the page">Icon: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Icon" class="form-control" @bind="@_icon" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<Label For="Permissions" HelpText="Select the permissions you want for the page">Permissions: </Label>
|
||||
<PermissionGrid EntityName="@EntityNames.Page" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</TabPanel>
|
||||
</TabStrip>
|
||||
<button type="button" class="btn btn-success" @onclick="SavePage">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
}
|
||||
|
||||
@code {
|
||||
private Dictionary<string, string> _themes = new Dictionary<string, string>();
|
||||
private Dictionary<string, string> _panelayouts = new Dictionary<string, string>();
|
||||
private Dictionary<string, string> _themes;
|
||||
private Dictionary<string, string> _panelayouts;
|
||||
private List<Theme> _themeList;
|
||||
private List<Page> _pageList;
|
||||
private string _name;
|
||||
|
@ -191,12 +216,12 @@
|
|||
_pageList = PageState.Pages;
|
||||
_children = PageState.Pages.Where(item => item.ParentId == null).ToList();
|
||||
|
||||
_themes = ThemeService.GetThemeTypes(_themeList);
|
||||
_themetype = PageState.Site.DefaultThemeType;
|
||||
|
||||
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
|
||||
_layouttype = PageState.Site.DefaultLayoutType;
|
||||
|
||||
_themes = ThemeService.GetThemeTypes(_themeList);
|
||||
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
|
||||
|
||||
_permissions = string.Empty;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -211,13 +236,26 @@
|
|||
try
|
||||
{
|
||||
_parentid = (string)e.Value;
|
||||
_children = new List<Page>();
|
||||
if (_parentid == "-1")
|
||||
{
|
||||
_children = PageState.Pages.Where(item => item.ParentId == null).ToList();
|
||||
foreach (Page p in PageState.Pages.Where(item => item.ParentId == null))
|
||||
{
|
||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
||||
{
|
||||
_children.Add(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_children = PageState.Pages.Where(item => item.ParentId == int.Parse(_parentid)).ToList();
|
||||
foreach (Page p in PageState.Pages.Where(item => item.ParentId == int.Parse(_parentid)))
|
||||
{
|
||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
||||
{
|
||||
_children.Add(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
|
@ -241,7 +279,6 @@
|
|||
{
|
||||
_panelayouts = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
@inject IPageService PageService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
<TabStrip>
|
||||
<TabPanel Name="Settings">
|
||||
@if (_themeList != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
|
@ -12,28 +14,12 @@
|
|||
<Label For="Name" HelpText="Enter the page name">Name: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="name" class="form-control" @bind="@_name" />
|
||||
<input id="Name" class="form-control" @bind="@_name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Title" HelpText="Enter the page title">Title: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Title" class="form-control" @bind="@_title" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Path" HelpText="Enter the path for the page">Path: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Path" class="form-control" @bind="@_path" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Parent" HelpText="Select the parent for the page">Parent: </Label>
|
||||
<Label For="Parent" HelpText="Select the parent for the page in the site hierarchy">Parent: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Parent" class="form-control" @onchange="(e => ParentChanged(e))">
|
||||
|
@ -54,7 +40,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Move" HelpText="Select where you wan to move the page">Move: </Label>
|
||||
<Label For="Move" HelpText="Select the location where you would like the page to be moved in relation to other pages">Move: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Move" class="form-control" @bind="@_insert">
|
||||
|
@ -72,7 +58,7 @@
|
|||
</select>
|
||||
@if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">"))
|
||||
{
|
||||
<select id="Move" class="form-control" @bind="@_childid">
|
||||
<select class="form-control" @bind="@_childid">
|
||||
<option value="-1"><Select Page></option>
|
||||
@foreach (Page page in _children)
|
||||
{
|
||||
|
@ -84,15 +70,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label for="Url" HelpText="Enter the url for the page">Url: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Url" class="form-control" @bind="@_url" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Navigation" HelpText="Select whether the page has navigation bar">Navigation? </Label>
|
||||
<Label For="Navigation" HelpText="Select whether the page is part of the site navigation or hidden">Navigation? </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Navigation" class="form-control" @bind="@_isnavigation">
|
||||
|
@ -103,29 +81,34 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Personalizable" HelpText="Do you want the page to be personalized by users">Personalizable? </Label>
|
||||
<Label For="Path" HelpText="Optionally enter a url path for this page (ie. home ). If you do not provide a url path, the page name will be used.">Url Path: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Personalizable" class="form-control" @bind="@_ispersonalizable">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
<input id="Path" class="form-control" @bind="@_path" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Default-Mode" HelpText="Select the default mode you want for the page">Default Mode? </Label>
|
||||
<Label For="Url" HelpText="Optionally enter a url which this page should redirect to when a user navigates to it">Redirect: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Default-Mode" class="form-control" @bind="@_mode">
|
||||
<option value="view">View Mode</option>
|
||||
<option value="edit">Edit Mode</option>
|
||||
</select>
|
||||
<input id="Url" class="form-control" @bind="@_url" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<Section Name="Appearance">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Title" HelpText="Optionally enter the page title. If you do not provide a page title, the page name will be used.">Title: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Title" class="form-control" @bind="@_title" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Theme" HelpText="Select the theme you want for the page">Theme: </Label>
|
||||
<Label For="Theme" HelpText="Select the theme for this page">Theme: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Theme" class="form-control" @onchange="(e => ThemeChanged(e))">
|
||||
|
@ -146,43 +129,77 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Layout" HelpText="Select the layout for the page">Layout: </Label>
|
||||
<Label For="Layout" HelpText="Select a layout for the page (if the selected theme supports it)">Layout: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Layout" class="form-control" @bind="@_layouttype">
|
||||
<option value=""><Select Layout></option>
|
||||
@foreach (KeyValuePair<string, string> panelayout in _panelayouts)
|
||||
{
|
||||
if (panelayout.Key == _layouttype)
|
||||
{
|
||||
<option value="@panelayout.Key" selected>@panelayout.Value</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@panelayout.Key">@panelayout.Value</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Icon" HelpText="Enter the icon for the page">Icon: </Label>
|
||||
<Label For="Icon" HelpText="Optionally provide an icon for this page which will be displayed in the site navigation">Icon: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="Icon" class="form-control" @bind="@_icon" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<Label For="Permissions" HelpText="Select the permissions you want for the page">Permissions: </Label>
|
||||
<td>
|
||||
<Label For="Default-Mode" HelpText="Select the default administration mode you want for this page">Default Mode? </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Default-Mode" class="form-control" @bind="@_mode">
|
||||
<option value="view">View Mode</option>
|
||||
<option value="edit">Edit Mode</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="Personalizable" HelpText="Select whether you would like users to be able to personalize this page with their own content">Personalizable? </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="Personalizable" class="form-control" @bind="@_ispersonalizable">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</Section>
|
||||
<br /><br />
|
||||
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo>
|
||||
}
|
||||
</TabPanel>
|
||||
<TabPanel Name="Permissions">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<PermissionGrid EntityName="@EntityNames.Page" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</TabPanel>
|
||||
</TabStrip>
|
||||
<button type="button" class="btn btn-success" @onclick="SavePage">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<br />
|
||||
<br />
|
||||
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo>
|
||||
}
|
||||
|
||||
@code {
|
||||
private Dictionary<string, string> _themes = new Dictionary<string, string>();
|
||||
private Dictionary<string, string> _panelayouts = new Dictionary<string, string>();
|
||||
private Dictionary<string, string> _themes;
|
||||
private Dictionary<string, string> _panelayouts;
|
||||
private List<Theme> _themeList;
|
||||
private List<Page> _pageList;
|
||||
private int _pageId;
|
||||
|
@ -277,13 +294,26 @@
|
|||
try
|
||||
{
|
||||
_parentid = (string)e.Value;
|
||||
_children = new List<Page>();
|
||||
if (_parentid == "-1")
|
||||
{
|
||||
_children = PageState.Pages.Where(item => item.ParentId == null).ToList();
|
||||
foreach(Page p in PageState.Pages.Where(item => item.ParentId == null))
|
||||
{
|
||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
||||
{
|
||||
_children.Add(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_children = PageState.Pages.Where(item => item.ParentId == int.Parse(_parentid)).ToList();
|
||||
foreach (Page p in PageState.Pages.Where(item => item.ParentId == int.Parse(_parentid)))
|
||||
{
|
||||
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, p.Permissions))
|
||||
{
|
||||
_children.Add(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_parentid == _currentparentid)
|
||||
{
|
||||
|
|
|
@ -6,26 +6,10 @@
|
|||
@inject ISettingService SettingService
|
||||
@inject INotificationService NotificationService
|
||||
|
||||
@if (PageState.User != null && profiles != null)
|
||||
<TabStrip>
|
||||
<TabPanel Name="Identity">
|
||||
@if (PageState.User != null)
|
||||
{
|
||||
<div class="container-fluid">
|
||||
<div class="form-group">
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#Profile" role="tab">
|
||||
Profile
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Notifications" role="tab">
|
||||
Notifications
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div id="Profile" class="tab-pane fade show active" role="tabpanel">
|
||||
@if (photofileid != -1)
|
||||
{
|
||||
<img src="@(ContentUrl(photofileid))" alt="@displayname" style="max-width: 400px" class="rounded-circle mx-auto d-block">
|
||||
|
@ -83,7 +67,15 @@
|
|||
<FileManager FileId="@photofileid.ToString()" @ref="filemanager" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary" @onclick="Save">Save</button>
|
||||
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||
}
|
||||
</TabPanel>
|
||||
<TabPanel Name="Profile">
|
||||
@if (profiles != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
@foreach (Profile profile in profiles)
|
||||
{
|
||||
var p = profile;
|
||||
|
@ -108,10 +100,11 @@
|
|||
</table>
|
||||
<button type="button" class="btn btn-primary" @onclick="Save">Save</button>
|
||||
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button>
|
||||
</div>
|
||||
|
||||
<div id="Notifications" class="tab-pane fade" role="tabpanel">
|
||||
<br />
|
||||
}
|
||||
</TabPanel>
|
||||
<TabPanel Name="Notifications">
|
||||
@if (notifications != null)
|
||||
{
|
||||
<ActionLink Action="Add" Text="Send Notification" Security="SecurityAccessLevel.View" EditMode="false" />
|
||||
<br /><br />
|
||||
@if (filter == "to")
|
||||
|
@ -165,11 +158,9 @@
|
|||
<option value="to">Inbox</option>
|
||||
<option value="from">Sent Items</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</TabPanel>
|
||||
</TabStrip>
|
||||
|
||||
@code {
|
||||
private string username = string.Empty;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<th>Role</th>
|
||||
@foreach (PermissionString permission in _permissions)
|
||||
{
|
||||
<th style="text-align: center;">@permission.PermissionName @EntityName</th>
|
||||
<th style="text-align: center;">@permission.PermissionName</th>
|
||||
}
|
||||
</tr>
|
||||
@foreach (Role role in _roles)
|
||||
|
@ -38,7 +38,7 @@
|
|||
<th>User</th>
|
||||
@foreach (PermissionString permission in _permissions)
|
||||
{
|
||||
<th style="text-align: center;">@permission.PermissionName @EntityName</th>
|
||||
<th style="text-align: center;">@permission.PermissionName</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -38,7 +38,15 @@
|
|||
public RenderFragment ChildContent { get; set; } // contains the TabPanels
|
||||
|
||||
[Parameter]
|
||||
public string ActiveTab { get; set; } // optional - defaults to first TabPanel if not specified
|
||||
public string ActiveTab { get; set; } // optional - defaults to first TabPanel if not specified. Can also be set using a "tab=" querystring parameter.
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
if (PageState.QueryString.ContainsKey("tab"))
|
||||
{
|
||||
ActiveTab = PageState.QueryString["tab"];
|
||||
}
|
||||
}
|
||||
|
||||
internal void AddTabPanel(TabPanel tabPanel)
|
||||
{
|
||||
|
@ -47,6 +55,7 @@
|
|||
{
|
||||
ActiveTab = tabPanel.Name;
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private string DisplayHeading(string Name, string Heading)
|
||||
|
|
Loading…
Reference in New Issue
Block a user