From f70fed66ae4388028dffbfcfea7c9eb234e17bcb Mon Sep 17 00:00:00 2001 From: Michael Atwood Date: Wed, 30 Sep 2020 16:22:46 -0700 Subject: [PATCH 1/2] add default class 'container' for div in pane to avoid content squishing --- Oqtane.Client/UI/Pane.razor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Oqtane.Client/UI/Pane.razor b/Oqtane.Client/UI/Pane.razor index 97be40fa..88f677b5 100644 --- a/Oqtane.Client/UI/Pane.razor +++ b/Oqtane.Client/UI/Pane.razor @@ -13,7 +13,7 @@ @code { - private string _paneadminborder = ""; + private string _paneadminborder = "container"; private string _panetitle = ""; [CascadingParameter] @@ -33,7 +33,7 @@ } else { - _paneadminborder = ""; + _paneadminborder = "container"; _panetitle = ""; } From 2a402497cf12196ff7c938b834382719df307152 Mon Sep 17 00:00:00 2001 From: Michael Atwood Date: Thu, 1 Oct 2020 16:02:14 -0700 Subject: [PATCH 2/2] only add div on admin border --- Oqtane.Client/UI/Pane.razor | 38 +++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/Oqtane.Client/UI/Pane.razor b/Oqtane.Client/UI/Pane.razor index 88f677b5..a3429cca 100644 --- a/Oqtane.Client/UI/Pane.razor +++ b/Oqtane.Client/UI/Pane.razor @@ -1,18 +1,23 @@ -@using Microsoft.AspNetCore.Components.Rendering +@using Microsoft.AspNetCore.Components.Rendering @namespace Oqtane.UI @inject IUserService UserService @inject IModuleService ModuleService @inject IModuleDefinitionService ModuleDefinitionService -
- @if (_panetitle != "") - { +@if (_useadminborder) +{ +
@((MarkupString)_panetitle) - } + @DynamicComponent +
+} +else +{ @DynamicComponent -
+} @code { + private bool _useadminborder = false; private string _paneadminborder = "container"; private string _panetitle = ""; @@ -26,8 +31,9 @@ protected override void OnParametersSet() { - if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane) + if (PageState.EditMode && UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane) { + _useadminborder = true; _paneadminborder = "app-pane-admin-border"; _panetitle = "
" + Name + " Pane
"; } @@ -47,8 +53,8 @@ if (module != null && !module.IsDeleted) { var typename = module.ModuleType; - // check for core module actions component - if (Constants.DefaultModuleActions.Contains(PageState.Action)) + // check for core module actions component + if (Constants.DefaultModuleActions.Contains(PageState.Action)) { typename = Constants.DefaultModuleActionsTemplate.Replace(Constants.ActionToken, PageState.Action); } @@ -94,8 +100,8 @@ } else { - // module control does not exist with name specified - } + // module control does not exist with name specified + } } } } @@ -106,8 +112,8 @@ Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId); if (module != null && module.Pane.ToLower() == Name.ToLower() && !module.IsDeleted) { - // check if user is authorized to view module - if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions)) + // check if user is authorized to view module + if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions)) { CreateComponent(builder, module); } @@ -117,8 +123,8 @@ { foreach (Module module in PageState.Modules.Where(item => item.PageId == PageState.Page.PageId && item.Pane.ToLower() == Name.ToLower() && !item.IsDeleted).OrderBy(x => x.Order).ToArray()) { - // check if user is authorized to view module - if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions)) + // check if user is authorized to view module + if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions)) { CreateComponent(builder, module); } @@ -135,4 +141,4 @@ builder.SetKey(module.PageModuleId); builder.CloseComponent(); } -} +} \ No newline at end of file