Difference between revisions of "Customlogin"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "'''1. Create files:<br>        1.1. Stylesheet:'''<br>        - Create stylesheet file: default.css {| cl...")
 
Line 1: Line 1:
'''1. Create files:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.1. Stylesheet:'''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Create stylesheet file: default.css
+
<span style="font-size: 18pt;" >'''Create catglobe custom login layout'''</span>
{| class="wikitable" style="border-collapse: collapse; width: 50%;"  
+
'''<br>1. Create files:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.1. Stylesheet:'''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Create stylesheet file: default.css
|-
+
{| class="wikitable" style="border-collapse: collapse; width: 50%;"
| style="width: 100%;" |  
+
|-  
 
+
| style="width: 100%;" |
 
:#loginBackground::before {<br>&nbsp;background: #595959;<br>}<br>#loginBackground form {<br>&nbsp;max-width: 400px;<br>&nbsp;margin: 0 auto;<br>&nbsp;box-sizing: border-box;<br>}
 
:#loginBackground::before {<br>&nbsp;background: #595959;<br>}<br>#loginBackground form {<br>&nbsp;max-width: 400px;<br>&nbsp;margin: 0 auto;<br>&nbsp;box-sizing: border-box;<br>}
 
 
:#loginBackground .wrapper-logo {<br>&nbsp;width: 100%;<br>}
 
:#loginBackground .wrapper-logo {<br>&nbsp;width: 100%;<br>}
 
 
:#loginBackground #loginLogo {<br>&nbsp;height: 50px;<br>&nbsp;width: auto;<br>&nbsp;margin: 0;<br>}
 
:#loginBackground #loginLogo {<br>&nbsp;height: 50px;<br>&nbsp;width: auto;<br>&nbsp;margin: 0;<br>}
 
 
:#loginBackground .version {<br>&nbsp;margin-top: 0;<br>&nbsp;margin-bottom: 10px;<br>&nbsp;color: #fff !important;<br>}
 
:#loginBackground .version {<br>&nbsp;margin-top: 0;<br>&nbsp;margin-bottom: 10px;<br>&nbsp;color: #fff !important;<br>}
 
 
:#loginBackground input {<br>&nbsp;box-sizing: border-box;<br>&nbsp;width: 100%;<br>&nbsp;min-width: 300px;<br>&nbsp;background: #fff;<br>&nbsp;border-color: rgb(var(--cg));<br>&nbsp;border-radius: 10px;<br>&nbsp;padding: 10px 15px;<br>&nbsp;height: unset;<br>&nbsp;margin-bottom: 10px;<br>&nbsp;color: #000;<br>}
 
:#loginBackground input {<br>&nbsp;box-sizing: border-box;<br>&nbsp;width: 100%;<br>&nbsp;min-width: 300px;<br>&nbsp;background: #fff;<br>&nbsp;border-color: rgb(var(--cg));<br>&nbsp;border-radius: 10px;<br>&nbsp;padding: 10px 15px;<br>&nbsp;height: unset;<br>&nbsp;margin-bottom: 10px;<br>&nbsp;color: #000;<br>}
 
 
:#loginBackground .login-submit {<br>&nbsp;width: 100% !important;<br>&nbsp;justify-content: space-between !important;<br>}
 
:#loginBackground .login-submit {<br>&nbsp;width: 100% !important;<br>&nbsp;justify-content: space-between !important;<br>}
 
 
:&nbsp;#loginBackground .login-submit a {<br>&nbsp; color: #fff !important;<br>&nbsp;}
 
:&nbsp;#loginBackground .login-submit a {<br>&nbsp; color: #fff !important;<br>&nbsp;}
 
 
:&nbsp;#loginBackground .login-submit button {<br>&nbsp; border-radius: 5px;<br>&nbsp; height: unset;<br>&nbsp; padding: 10px 30px;<br>&nbsp; font-size: 14px;<br>&nbsp;}
 
:&nbsp;#loginBackground .login-submit button {<br>&nbsp; border-radius: 5px;<br>&nbsp; height: unset;<br>&nbsp; padding: 10px 30px;<br>&nbsp; font-size: 14px;<br>&nbsp;}
 
 
:#loginBackground .bottom-logo {<br>&nbsp;margin-top: 50px;<br>}
 
:#loginBackground .bottom-logo {<br>&nbsp;margin-top: 50px;<br>}
 
 
:#loginBackground .vox-logo {<br>&nbsp;background: url('./Voxmeter-logo.png') no-repeat;<br>&nbsp;height: 28px;<br>&nbsp;width: 100px;<br>&nbsp;background-size: 100px 28px;<br>&nbsp;margin: auto;<br>}
 
:#loginBackground .vox-logo {<br>&nbsp;background: url('./Voxmeter-logo.png') no-repeat;<br>&nbsp;height: 28px;<br>&nbsp;width: 100px;<br>&nbsp;background-size: 100px 28px;<br>&nbsp;margin: auto;<br>}
 
 
:#loginBackground .cem-logo {<br>&nbsp;background: url('./CEM-intelligence-logo.png') no-repeat;<br>&nbsp;height: 26px;<br>&nbsp;width: 150px;<br>&nbsp;background-size: 150px 28px;<br>&nbsp;margin: auto;<br>}
 
:#loginBackground .cem-logo {<br>&nbsp;background: url('./CEM-intelligence-logo.png') no-repeat;<br>&nbsp;height: 26px;<br>&nbsp;width: 150px;<br>&nbsp;background-size: 150px 28px;<br>&nbsp;margin: auto;<br>}
 
|}
 
|}
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''&nbsp;&nbsp; 1.2. Javascript:'''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Create javascript file: default.js
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''&nbsp;&nbsp; 1.2. Javascript:'''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Create javascript file: default.js
{| class="wikitable" style="border-collapse: collapse; width: 100%;"  
+
{| class="wikitable" style="border-collapse: collapse; width: 100%;"
|-
+
|-  
| style="width: 100%;" |  
+
| style="width: 100%;" |
 
 
 
:document.addEventListener('DOMContentLoaded', function () {<br>&nbsp;let userLang = navigator.language || navigator.userLanguage;&nbsp;<br>&nbsp;let form = document.getElementById('loginBackground').getElementsByTagName('form')[0];<br>&nbsp;let submit = document.querySelector('[type="submit"]');<br>&nbsp;submit.parentElement.className += 'login-submit';<br>&nbsp;let logo = document.querySelector('#loginLogo');<br>&nbsp;let wrapperLogo = document.createElement('div');<br>&nbsp;wrapperLogo.classList.add('wrapper-logo');<br>&nbsp;logo.parentNode.insertBefore(wrapperLogo, logo);<br>&nbsp;wrapperLogo.appendChild(logo);<br>&nbsp;let version = document.createElement('p');<br>&nbsp;let versionText;<br>&nbsp;if(userLang === 'da-DK'){<br>&nbsp; &nbsp; versionText = document.createTextNode('Velcome to version 10.0');<br>&nbsp;} else {<br>&nbsp; &nbsp; versionText = document.createTextNode('Welcome to version 10.0');<br>&nbsp;}<br>&nbsp;version.classList.add('version');<br>&nbsp;version.appendChild(versionText);<br>&nbsp;wrapperLogo.appendChild(version);<br>&nbsp;let vox = document.createElement('div');<br>&nbsp;vox.classList.add('bottom-logo');<br>&nbsp;vox.innerHTML = `&lt;div class="vox-logo"&gt;&lt;/div&gt;&lt;div class="cem-logo"&gt;&lt;/div&gt;`;<br>&nbsp;form.appendChild(vox);
 
:document.addEventListener('DOMContentLoaded', function () {<br>&nbsp;let userLang = navigator.language || navigator.userLanguage;&nbsp;<br>&nbsp;let form = document.getElementById('loginBackground').getElementsByTagName('form')[0];<br>&nbsp;let submit = document.querySelector('[type="submit"]');<br>&nbsp;submit.parentElement.className += 'login-submit';<br>&nbsp;let logo = document.querySelector('#loginLogo');<br>&nbsp;let wrapperLogo = document.createElement('div');<br>&nbsp;wrapperLogo.classList.add('wrapper-logo');<br>&nbsp;logo.parentNode.insertBefore(wrapperLogo, logo);<br>&nbsp;wrapperLogo.appendChild(logo);<br>&nbsp;let version = document.createElement('p');<br>&nbsp;let versionText;<br>&nbsp;if(userLang === 'da-DK'){<br>&nbsp; &nbsp; versionText = document.createTextNode('Velcome to version 10.0');<br>&nbsp;} else {<br>&nbsp; &nbsp; versionText = document.createTextNode('Welcome to version 10.0');<br>&nbsp;}<br>&nbsp;version.classList.add('version');<br>&nbsp;version.appendChild(versionText);<br>&nbsp;wrapperLogo.appendChild(version);<br>&nbsp;let vox = document.createElement('div');<br>&nbsp;vox.classList.add('bottom-logo');<br>&nbsp;vox.innerHTML = `&lt;div class="vox-logo"&gt;&lt;/div&gt;&lt;div class="cem-logo"&gt;&lt;/div&gt;`;<br>&nbsp;form.appendChild(vox);
 
 
:}, false);<br>
 
:}, false);<br>
 
|}
 
|}
Line 38: Line 26:
  
 
'''2. Config:'''<br>- Add config to catglobe.json on server.
 
'''2. Config:'''<br>- Add config to catglobe.json on server.
{| class="wikitable" style="border-collapse: collapse; width: 100%;"  
+
{| class="wikitable" style="border-collapse: collapse; width: 100%;"
|-
+
|-  
 
| style="width: 100%; margin-left: 100px;" | &nbsp;&nbsp;&nbsp;&nbsp; "loginPageCustomization": [<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "name": "",<br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "urlToExtraCss": "https://voxmeter.dk/custom-login/default.css",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "urlToExtraJs": "https://voxmeter.dk/custom-login/default.js"<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "name": "/cembank",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; "urlToExtraCss": "https://localhost/test/cembank.css",<br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "urlToExtraJs": "https://localhost/test/cembank.js"<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp; &nbsp; ]
 
| style="width: 100%; margin-left: 100px;" | &nbsp;&nbsp;&nbsp;&nbsp; "loginPageCustomization": [<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "name": "",<br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "urlToExtraCss": "https://voxmeter.dk/custom-login/default.css",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "urlToExtraJs": "https://voxmeter.dk/custom-login/default.js"<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; "name": "/cembank",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; "urlToExtraCss": "https://localhost/test/cembank.css",<br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "urlToExtraJs": "https://localhost/test/cembank.js"<br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp; &nbsp; ]
 
|}
 
|}

Revision as of 08:20, 12 January 2023

Create catglobe custom login layout
1. Create files:
        1.1. Stylesheet:

        - Create stylesheet file: default.css

  1. loginBackground::before {
     background: #595959;
    }
    #loginBackground form {
     max-width: 400px;
     margin: 0 auto;
     box-sizing: border-box;
    }
  2. loginBackground .wrapper-logo {
     width: 100%;
    }
  3. loginBackground #loginLogo {
     height: 50px;
     width: auto;
     margin: 0;
    }
  4. loginBackground .version {
     margin-top: 0;
     margin-bottom: 10px;
     color: #fff !important;
    }
  5. loginBackground input {
     box-sizing: border-box;
     width: 100%;
     min-width: 300px;
     background: #fff;
     border-color: rgb(var(--cg));
     border-radius: 10px;
     padding: 10px 15px;
     height: unset;
     margin-bottom: 10px;
     color: #000;
    }
  6. loginBackground .login-submit {
     width: 100% !important;
     justify-content: space-between !important;
    }
 #loginBackground .login-submit a {
  color: #fff !important;
 }
 #loginBackground .login-submit button {
  border-radius: 5px;
  height: unset;
  padding: 10px 30px;
  font-size: 14px;
 }
  1. loginBackground .bottom-logo {
     margin-top: 50px;
    }
  2. loginBackground .vox-logo {
     background: url('./Voxmeter-logo.png') no-repeat;
     height: 28px;
     width: 100px;
     background-size: 100px 28px;
     margin: auto;
    }
  3. loginBackground .cem-logo {
     background: url('./CEM-intelligence-logo.png') no-repeat;
     height: 26px;
     width: 150px;
     background-size: 150px 28px;
     margin: auto;
    }

        1.2. Javascript:
        - Create javascript file: default.js

document.addEventListener('DOMContentLoaded', function () {
 let userLang = navigator.language || navigator.userLanguage; 
 let form = document.getElementById('loginBackground').getElementsByTagName('form')[0];
 let submit = document.querySelector('[type="submit"]');
 submit.parentElement.className += 'login-submit';
 let logo = document.querySelector('#loginLogo');
 let wrapperLogo = document.createElement('div');
 wrapperLogo.classList.add('wrapper-logo');
 logo.parentNode.insertBefore(wrapperLogo, logo);
 wrapperLogo.appendChild(logo);
 let version = document.createElement('p');
 let versionText;
 if(userLang === 'da-DK'){
    versionText = document.createTextNode('Velcome to version 10.0');
 } else {
    versionText = document.createTextNode('Welcome to version 10.0');
 }
 version.classList.add('version');
 version.appendChild(versionText);
 wrapperLogo.appendChild(version);
 let vox = document.createElement('div');
 vox.classList.add('bottom-logo');
 vox.innerHTML = `<div class="vox-logo"></div><div class="cem-logo"></div>`;
 form.appendChild(vox);
}, false);

       1.3. Upload: stylesheet and javascript files to location where You can get public link.

2. Config:
- Add config to catglobe.json on server.

     "loginPageCustomization": [
          {
             "name": "",
             "urlToExtraCss": "https://voxmeter.dk/custom-login/default.css",
             "urlToExtraJs": "https://voxmeter.dk/custom-login/default.js"
         },
         {
             "name": "/cembank",
             "urlToExtraCss": "https://localhost/test/cembank.css",
             "urlToExtraJs": "https://localhost/test/cembank.js"
         }
    ]