From 64ebfdf82eead983016819d29a3bd6125de94dcf Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Sun, 23 May 2021 23:49:28 -0400 Subject: [PATCH 1/8] 'backup' --- .../SqlDataProvider/09.09.02.SqlDataProvider | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 DNN Platform/Website/Providers/DataProviders/SqlDataProvider/09.09.02.SqlDataProvider diff --git a/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/09.09.02.SqlDataProvider b/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/09.09.02.SqlDataProvider new file mode 100644 index 00000000000..33a259d05fa --- /dev/null +++ b/DNN Platform/Website/Providers/DataProviders/SqlDataProvider/09.09.02.SqlDataProvider @@ -0,0 +1,9 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ From 96186a5c7054241f4cf6b1ee3c04222a84fa3ed3 Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Sat, 29 May 2021 23:11:28 -0400 Subject: [PATCH 2/8] Modify default styling for PersonaBar and EditBar --- .../Dnn.EditBar.UI/editBar/css/main.css | 2 +- .../admin/personaBar/css/main.css | 42 ++++++++++++------- .../admin/personaBar/images/nav_content.svg | 17 ++++---- .../admin/personaBar/images/nav_edit.svg | 9 ++-- .../admin/personaBar/images/nav_manage.svg | 20 +++++---- .../admin/personaBar/images/nav_settings.svg | 11 ++--- 6 files changed, 58 insertions(+), 43 deletions(-) diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css index 09dfbec2b8e..2e555765305 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css @@ -27,7 +27,7 @@ body { visibility: visible; height: 80px; display: block; - background-color: #2f2f2f; + background-color: #0B1C24; color: white; min-height: 20px; padding: 26px 26px 0; diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css index df0d092d839..4dab08b3efd 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css @@ -716,23 +716,25 @@ transform: rotate(180deg); /* persona bar Menu*/ .personabar { width: 80px; - background-color: #3d3c3c; + background-color: #0e2936; height: 100%; position: fixed; top: 0; left: -100px; - z-index: 1000;display: none; + z-index: 1000; + display: none; } .personabar .personabarLogo { width: 80px; height: 103px; - background: #515050 url('../images/Logo.svg') no-repeat center center; + background: url('../images/Logo.svg') no-repeat center center; -ms-background-size: 32px auto; background-size: 32px auto; position: relative; + border-bottom: 1px solid #1e485e; } .personabar .personabarLogo:hover { - background-color: #2f2f2f; + background-color: #0b1c24; } .personabar .personabarLogo a.update { text-decoration: none; @@ -757,13 +759,12 @@ transform: rotate(180deg); .personabarnav { margin: 0; padding: 0; - border-bottom: 1px solid #373737; } .personabarnav > li { list-style-type: none; margin: 0; - padding: 28px; + padding: 17px 16px; cursor: pointer; text-align: center; background-repeat: repeat-x; @@ -771,7 +772,6 @@ transform: rotate(180deg); color: #737171; font-weight: 600; position: relative; - border-top: 1px solid #373737; height: 80px; transition: background-color 200ms linear, color 200ms linear; -webkit-box-sizing: border-box; @@ -784,10 +784,10 @@ transform: rotate(180deg); } .personabarnav > li > span.icon-loader { display: inline-block; - width: 24px; - height: 24px; + width: 38px; + height: 38px; margin: 0; - padding: 0; + padding: 5px; vertical-align: top; } .personabarnav > li > span.icon-loader img { @@ -798,6 +798,12 @@ transform: rotate(180deg); .personabarnav > li > span.icon-loader svg { fill: #868484; } +.personabarnav > li > span.icon-loader svg .back { + fill: #0b1c24; +} +.personabarnav>li>span.icon-loader svg .main { + fill: #3c7a9a; +} .personabarnav > li:hover > span.icon-loader svg, .personabarnav > li.active > span.icon-loader svg, .personabarnav > li.selected > span.icon-loader svg { @@ -816,13 +822,17 @@ transform: rotate(180deg); } .personabarnav > li:hover,.personabarnav > li.active { color: #fff; - background-color: #2f2f2f; + background-color: #0b1c24; border-right: none !important; } .personabarnav > li.pending { border-right: 3px solid #9FDBF0; } +.personabarnav > li#Edit { + border-top: 1px solid #1e485e; +} + .personabarnav > li#Edit.selected { color: #737171; background-color: transparent; @@ -911,7 +921,7 @@ transform: rotate(180deg); position: absolute; left: 80px; padding: 0 0px 42px 37px; - background-color: #2f2f2f; + background-color: #0b1c24; display: none; /* display: none; IE not apply list-style-type: none; with this active it will be applied in js @@ -1902,7 +1912,7 @@ div.ui-dialog-titlebar > .ui-dialog-titlebar-close:hover { .hoverSummaryMenu { position: absolute; width: 200px; - background-color: #2f2f2f; + background-color: #0b1c24; padding: 27px 37px 42px 37px; left: 80px; top: 0; @@ -1949,9 +1959,9 @@ div.ui-dialog-titlebar > .ui-dialog-titlebar-close:hover { } .hoverSummaryMenu ul li label { font-size: 12px; - color: #868484; - padding: 2px 0 13px 0; - border-bottom: 1px solid #868484; + color: #3c7a9a; + padding: 11px 0 18px 0; + border-bottom: 1px solid #1e485e; text-transform: uppercase; -moz-word-break: break-all; -o-word-break: break-all; diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_content.svg b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_content.svg index 5077eedb2a0..c9fd064f148 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_content.svg +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_content.svg @@ -1,11 +1,12 @@ - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_edit.svg b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_edit.svg index 1d060d67f31..db038a7645a 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_edit.svg +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_edit.svg @@ -1,7 +1,8 @@ - - - - + + + + + diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_manage.svg b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_manage.svg index 797682e5151..c2f53fea850 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_manage.svg +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_manage.svg @@ -1,12 +1,14 @@ - - - - - + + + + + + diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_settings.svg b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_settings.svg index 314c7a2d697..b39e2afe402 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_settings.svg +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/images/nav_settings.svg @@ -1,8 +1,9 @@ - + + From 8ff1348413c8179549feefd388fd55002bd8c86e Mon Sep 17 00:00:00 2001 From: Daniel Valadas Date: Sun, 30 May 2021 01:47:41 -0400 Subject: [PATCH 3/8] Allows customizing the PersonaBar menu styles Migrates hardcoded colors and logo into a theme.css file where integrators can customize the Persona Bar and Edit Bar menu using css variables. --- .../Dnn.EditBar.UI/editBar/css/main.css | 6 ++--- .../Dnn.EditBar.UI/editBar/css/theme.css | 3 +++ .../editBar/scripts/bootstrap.js | 2 ++ .../admin/personaBar/css/main.css | 26 ++++++++----------- .../admin/personaBar/css/theme.css | 10 +++++++ .../admin/personaBar/scripts/bootstrap.js | 6 ++--- 6 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css create mode 100644 Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css index 2e555765305..9c58cb202bc 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/main.css @@ -27,7 +27,7 @@ body { visibility: visible; height: 80px; display: block; - background-color: #0B1C24; + background-color: var(--dnn-color-editbar-background); color: white; min-height: 20px; padding: 26px 26px 0; @@ -99,9 +99,7 @@ body { .editbar .left-section { margin-left: 20px; } -.editbar .left-section ul { - -} + .editbar .left-section ul li { margin-left: 7px; } diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css new file mode 100644 index 00000000000..16b0982ae98 --- /dev/null +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css @@ -0,0 +1,3 @@ +:root{ + --dnn-color-editbar-background: #0b1c24; +} \ No newline at end of file diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js index 8ee69cceeb7..5d6829011c0 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js @@ -26,8 +26,10 @@ var version = (cdv ? '?cdv=' + cdv : '') + (debugMode ? '&t=' + Math.random(): ''); var styles = []; var mainJs = mobi ? 'scripts/main.mobi.js' : 'scripts/main.js'; + var themeCss = 'css/theme.css'; var mainCss = mobi ? 'css/main.mobi.css' : 'css/main.css'; + styles.push(themeCss); styles.push(mainCss); addCssToHead(styles, version); diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css index 4dab08b3efd..4bc84f4c643 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css @@ -716,7 +716,7 @@ transform: rotate(180deg); /* persona bar Menu*/ .personabar { width: 80px; - background-color: #0e2936; + background-color: var(--dnn-color-pb-menu-background); height: 100%; position: fixed; top: 0; @@ -727,14 +727,14 @@ transform: rotate(180deg); .personabar .personabarLogo { width: 80px; height: 103px; - background: url('../images/Logo.svg') no-repeat center center; + background: var(--dnn-pb-menu-brand-background); -ms-background-size: 32px auto; background-size: 32px auto; position: relative; - border-bottom: 1px solid #1e485e; + border-bottom: 1px solid var(--dnn-color-pb-menu-divider); } .personabar .personabarLogo:hover { - background-color: #0b1c24; + background-color: var(--dnn-color-pb-menu-background-hover); } .personabar .personabarLogo a.update { text-decoration: none; @@ -799,10 +799,10 @@ transform: rotate(180deg); fill: #868484; } .personabarnav > li > span.icon-loader svg .back { - fill: #0b1c24; + fill: var(--dnn-color-pb-menu-icon-background); } .personabarnav>li>span.icon-loader svg .main { - fill: #3c7a9a; + fill: var(--dnn-color-pb-menu-icon); } .personabarnav > li:hover > span.icon-loader svg, .personabarnav > li.active > span.icon-loader svg, @@ -822,7 +822,7 @@ transform: rotate(180deg); } .personabarnav > li:hover,.personabarnav > li.active { color: #fff; - background-color: #0b1c24; + background-color: var(--dnn-color-pb-menu-background-hover); border-right: none !important; } .personabarnav > li.pending { @@ -830,7 +830,7 @@ transform: rotate(180deg); } .personabarnav > li#Edit { - border-top: 1px solid #1e485e; + border-top: 1px solid var(--dnn-color-pb-menu-divider); } .personabarnav > li#Edit.selected { @@ -1251,10 +1251,6 @@ only screen and (min-width: 768px) and (max-width: 1024px) { margin-top: 103px; } -.ie .socialpanelbody { - /*margin-top: 0;*/ -} - .socialpanelbody > div { padding: 20px 30px 30px 30px; } @@ -1912,7 +1908,7 @@ div.ui-dialog-titlebar > .ui-dialog-titlebar-close:hover { .hoverSummaryMenu { position: absolute; width: 200px; - background-color: #0b1c24; + background-color: var(--dnn-color-pb-menu-background-hover); padding: 27px 37px 42px 37px; left: 80px; top: 0; @@ -1959,9 +1955,9 @@ div.ui-dialog-titlebar > .ui-dialog-titlebar-close:hover { } .hoverSummaryMenu ul li label { font-size: 12px; - color: #3c7a9a; + color: var(--dnn-color-pb-menu-text-highlight); padding: 11px 0 18px 0; - border-bottom: 1px solid #1e485e; + border-bottom: 1px solid var(--dnn-color-pb-menu-divider); text-transform: uppercase; -moz-word-break: break-all; -o-word-break: break-all; diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css new file mode 100644 index 00000000000..6b3fb835322 --- /dev/null +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css @@ -0,0 +1,10 @@ +:root{ + --dnn-color-pb-menu-background: #0e2936; + --dnn-color-pb-menu-background-hover: #0b1c24; + --dnn-color-pb-menu-icon: #3c7a9a; + --dnn-color-pb-menu-icon-background: #0b1c24; + --dnn-color-pb-menu-divider: #1e485e; + --dnn-color-pb-menu-text-highlight: #3c7a9a; + + --dnn-pb-menu-brand-background: url('../images/Logo.svg') no-repeat center center; +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js index c857ec1e3b0..b69e7e8c6c0 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js @@ -21,15 +21,13 @@ var personaBarSettings = window.parent['personaBarSettings']; var debugMode = personaBarSettings['debugMode'] === true; var cdv = personaBarSettings['buildNumber']; - var skin = personaBarSettings['skin']; var version = (cdv ? '?cdv=' + cdv : '') + (debugMode ? '&t=' + Math.random(): ''); var styles = []; var mainJs = 'scripts/main.js'; + var themeCss = 'css/theme.css'; var mainCss = 'css/main.css'; - if (skin) { - mainCss = 'css/' + skin + '.css'; - } + styles.push(themeCss); styles.push(mainCss); styles.push('css/graph.css'); From bf3ad8df76d961315d21758b22427517eeef3da4 Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Sun, 30 May 2021 02:38:28 -0400 Subject: [PATCH 4/8] Resolve missing CSS variable usage in PersonaBar --- .../Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css | 2 +- .../admin/personaBar/css/personaBarContainer.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css index 4bc84f4c643..dd78ff01b3f 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/main.css @@ -921,7 +921,7 @@ transform: rotate(180deg); position: absolute; left: 80px; padding: 0 0px 42px 37px; - background-color: #0b1c24; + background-color: var(--dnn-color-pb-menu-background-hover); display: none; /* display: none; IE not apply list-style-type: none; with this active it will be applied in js diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/personaBarContainer.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/personaBarContainer.css index 32583327aa7..94c5ef48490 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/personaBarContainer.css +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/personaBarContainer.css @@ -28,7 +28,7 @@ iframe#personaBar-iframe{ .personabar-placeholder { width: 80px; - background-color: #3d3c3c; + background-color: #0e2936; height: 100%; position: fixed; top: 0; From 3780e7763bfde02bf345b6bc9e73841f37a37784 Mon Sep 17 00:00:00 2001 From: Daniel Valadas Date: Sun, 30 May 2021 03:33:44 -0400 Subject: [PATCH 5/8] Don't enforce changing core files in order to theme PB --- .../EditBar/Dnn.EditBar.UI/editBar/css/theme.css | 3 --- .../EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js | 2 -- .../Containers/PersonaBarContainer.cs | 7 ++++++- .../Dnn.PersonaBar.UI/admin/personaBar/css/theme.css | 2 ++ .../admin/personaBar/scripts/bootstrap.js | 9 ++++++++- 5 files changed, 16 insertions(+), 7 deletions(-) delete mode 100644 Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css deleted file mode 100644 index 16b0982ae98..00000000000 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css +++ /dev/null @@ -1,3 +0,0 @@ -:root{ - --dnn-color-editbar-background: #0b1c24; -} \ No newline at end of file diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js index 5d6829011c0..8ee69cceeb7 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js @@ -26,10 +26,8 @@ var version = (cdv ? '?cdv=' + cdv : '') + (debugMode ? '&t=' + Math.random(): ''); var styles = []; var mainJs = mobi ? 'scripts/main.mobi.js' : 'scripts/main.js'; - var themeCss = 'css/theme.css'; var mainCss = mobi ? 'css/main.mobi.css' : 'css/main.css'; - styles.push(themeCss); styles.push(mainCss); addCssToHead(styles, version); diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs index 8af46ea7709..9f0a8554223 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs @@ -6,8 +6,10 @@ namespace Dnn.PersonaBar.Library.Containers { using System.Collections.Generic; using System.Globalization; + using System.IO; using System.Threading; using System.Web; + using System.Web.Hosting; using System.Web.UI; using Dnn.PersonaBar.Library.Common; @@ -18,7 +20,6 @@ namespace Dnn.PersonaBar.Library.Containers using DotNetNuke.Application; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; - using DotNetNuke.Entities.Users; using DotNetNuke.Services.Personalization; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json.Linq; @@ -120,6 +121,10 @@ private IDictionary GetConfigration(PortalSettings portalSetting settings.Add("disableEditBar", Host.DisableEditBar); + var customThemePath = HostingEnvironment.MapPath(Path.Combine("Portals", "_default", "PersonaBarTheme.css")); + var customThemeExists = File.Exists(customThemePath); + settings.Add("theme", customThemeExists); + return settings; } } diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css index 6b3fb835322..eaa5c96b555 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css @@ -7,4 +7,6 @@ --dnn-color-pb-menu-text-highlight: #3c7a9a; --dnn-pb-menu-brand-background: url('../images/Logo.svg') no-repeat center center; + + --dnn-color-editbar-background: #0b1c24; } \ No newline at end of file diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js index b69e7e8c6c0..a6daca46c30 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js @@ -26,8 +26,15 @@ var mainJs = 'scripts/main.js'; var themeCss = 'css/theme.css'; var mainCss = 'css/main.css'; + var hasCustomTheme = editBarSettings['theme']; + + if (hasCustomTheme){ + styles.push('../../../../Portals/_default/PersonaBarTheme.css'); + } + else{ + styles.push(themeCss); + } - styles.push(themeCss); styles.push(mainCss); styles.push('css/graph.css'); From 28021f2fca51b58e873bd4454acab5811e682dd3 Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Sun, 30 May 2021 04:56:43 -0400 Subject: [PATCH 6/8] Correct MapPath for PersonaBarTheme and update project to included default theme.css --- .../Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs | 2 +- .../Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs index 9f0a8554223..3ff2c4bb53f 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs @@ -121,7 +121,7 @@ private IDictionary GetConfigration(PortalSettings portalSetting settings.Add("disableEditBar", Host.DisableEditBar); - var customThemePath = HostingEnvironment.MapPath(Path.Combine("Portals", "_default", "PersonaBarTheme.css")); + var customThemePath = HostingEnvironment.MapPath("~/Portals/_default/PersonaBarTheme.css"); var customThemeExists = File.Exists(customThemePath); settings.Add("theme", customThemeExists); diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj index ce53846bacd..6a53dbddb3c 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj @@ -140,6 +140,7 @@ Designer + Designer From f79128744f43308923fb85dcbea269b171ec39b4 Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Sun, 30 May 2021 21:19:43 -0400 Subject: [PATCH 7/8] Refactor to support PersonaBar & EditBar theming Since `PersonaBar` and `EditBar` are in two separate IFRAMEs, code needed to be refactored to support separate custom CSS files. Also, the purpose of this is to support custom `PersonaBar` and `EditBar` themes without having to modify core files. Custom theme files should be named appropriately (needs documentation) and placed in `/Portals/_default`. --- .../Controllers/EditBarController.cs | 13 +++++++++---- .../EditBar/Dnn.EditBar.UI/Dnn.EditBar.UI.csproj | 1 + .../EditBar/Dnn.EditBar.UI/editBar/css/theme.css | 3 +++ .../Dnn.EditBar.UI/editBar/scripts/bootstrap.js | 14 ++++++++++++-- .../Containers/PersonaBarContainer.cs | 6 +++--- .../admin/personaBar/css/theme.css | 2 -- .../admin/personaBar/scripts/bootstrap.js | 4 ++-- 7 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Controllers/EditBarController.cs b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Controllers/EditBarController.cs index a3bfb717b42..89a47a96915 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Controllers/EditBarController.cs +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Controllers/EditBarController.cs @@ -6,13 +6,14 @@ namespace Dnn.EditBar.UI.Controllers { using System; using System.Collections.Generic; - using System.Globalization; + using System.Globalization; + using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; - using System.Web; - + using System.Web; + using System.Web.Hosting; using Dnn.EditBar.Library; using Dnn.EditBar.Library.Items; using DotNetNuke.Application; @@ -46,7 +47,11 @@ public IDictionary GetConfigurations(int portalId) settings.Add("portalId", portalSettings.PortalId); settings.Add("culture", portalSettings.CultureCode); settings.Add("loginUrl", Globals.LoginURL(HttpContext.Current?.Request.RawUrl, false)); - settings.Add("items", this.GetMenuItems()); + settings.Add("items", this.GetMenuItems()); + + var customEditBarThemePath = HostingEnvironment.MapPath("~/Portals/_default/EditBarTheme.css"); + var customEditBarThemeExists = File.Exists(customEditBarThemePath); + settings.Add("editBarTheme", customEditBarThemeExists); return settings; } diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Dnn.EditBar.UI.csproj b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Dnn.EditBar.UI.csproj index dbddb349528..f6dc7184bef 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Dnn.EditBar.UI.csproj +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Dnn.EditBar.UI.csproj @@ -119,6 +119,7 @@ + diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css new file mode 100644 index 00000000000..7e788b7e4b7 --- /dev/null +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css @@ -0,0 +1,3 @@ +:root{ + --dnn-color-editbar-background: #0b1c24; +} \ No newline at end of file diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js index 8ee69cceeb7..dc1abda6687 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/scripts/bootstrap.js @@ -21,13 +21,23 @@ body.appendChild(script); }; - var debugMode = window.parent['editBarSettings']['debugMode'] === true; - var cdv = window.parent['editBarSettings']['buildNumber']; + var editBarSettings = window.parent['editBarSettings']; + var debugMode = editBarSettings['debugMode'] === true; + var cdv = editBarSettings['buildNumber']; var version = (cdv ? '?cdv=' + cdv : '') + (debugMode ? '&t=' + Math.random(): ''); var styles = []; var mainJs = mobi ? 'scripts/main.mobi.js' : 'scripts/main.js'; + var themeCss = 'css/theme.css'; var mainCss = mobi ? 'css/main.mobi.css' : 'css/main.css'; + var hasCustomEditBarTheme = editBarSettings['editBarTheme']; + if (hasCustomEditBarTheme){ + styles.push('../../../../Portals/_default/EditBarTheme.css'); + } + else{ + styles.push(themeCss); + } + styles.push(mainCss); addCssToHead(styles, version); diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs index 3ff2c4bb53f..05977671b4f 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs @@ -121,9 +121,9 @@ private IDictionary GetConfigration(PortalSettings portalSetting settings.Add("disableEditBar", Host.DisableEditBar); - var customThemePath = HostingEnvironment.MapPath("~/Portals/_default/PersonaBarTheme.css"); - var customThemeExists = File.Exists(customThemePath); - settings.Add("theme", customThemeExists); + var customPersonaBarThemePath = HostingEnvironment.MapPath("~/Portals/_default/PersonaBarTheme.css"); + var customPersonaBarThemeExists = File.Exists(customPersonaBarThemePath); + settings.Add("personaBarTheme", customPersonaBarThemeExists); return settings; } diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css index eaa5c96b555..6b3fb835322 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css @@ -7,6 +7,4 @@ --dnn-color-pb-menu-text-highlight: #3c7a9a; --dnn-pb-menu-brand-background: url('../images/Logo.svg') no-repeat center center; - - --dnn-color-editbar-background: #0b1c24; } \ No newline at end of file diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js index a6daca46c30..73bfc669bf7 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/scripts/bootstrap.js @@ -26,9 +26,9 @@ var mainJs = 'scripts/main.js'; var themeCss = 'css/theme.css'; var mainCss = 'css/main.css'; - var hasCustomTheme = editBarSettings['theme']; - if (hasCustomTheme){ + var hasCustomPersonaBarTheme = personaBarSettings['personaBarTheme']; + if (hasCustomPersonaBarTheme){ styles.push('../../../../Portals/_default/PersonaBarTheme.css'); } else{ From af0d0285edd36ff08c1eea1ebe74c36b407de2da Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Sun, 30 May 2021 21:56:58 -0400 Subject: [PATCH 8/8] Add in context documentation to show in devtools --- .../EditBar/Dnn.EditBar.UI/editBar/css/theme.css | 6 ++++++ .../Dnn.PersonaBar.UI/admin/personaBar/css/theme.css | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css index 7e788b7e4b7..3a98896d45b 100644 --- a/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css +++ b/Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/editBar/css/theme.css @@ -1,3 +1,9 @@ +/*-------------------------------------------------------------------------------- +These default CSS variables can be overridden and customized by creating a file, +containing a copy of the below, called "EditBarTheme.css" and placing it in the +"Portals/_default" directory. If the custom CSS file exists, it will be loaded +instead of this one. +---------------------------------------------------------------------------------*/ :root{ --dnn-color-editbar-background: #0b1c24; } \ No newline at end of file diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css index 6b3fb835322..08266cee1db 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.UI/admin/personaBar/css/theme.css @@ -1,3 +1,9 @@ +/*-------------------------------------------------------------------------------- +These default CSS variables can be overridden and customized by creating a file, +containing a copy of the below, called "PersonaBarTheme.css" and placing it in +the "Portals/_default" directory. If the custom CSS file exists, it will be loaded +instead of this one. +---------------------------------------------------------------------------------*/ :root{ --dnn-color-pb-menu-background: #0e2936; --dnn-color-pb-menu-background-hover: #0b1c24;