From aba652ec565ab00b56a23da7c25e3a0f1423ef09 Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Thu, 16 Jul 2020 15:21:14 +0200 Subject: [PATCH] Portal settings sidebar refinements no refs. - refined typography, colors and layout - using built in admin icons for portal button icon temporarily - styled icons for future usage with inline svgs --- .../modal-members-modal-settings.hbs | 36 ++-- .../modal-members-modal-settings.js | 13 +- ghost/admin/app/styles/layouts/members.css | 114 ----------- .../app/styles/layouts/portal-settings.css | 183 ++++++++++++++++-- 4 files changed, 189 insertions(+), 157 deletions(-) diff --git a/ghost/admin/app/components/modal-members-modal-settings.hbs b/ghost/admin/app/components/modal-members-modal-settings.hbs index bc71e775ed..8336414109 100644 --- a/ghost/admin/app/components/modal-members-modal-settings.hbs +++ b/ghost/admin/app/components/modal-members-modal-settings.hbs @@ -4,7 +4,7 @@

Portal settings

-

Singup

+

Singup options

@@ -150,7 +150,7 @@ {{#if this.settings.portalButton}}
- +

Portal button style

{{#if showIconSetting}} - +

Icon

-
-
+
+
{{#each this.defaultButtonIcons as |imgIcon| }} - icon + {{svg-jar imgIcon}} {{/each}} {{#if uploader.isUploading}} {{uploader.progressBar}} @@ -201,17 +196,9 @@ > {{/if}}
-
-
{{/if}}
- + {{#if showButtonTextSetting}} +

Signup button text

@@ -238,8 +226,8 @@ @input={{action "setSignupButtonText"}} />
-

Visible to logged out members only

+ {{/if}} {{/if}}
diff --git a/ghost/admin/app/components/modal-members-modal-settings.js b/ghost/admin/app/components/modal-members-modal-settings.js index 6e40578563..bb600b9361 100644 --- a/ghost/admin/app/components/modal-members-modal-settings.js +++ b/ghost/admin/app/components/modal-members-modal-settings.js @@ -75,6 +75,11 @@ export default ModalComponent.extend({ return selectedButtonStyle.includes('icon'); }), + showButtonTextSetting: computed('selectedButtonStyle', function () { + const selectedButtonStyle = this.get('selectedButtonStyle.name') || ''; + return selectedButtonStyle.includes('text'); + }), + isFreeChecked: computed('settings.portalPlans.[]', 'allowSelfSignup', function () { const allowedPlans = this.settings.get('portalPlans') || []; return (this.allowSelfSignup && allowedPlans.includes('free')); @@ -104,9 +109,11 @@ export default ModalComponent.extend({ {name: 'text-only', label: 'Text only'} ]; this.defaultButtonIcons = [ - 'https://raw.githubusercontent.com/leungwensen/svg-icon/master/dist/trimmed-svg/metro/user.svg', - 'https://raw.githubusercontent.com/leungwensen/svg-icon/master/dist/svg/icomoon/user-tie.svg', - 'https://raw.githubusercontent.com/leungwensen/svg-icon/master/dist/trimmed-svg/evil/user.svg' + 'user-circle', + 'ambulance', + 'book-open', + 'store', + 'gift' ]; this.iconExtensions = ICON_EXTENSIONS; const portalButtonIcon = this.settings.get('portalButtonIcon') || ''; diff --git a/ghost/admin/app/styles/layouts/members.css b/ghost/admin/app/styles/layouts/members.css index 1e2d60dd90..203ed6392c 100644 --- a/ghost/admin/app/styles/layouts/members.css +++ b/ghost/admin/app/styles/layouts/members.css @@ -721,118 +721,4 @@ p.gh-members-import-errordetail:first-of-type { .gh-import-member-select select { padding: 4px; } -} - -/* Portal settings -/* ----------------------------------------- */ -.gh-portal-settings-sidebar { - padding: 28px; -} - -.gh-portal-settings-form { - min-width: 290px; -} - -.gh-portal-setting-title { - font-size: 1.3rem; - font-weight: 600; - margin: 0; -} - -.gh-portal-settings .for-switch.small { - width: 36px !important; - height: 22px !important; -} - -.gh-portal-setting-sectionheading { - font-size: 1.2rem; - font-weight: 500; - color: var(--midgrey-l2); - margin: 0 0 12px; - text-transform: uppercase; - letter-spacing: 0.2px; -} - -.gh-portal-setting-section { - margin: 12px -28px; - padding: 0 28px; -} - -.gh-portal-setting-section.divider-top { - border-top: 1px solid var(--whitegrey); - padding-top: 16px; -} - -.gh-portal-settings .input-color input { - height: 30px; - width: 102px; - padding: 3px 4px 3px 44px; - font-size: 1.3rem; -} - -.gh-portal-settings .input-color .color-box { - height: 28px; - width: 28px; -} - -.gh-portal-settings .input-color::after { - top: 5px; - left: 34px; -} - -.gh-portal-settings .input-color input:focus + .color-box { - height: 26px; - width: 28px; -} - -.gh-portal-settings .gh-select select, -.gh-portal-settings .gh-input { - padding: 3px 10px 3px 8px; - height: 36px; - font-size: 1.4rem; -} - -.gh-portal-settings .gh-select select option { - height: unset; -} - -.gh-portal-settings .gh-select svg { - top: 19px; - right: 9px; -} - -.gh-portal-settings-main { - display: flex; - flex-direction: column; - flex-grow: 1; - padding: 28px; - border-left: 1px solid var(--whitegrey); -} - -.gh-portal-settings .modal-footer { - margin-top: 28px; -} - -.gh-portal-settings-maintabs { - list-style: none; - list-style-type: none; - display: flex; - align-items: center; - padding: 0; - margin: 4px 0 16px; -} - -.gh-portal-settings-maintabs li { - padding: 0; - margin: 0; -} - -.gh-portal-settings-maintabs li a { - display: inline-block; - padding: 4px 12px; - margin: -4px 0; -} - -.gh-portal-settings-maintabs li:first-of-type a { - margin-left: -12px; } \ No newline at end of file diff --git a/ghost/admin/app/styles/layouts/portal-settings.css b/ghost/admin/app/styles/layouts/portal-settings.css index e4b09c9c5d..9f8071214b 100644 --- a/ghost/admin/app/styles/layouts/portal-settings.css +++ b/ghost/admin/app/styles/layouts/portal-settings.css @@ -53,24 +53,175 @@ flex-direction: column; } -.gh-portal-button-icon { - cursor: pointer; - height: 44px; - padding: 5px 5px; - width: 44px; - margin-right: 3px; -} - -.gh-portal-button-icon:hover { - border: 1px solid skyblue; -} - -.gh-portal-button-icon.selected-icon { - border: 1px solid lightblue; -} - .gh-show-modal-link-form .gh-input { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +} + +.gh-portal-settings-sidebar { + padding: 28px; +} + +.gh-portal-settings-form { + min-width: 290px; +} + +.gh-portal-settings .form-group.space-l { + margin-bottom: 1.9em; +} + +.gh-portal-setting-title { + font-size: 1.3rem; + font-weight: 600; + margin: 0; +} + +.gh-portal-settings .for-switch.small { + width: 36px !important; + height: 22px !important; +} + +.gh-portal-setting-sectionheading { + font-size: 1.2rem; + font-weight: 500; + color: var(--midlightgrey); + margin: 0 0 12px; + text-transform: uppercase; + letter-spacing: 0.2px; +} + +.gh-portal-setting-section { + margin: 12px -28px; + padding: 0 28px; +} + +.gh-portal-setting-section.divider-top { + border-top: 1px solid var(--whitegrey); + padding-top: 16px; +} + +.gh-portal-settings .input-color input { + height: 30px; + width: 102px; + padding: 3px 4px 3px 44px; + font-size: 1.3rem; +} + +.gh-portal-settings .input-color .color-box { + height: 28px; + width: 28px; +} + +.gh-portal-settings .input-color::after { + top: 5px; + left: 34px; +} + +.gh-portal-settings .input-color input:focus + .color-box { + height: 26px; + width: 28px; +} + +.gh-portal-settings .gh-select svg { + top: 19px; + right: 9px; +} + +.gh-portal-settings-main { + display: flex; + flex-direction: column; + flex-grow: 1; + padding: 28px; + border-left: 1px solid var(--whitegrey); +} + +.gh-portal-settings .modal-footer { + margin-top: 28px; +} + +.gh-portal-settings-maintabs { + list-style: none; + list-style-type: none; + display: flex; + align-items: center; + padding: 0; + margin: 4px 0 16px; +} + +.gh-portal-settings-maintabs li { + padding: 0; + margin: 0; +} + +.gh-portal-settings-maintabs li a { + display: inline-block; + padding: 4px 12px; + margin: -4px 0; +} + +.gh-portal-settings-maintabs li:first-of-type a { + margin-left: -12px; +} + +.gh-portal-settings-icons { + display: flex; + flex-grow: 1; + align-items: center; + justify-content: flex-start; + border-right: 1px solid var(--lightgrey); + padding: 2px; +} + +.gh-portal-button-icon { + display: inline-block; + cursor: pointer; + width: 41px; + height: 41px; + padding: 10px; + background-repeat: no-repeat; + background-size: 22px 22px; + background-position: center; + border-radius: 2px; + margin: 2px 3px 2px; +} + +.gh-portal-button-icon:hover { + box-shadow: 0px 0px 0px 1px color-mod(var(--blue) a(40%)); +} + +.gh-portal-button-icon.selected-icon { + box-shadow: 0px 0px 0px 2px var(--blue); +} + +.gh-portal-button-icon svg { + fill: var(--midlightgrey-d1); +} + +.gh-portal-button-icon.selected-icon svg { + fill: var(--blue); +} + +.gh-portal-button-uploadicon, +.gh-portal-button-uploadicon:hover, +.gh-portal-button-uploadicon:focus { + height: 44px; + width: 46px; + border: none; + box-shadow: none; +} + +.gh-portal-button-uploadicon span { + display: flex; + align-items: center; + justify-content: center; +} + +.gh-portal-button-uploadicon span svg { + width: 18px; + height: 18px; +} + +.gh-portal-button-uploadicon:hover span svg { + fill: var(--darkgrey); } \ No newline at end of file