diff --git a/Oqtane.Client/Modules/Admin/Files/Add.razor b/Oqtane.Client/Modules/Admin/Files/Add.razor index 32e50352..a01b9b1c 100644 --- a/Oqtane.Client/Modules/Admin/Files/Add.razor +++ b/Oqtane.Client/Modules/Admin/Files/Add.razor @@ -4,70 +4,52 @@ @inject IFileService FileService @inject IFolderService FolderService -@if (_folders != null) -{ -
-
- - - -
-
- - - - - -
- - - -
-
-
- - - - - - - - - -
- - - -
- - - -
- -
-
-
-
-
- Cancel -} + + + + + + + +
+ + + +
+ Cancel +
+ + @if (_folders != null) + { + + + + + + + + + +
+ + + +
+ + + +
+ + Cancel + } +
+
@code { private string url = string.Empty; diff --git a/Oqtane.Client/Modules/Admin/Files/Edit.razor b/Oqtane.Client/Modules/Admin/Files/Edit.razor index 241e5082..0083cce0 100644 --- a/Oqtane.Client/Modules/Admin/Files/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Files/Edit.razor @@ -33,7 +33,7 @@ - + diff --git a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor index 9fdabbf5..10671204 100644 --- a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor +++ b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Edit.razor @@ -3,31 +3,113 @@ @inject IModuleDefinitionService ModuleDefinitionService @inject NavigationManager NavigationManager - - - - - - - - -
- - - -
- - -
+ + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+
+ + + + + +
+ +
+
+
Cancel -
-
+

@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; diff --git a/Oqtane.Client/Modules/Admin/Modules/Settings.razor b/Oqtane.Client/Modules/Admin/Modules/Settings.razor index 44a55284..c8a90d23 100644 --- a/Oqtane.Client/Modules/Admin/Modules/Settings.razor +++ b/Oqtane.Client/Modules/Admin/Modules/Settings.razor @@ -5,90 +5,73 @@ @inject IModuleService ModuleService @inject IPageModuleService PageModuleService -@if (_containers != null) -{ -
-
- - - -
-
-
- - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - -
- - - -
-
- @if (_settingsModuleType != null) - { -
-
- @DynamicComponent -
- } -
-
-
- - - Cancel -} + + + @if (_containers != null) + { + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ } +
+ + @if (_containers != null) + { + + + + +
+ +
+ } +
+ @if (_settingsModuleType != null) + { + + @DynamicComponent + + } +
+ +Cancel @code { private Dictionary _containers; diff --git a/Oqtane.Client/Modules/Admin/Pages/Add.razor b/Oqtane.Client/Modules/Admin/Pages/Add.razor index 2b495fb9..7c53755a 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Add.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Add.razor @@ -4,164 +4,189 @@ @inject IPageService PageService @inject IThemeService ThemeService -@if (_themeList != null) -{ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + +
- - - -
- - - -
- - - -
- - - -
- - - - @if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">")) - { - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + +
+ + + +
+ + + + @if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">")) { - + } - - } -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - -
- - Cancel -} +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+ } + + + + + + +
+ +
+
+ + +Cancel @code { - private Dictionary _themes = new Dictionary(); - private Dictionary _panelayouts = new Dictionary(); + private Dictionary _themes; + private Dictionary _panelayouts; private List _themeList; private List _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(); 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(); } - StateHasChanged(); } catch (Exception ex) diff --git a/Oqtane.Client/Modules/Admin/Pages/Edit.razor b/Oqtane.Client/Modules/Admin/Pages/Edit.razor index 6ac773a0..056cc9bf 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Edit.razor @@ -4,185 +4,202 @@ @inject IPageService PageService @inject IThemeService ThemeService -@if (_themeList != null) -{ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + +
- - - -
- - - -
- - - -
- - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + +
+ + + +
+ + + + @if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">")) { - + } - else - { - - } - } - -
- - - - @if (_children != null && _children.Count > 0 && (_insert == "<" || _insert == ">")) - { - - } -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - -
- - Cancel -
-
- -} +
+ + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+

+ + } + + + + + + +
+ +
+
+ + +Cancel @code { - private Dictionary _themes = new Dictionary(); - private Dictionary _panelayouts = new Dictionary(); + private Dictionary _themes; + private Dictionary _panelayouts; private List _themeList; private List _pageList; private int _pageId; @@ -277,13 +294,26 @@ try { _parentid = (string)e.Value; + _children = new List(); 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) { diff --git a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor index 6711617a..0758e80d 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor @@ -6,170 +6,161 @@ @inject ISettingService SettingService @inject INotificationService NotificationService -@if (PageState.User != null && profiles != null) -{ -
-
- - - -
-
- @if (photofileid != -1) - { - @displayname - } - else - { -
- } - - - - - - - - - - - - - - - - - - - - - - - - - - - @foreach (Profile profile in profiles) - { - var p = profile; - if (p.Category != category) - { - - - - category = p.Category; - } - - - - - } -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- @p.Category -
- - - -
- - -
- -
+ + + @if (PageState.User != null) + { + @if (photofileid != -1) + { + @displayname + } + else + {
- -

- @if (filter == "to") + } + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + } +
+ + @if (profiles != null) + { + + @foreach (Profile profile in profiles) { - -
-
- - - - - - - - - - - - - - - - - + var p = profile; + if (p.Category != category) + { + + + + category = p.Category; + } + + + + } - else - { - -
-
- - - - - - - - - - - - - - - - - - } -

- - - - - -} +
  FromSubjectReceived@(context.FromUser == null ? "System" : context.FromUser.DisplayName)@context.Subject@context.CreatedOn@(context.Body.Length > 100 ? context.Body.Substring(0,100) : context.Body)
+ @p.Category +
+ + + +
  ToSubjectSent@(context.ToUser == null ? context.ToEmail : context.ToUser.DisplayName)@context.Subject@context.CreatedOn@(context.Body.Length > 100 ? context.Body.Substring(0,100) : context.Body)
+ + + } +
+ + @if (notifications != null) + { + +

+ @if (filter == "to") + { + +
+   +   + From + Subject + Received +
+ + + + @(context.FromUser == null ? "System" : context.FromUser.DisplayName) + @context.Subject + @context.CreatedOn + + + + @(context.Body.Length > 100 ? context.Body.Substring(0, 100) : context.Body) + +
+ } + else + { + +
+   +   + To + Subject + Sent +
+ + + + @(context.ToUser == null ? context.ToEmail : context.ToUser.DisplayName) + @context.Subject + @context.CreatedOn + + + + @(context.Body.Length > 100 ? context.Body.Substring(0, 100) : context.Body) + +
+ } +

+ + } +
+
@code { private string username = string.Empty; @@ -196,15 +187,15 @@ username = PageState.User.Username; email = PageState.User.Email; displayname = PageState.User.DisplayName; - + if (PageState.User.PhotoFileId != null) { photofileid = PageState.User.PhotoFileId.Value; } - + profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId); settings = await SettingService.GetUserSettingsAsync(PageState.User.UserId); - + await LoadNotificationsAsync(); } else @@ -243,12 +234,12 @@ user.DisplayName = (displayname == string.Empty ? username : displayname); user.PhotoFileId = null; photofileid = filemanager.GetFileId(); - + if (photofileid != -1) { user.PhotoFileId = photofileid; } - + await UserService.UpdateUserAsync(user); await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId); await logger.LogInformation("User Profile Saved"); @@ -294,7 +285,7 @@ { await NotificationService.DeleteNotificationAsync(Notification.NotificationId); } - + await logger.LogInformation("Notification Deleted {Notification}", Notification); await LoadNotificationsAsync(); StateHasChanged(); @@ -309,7 +300,7 @@ private async void FilterChanged(ChangeEventArgs e) { filter = (string)e.Value; - + await LoadNotificationsAsync(); StateHasChanged(); } diff --git a/Oqtane.Client/Modules/Controls/PermissionGrid.razor b/Oqtane.Client/Modules/Controls/PermissionGrid.razor index 48a3d5b8..543403f2 100644 --- a/Oqtane.Client/Modules/Controls/PermissionGrid.razor +++ b/Oqtane.Client/Modules/Controls/PermissionGrid.razor @@ -12,7 +12,7 @@ Role @foreach (PermissionString permission in _permissions) { - @permission.PermissionName @EntityName + @permission.PermissionName } @foreach (Role role in _roles) @@ -38,7 +38,7 @@ User @foreach (PermissionString permission in _permissions) { - @permission.PermissionName @EntityName + @permission.PermissionName } diff --git a/Oqtane.Client/Modules/Controls/TabStrip.razor b/Oqtane.Client/Modules/Controls/TabStrip.razor index 10527d0f..4f0b872f 100644 --- a/Oqtane.Client/Modules/Controls/TabStrip.razor +++ b/Oqtane.Client/Modules/Controls/TabStrip.razor @@ -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)