Explorar o código

[point #3830] Display default weekan logo if there isn't a custom one

Emile NDAGIJIMANA %!s(int64=3) %!d(string=hai) anos
pai
achega
5a5a01cf17

+ 1 - 1
client/components/main/layouts.jade

@@ -34,7 +34,7 @@ template(name="userFormsLayout")
           img(src="{{currentSetting.customLoginLogoImageUrl}}" width="300" height="auto")
           img(src="{{currentSetting.customLoginLogoImageUrl}}" width="300" height="auto")
           br
           br
       unless currentSetting.customLoginLogoImageUrl
       unless currentSetting.customLoginLogoImageUrl
-        if isSettingDatabaseFctCallDone
+        div#isSettingDatabaseCallDone
           img(src="{{pathFor '/wekan-logo.svg'}}" alt="" width="300" height="auto")
           img(src="{{pathFor '/wekan-logo.svg'}}" alt="" width="300" height="auto")
           br
           br
       if currentSetting.textBelowCustomLoginLogo
       if currentSetting.textBelowCustomLoginLogo

+ 9 - 5
client/components/main/layouts.js

@@ -23,7 +23,7 @@ const validator = {
   },
   },
 };
 };
 
 
-let isSettingDatabaseFctCallDone = false;
+// let isSettingDatabaseFctCallDone = false;
 
 
 Template.userFormsLayout.onCreated(function() {
 Template.userFormsLayout.onCreated(function() {
   const templateInstance = this;
   const templateInstance = this;
@@ -40,7 +40,11 @@ Template.userFormsLayout.onCreated(function() {
         oidcBtnElt.html(htmlvalue);
         oidcBtnElt.html(htmlvalue);
       }
       }
 
 
-      isSettingDatabaseFctCallDone = true;
+      // isSettingDatabaseFctCallDone = true;
+      if(currSetting && currSetting !== undefined && currSetting.customLoginLogoImageUrl !== undefined)
+        document.getElementById("isSettingDatabaseCallDone").style.display = 'none';
+      else
+        document.getElementById("isSettingDatabaseCallDone").style.display = 'block';
       return this.stop();
       return this.stop();
     },
     },
   });
   });
@@ -69,9 +73,9 @@ Template.userFormsLayout.helpers({
     return Template.instance().currentSetting.get();
     return Template.instance().currentSetting.get();
   },
   },
 
 
-  isSettingDatabaseCallDone(){
-    return isSettingDatabaseFctCallDone;
-  },
+  // isSettingDatabaseCallDone(){
+  //   return isSettingDatabaseFctCallDone;
+  // },
 
 
   isLoading() {
   isLoading() {
     return Template.instance().isLoading.get();
     return Template.instance().isLoading.get();

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

@@ -542,3 +542,6 @@ a
 
 
   100%
   100%
     transform: rotate(360deg)
     transform: rotate(360deg)
+
+#isSettingDatabaseCallDone
+  display: none;