From d610d03423241071e41aeb8cb62adf1fce33847d Mon Sep 17 00:00:00 2001 From: helioguardabaxo Date: Mon, 12 Sep 2022 21:36:31 -0300 Subject: [PATCH] Added help button with custom URL. --- client/components/main/header.css | 6 ++++-- client/components/main/header.jade | 5 +++++ client/components/settings/settingBody.jade | 4 ++++ client/components/settings/settingBody.js | 4 ++++ imports/i18n/data/en.i18n.json | 2 ++ models/settings.js | 4 ++++ server/publications/settings.js | 1 + 7 files changed, 24 insertions(+), 2 deletions(-) diff --git a/client/components/main/header.css b/client/components/main/header.css index 712b94a6c..0aacc4d65 100644 --- a/client/components/main/header.css +++ b/client/components/main/header.css @@ -178,13 +178,15 @@ top: -5px; margin-right: 5px; } -#header-quick-access #header-user-bar .header-user-bar-avatar .member { +#header-quick-access #header-user-bar .header-user-bar-avatar .member, +#header-quick-access #header-help { width: 24px; height: 24px; margin: 0; margin-top: 1px; } -#header-quick-access #header-user-bar .header-user-bar-name { +#header-quick-access #header-user-bar .header-user-bar-name, +#header-quick-access #header-help { margin: 4px 8px 0 0; float: left; } diff --git a/client/components/main/header.jade b/client/components/main/header.jade index 85cb64ef4..51409d044 100644 --- a/client/components/main/header.jade +++ b/client/components/main/header.jade @@ -67,6 +67,11 @@ template(name="header") +notifications + if currentSetting.customHelpLinkUrl + #header-help + a(href="{{currentSetting.customHelpLinkUrl}}", title="{{_ 'help'}}", target="_blank", rel="noopener noreferrer") + span.fa.fa-question + +headerUserBar #header(class=currentBoard.colorClass) diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade index b4d0a2369..dc864fed7 100644 --- a/client/components/settings/settingBody.jade +++ b/client/components/settings/settingBody.jade @@ -229,6 +229,10 @@ template(name='layoutSettings') .title {{_ 'custom-login-logo-link-url'}} .form-group input.wekan-form-control#custom-login-logo-link-url(type="text", placeholder="" value="{{currentSetting.customLoginLogoLinkUrl}}") + li.layout-form + .title {{_ 'custom-help-link-url'}} + .form-group + input.wekan-form-control#custom-help-link-url(type="text", placeholder="" value="{{currentSetting.customHelpLinkUrl}}") li.layout-form .title {{_ 'text-below-custom-login-logo'}} .form-group diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index db6c62b81..04afdce0c 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -189,6 +189,9 @@ BlazeComponent.extendComponent({ const customLoginLogoLinkUrl = $('#custom-login-logo-link-url') .val() .trim(); + const customHelpLinkUrl = $('#custom-help-link-url') + .val() + .trim(); const textBelowCustomLoginLogo = $('#text-below-custom-login-logo') .val() .trim(); @@ -240,6 +243,7 @@ BlazeComponent.extendComponent({ hideLogo: hideLogoChange, customLoginLogoImageUrl, customLoginLogoLinkUrl, + customHelpLinkUrl, textBelowCustomLoginLogo, customTopLeftCornerLogoImageUrl, customTopLeftCornerLogoLinkUrl, diff --git a/imports/i18n/data/en.i18n.json b/imports/i18n/data/en.i18n.json index ea1cc4897..305f47457 100644 --- a/imports/i18n/data/en.i18n.json +++ b/imports/i18n/data/en.i18n.json @@ -597,6 +597,7 @@ "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", + "custom-help-link-url": "Custom Help Link URL", "text-below-custom-login-logo": "Text below Custom Login Logo", "automatic-linked-url-schemes": "Custom URL Schemes which should automatically be clickable. One URL Scheme per line", "username": "Username", @@ -904,6 +905,7 @@ "editUserPopup-title": "Edit User", "newUserPopup-title": "New User", "notifications": "Notifications", + "help": "Help", "view-all": "View All", "filter-by-unread": "Filter by Unread", "mark-all-as-read": "Mark all as read", diff --git a/models/settings.js b/models/settings.js index 69e41e642..eba6d57d5 100644 --- a/models/settings.js +++ b/models/settings.js @@ -72,6 +72,10 @@ Settings.attachSchema( type: String, optional: true, }, + customHelpLinkUrl: { + type: String, + optional: true, + }, textBelowCustomLoginLogo: { type: String, optional: true, diff --git a/server/publications/settings.js b/server/publications/settings.js index 24f805d92..6f903b735 100644 --- a/server/publications/settings.js +++ b/server/publications/settings.js @@ -15,6 +15,7 @@ Meteor.publish('setting', () => { hideLogo: 1, customLoginLogoImageUrl: 1, customLoginLogoLinkUrl: 1, + customHelpLinkUrl: 1, textBelowCustomLoginLogo: 1, automaticLinkedUrlSchemes: 1, customTopLeftCornerLogoImageUrl: 1,