소스 검색

possibility of adding a custom legal notice page url

Emile NDAGIJIMANA 3 년 전
부모
커밋
8662fd59fb

+ 5 - 0
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

+ 9 - 0
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();
   },

+ 5 - 0
client/components/main/layouts.styl

@@ -545,3 +545,8 @@ a
 
 #isSettingDatabaseCallDone
   display: none;
+
+.at-link
+  color: #17683a;
+  text-decoration: underline;
+  text-decoration-color: #17683a;

+ 4 - 0
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

+ 6 - 0
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) {

+ 4 - 1
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"
 }

+ 5 - 2
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."
-}
+    "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"
+}

+ 4 - 0
models/settings.js

@@ -92,6 +92,10 @@ Settings.attachSchema(
       type: String,
       optional: true,
     },
+    legalNotice: {
+      type: String,
+      optional: true,
+    },
     createdAt: {
       type: Date,
       denyUpdate: true,

+ 1 - 0
server/publications/settings.js

@@ -26,6 +26,7 @@ Meteor.publish('setting', () => {
         spinnerName: 1,
         oidcBtnText: 1,
         mailDomainName: 1,
+        legalNotice: 1,
       },
     },
   );