diff --git a/client/components/main/header.jade b/client/components/main/header.jade index 08afdb6c1..b75f8fcd5 100644 --- a/client/components/main/header.jade +++ b/client/components/main/header.jade @@ -38,7 +38,8 @@ template(name="header") unless currentSetting.customTopLeftCornerLogoLinkUrl img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0" alt="{{currentSetting.productName}}" title="{{currentSetting.productName}}") unless currentSetting.customTopLeftCornerLogoImageUrl - img(src="{{pathFor '/logo-header.png'}}" alt="{{currentSetting.productName}}" title="{{currentSetting.productName}}") + div#headerIsSettingDatabaseCallDone + img(src="{{pathFor '/logo-header.png'}}" alt="{{currentSetting.productName}}" title="{{currentSetting.productName}}") span.allBoards a(href="{{pathFor 'home'}}") span.fa.fa-home diff --git a/client/components/main/header.js b/client/components/main/header.js index 848f9f2cc..7e3f0166d 100644 --- a/client/components/main/header.js +++ b/client/components/main/header.js @@ -1,7 +1,23 @@ Meteor.subscribe('user-admin'); Meteor.subscribe('boards'); Meteor.subscribe('setting'); +Template.header.onCreated(function(){ + const templateInstance = this; + templateInstance.currentSetting = new ReactiveVar(); + templateInstance.isLoading = new ReactiveVar(false); + Meteor.subscribe('setting', { + onReady() { + templateInstance.currentSetting.set(Settings.findOne()); + let currSetting = templateInstance.currentSetting.curValue; + if(currSetting && currSetting !== undefined && currSetting.customLoginLogoImageUrl !== undefined && document.getElementById("headerIsSettingDatabaseCallDone") != null) + document.getElementById("headerIsSettingDatabaseCallDone").style.display = 'none'; + else if(document.getElementById("headerIsSettingDatabaseCallDone") != null) + document.getElementById("headerIsSettingDatabaseCallDone").style.display = 'block'; + return this.stop(); + }, + }); +}); Template.header.helpers({ wrappedHeader() { return !Session.get('currentBoard'); diff --git a/client/components/main/header.styl b/client/components/main/header.styl index daf9a7ba6..eaca2d765 100644 --- a/client/components/main/header.styl +++ b/client/components/main/header.styl @@ -250,3 +250,6 @@ p margin: 7px padding: 0 + +#headerIsSettingDatabaseCallDone + display: none; diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade index bcaf0c026..197e64645 100644 --- a/client/components/main/layouts.jade +++ b/client/components/main/layouts.jade @@ -48,6 +48,11 @@ template(name="userFormsLayout") +Template.dynamic(template=content) if currentSetting.displayAuthenticationMethod +connectionMethod(authenticationMethod=currentSetting.defaultAuthenticationMethod) + if isLegalNoticeLinkExist + div#legalNoticeDiv + span {{_ 'acceptance_of_our_legalNotice'}} + a.at-link(href="{{currentSetting.legalNotice}}", target="_blank", rel="noopener noreferrer") + | {{_ 'legalNotice'}} div.at-form-lang select.select-lang.js-userform-set-language each languages diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js index e1361fa43..2ed92989c 100644 --- a/client/components/main/layouts.js +++ b/client/components/main/layouts.js @@ -77,6 +77,15 @@ Template.userFormsLayout.helpers({ // return isSettingDatabaseFctCallDone; // }, + isLegalNoticeLinkExist(){ + const currSet = Template.instance().currentSetting.get(); + if(currSet && currSet !== undefined && currSet != null){ + return currSet.legalNotice !== undefined && currSet.legalNotice.trim() != ""; + } + else + return false; + }, + isLoading() { return Template.instance().isLoading.get(); }, diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl index 735f48704..b265ff9c1 100644 --- a/client/components/main/layouts.styl +++ b/client/components/main/layouts.styl @@ -545,3 +545,8 @@ a #isSettingDatabaseCallDone display: none; + +.at-link + color: #17683a; + text-decoration: underline; + text-decoration-color: #17683a; diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade index 5fc5e5e8b..775891eea 100644 --- a/client/components/settings/settingBody.jade +++ b/client/components/settings/settingBody.jade @@ -188,6 +188,10 @@ template(name='layoutSettings') .title {{_ 'can-invite-if-same-mailDomainName'}} .form-group input.wekan-form-control#mailDomainNamevalue(type="text", placeholder="" value="{{currentSetting.mailDomainName}}") + li.layout-form + .title {{_ 'custom-legal-notice-link-url'}} + .form-group + input.wekan-form-control#legalNoticevalue(type="text", placeholder="" value="{{currentSetting.legalNotice}}") li.layout-form .title {{_ 'display-authentication-method'}} .form-group.flex diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index c74d93d65..71a286fdb 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -210,6 +210,11 @@ BlazeComponent.extendComponent({ ) .val() .trim(); + const legalNotice = $( + '#legalNoticevalue', + ) + .val() + .trim(); const hideLogoChange = $('input[name=hideLogo]:checked').val() === 'true'; const displayAuthenticationMethod = $('input[name=displayAuthenticationMethod]:checked').val() === 'true'; @@ -234,6 +239,7 @@ BlazeComponent.extendComponent({ spinnerName, oidcBtnText, mailDomainName, + legalNotice, }, }); } catch (e) { diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index 3b8ed77a4..8e6170397 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -1119,5 +1119,8 @@ "add-organizations": "Add organizations", "add-organizations-label": "Added organizations are displayed below:", "remove-organization-from-board": "Are you sure you want to remove this organization from this board ?", - "to-create-organizations-contact-admin": "To create organizations, please contact administrator." + "to-create-organizations-contact-admin": "To create organizations, please contact administrator.", + "custom-legal-notice-link-url": "Custom legal notice page URL", + "acceptance_of_our_legalNotice": "By continuing, you accept our", + "legalNotice": "legal notice" } diff --git a/i18n/fr.i18n.json b/i18n/fr.i18n.json index 41f289e22..2d0ef357e 100644 --- a/i18n/fr.i18n.json +++ b/i18n/fr.i18n.json @@ -1118,5 +1118,8 @@ "add-organizations": "Ajouter des organisations", "add-organizations-label": "Les organisations ajoutées sont affichées ci-dessous :", "remove-organization-from-board": "Voulez-vous vraiment supprimer cette organisation de ce tableau ?", - "to-create-organizations-contact-admin": "Pour créer des organisations, veuillez contacter l'administrateur." -} \ No newline at end of file + "to-create-organizations-contact-admin": "Pour créer des organisations, veuillez contacter l'administrateur.", + "custom-legal-notice-link-url": "URL de la page des mentions légales personnalisées", + "acceptance_of_our_legalNotice": "En continuant, vous acceptez nos", + "legalNotice": "mentions légales" +} diff --git a/models/settings.js b/models/settings.js index db401f48d..0fbf448e4 100644 --- a/models/settings.js +++ b/models/settings.js @@ -92,6 +92,10 @@ Settings.attachSchema( type: String, optional: true, }, + legalNotice: { + type: String, + optional: true, + }, createdAt: { type: Date, denyUpdate: true, diff --git a/server/publications/settings.js b/server/publications/settings.js index e54b56ddb..f7ee33f32 100644 --- a/server/publications/settings.js +++ b/server/publications/settings.js @@ -26,6 +26,7 @@ Meteor.publish('setting', () => { spinnerName: 1, oidcBtnText: 1, mailDomainName: 1, + legalNotice: 1, }, }, );