From 4cfddf1d8d37bdbbb58c050333ee6ea2afc3e6f9 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 2 Nov 2020 17:53:01 +0200 Subject: [PATCH] Admin Panel / Settings / Layout / Custom Top Left Corner Logo Height. Thanks to xet7 ! --- client/components/main/header.jade | 4 ++-- client/components/settings/settingBody.jade | 4 ++++ client/components/settings/settingBody.js | 6 ++++++ i18n/en.i18n.json | 1 + models/settings.js | 4 ++++ server/publications/settings.js | 1 + 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/client/components/main/header.jade b/client/components/main/header.jade index fd888bd1b..7d065b56d 100644 --- a/client/components/main/header.jade +++ b/client/components/main/header.jade @@ -27,9 +27,9 @@ template(name="header") if currentSetting.customTopLeftCornerLogoImageUrl if currentSetting.customTopLeftCornerLogoLinkUrl a(href="{{currentSetting.customTopLeftCornerLogoLinkUrl}}") - img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="27" width="auto" margin="0" padding="0") + img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0") unless currentSetting.customTopLeftCornerLogoLinkUrl - img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="27" width="auto" margin="0" padding="0") + img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0") unless currentSetting.customTopLeftCornerLogoImageUrl img(src="{{pathFor '/logo-header.png'}}" alt="") ul diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade index 2acf6cb5d..dc5387ac6 100644 --- a/client/components/settings/settingBody.jade +++ b/client/components/settings/settingBody.jade @@ -204,6 +204,10 @@ template(name='layoutSettings') .title {{_ 'custom-top-left-corner-logo-link-url'}} .form-group input.wekan-form-control#custom-top-left-corner-logo-link-url(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoLinkUrl}}") + li.layout-form + .title {{_ 'custom-top-left-corner-logo-height'}} + .form-group + input.wekan-form-control#custom-top-left-corner-logo-height(type="text", placeholder="" value="{{currentSetting.customTopLeftCornerLogoHeight}}") li button.js-save-layout.primary {{_ 'save'}} diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 692240ef4..4708f70f7 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -186,6 +186,11 @@ BlazeComponent.extendComponent({ ) .val() .trim(); + const customTopLeftCornerLogoHeight = $( + '#custom-top-left-corner-logo-height', + ) + .val() + .trim(); const hideLogoChange = $('input[name=hideLogo]:checked').val() === 'true'; const displayAuthenticationMethod = $('input[name=displayAuthenticationMethod]:checked').val() === 'true'; @@ -201,6 +206,7 @@ BlazeComponent.extendComponent({ textBelowCustomLoginLogo, customTopLeftCornerLogoImageUrl, customTopLeftCornerLogoLinkUrl, + customTopLeftCornerLogoHeight, displayAuthenticationMethod, defaultAuthenticationMethod, }, diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index 1ff43152a..f669215fd 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -516,6 +516,7 @@ "uploaded-avatar": "Uploaded an avatar", "custom-top-left-corner-logo-image-url": "Custom Top Left Corner Logo Image URL", "custom-top-left-corner-logo-link-url": "Custom Top Left Corner Logo Link URL", + "custom-top-left-corner-logo-height": "Custom Top Left Corner Logo Height. Default: 27", "custom-login-logo-image-url": "Custom Login Logo Image URL", "custom-login-logo-link-url": "Custom Login Logo Link URL", "text-below-custom-login-logo": "Text below Custom Login Logo", diff --git a/models/settings.js b/models/settings.js index d4d38d8c2..b73cb24b4 100644 --- a/models/settings.js +++ b/models/settings.js @@ -65,6 +65,10 @@ Settings.attachSchema( type: String, optional: true, }, + customTopLeftCornerLogoHeight: { + type: String, + optional: true, + }, createdAt: { type: Date, denyUpdate: true, diff --git a/server/publications/settings.js b/server/publications/settings.js index 71fa335c4..d2a003592 100644 --- a/server/publications/settings.js +++ b/server/publications/settings.js @@ -17,6 +17,7 @@ Meteor.publish('setting', () => { textBelowCustomLoginLogo: 1, customTopLeftCornerLogoImageUrl: 1, customTopLeftCornerLogoLinkUrl: 1, + customTopLeftCornerLogoHeight: 1, customHTMLafterBodyStart: 1, customHTMLbeforeBodyEnd: 1, displayAuthenticationMethod: 1,