mirror of
https://github.com/wekan/wekan.git
synced 2026-01-27 03:36:09 +01:00
Remove pwix:blaze-layout
This commit is contained in:
parent
9ebf4d2426
commit
0635a663f0
38 changed files with 771 additions and 432 deletions
|
|
@ -1,10 +1,11 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
|
||||
Meteor.subscribe('user-admin');
|
||||
Meteor.subscribe('boards');
|
||||
Meteor.subscribe('setting');
|
||||
Meteor.subscribe('announcements');
|
||||
Template.header.onCreated(function(){
|
||||
Template.header.onCreated(function () {
|
||||
const templateInstance = this;
|
||||
templateInstance.currentSetting = new ReactiveVar();
|
||||
templateInstance.isLoading = new ReactiveVar(false);
|
||||
|
|
@ -13,10 +14,21 @@ Template.header.onCreated(function(){
|
|||
onReady() {
|
||||
templateInstance.currentSetting.set(ReactiveCache.getCurrentSetting());
|
||||
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';
|
||||
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();
|
||||
},
|
||||
});
|
||||
|
|
@ -74,10 +86,15 @@ Template.header.events({
|
|||
},
|
||||
|
||||
'keypress .js-zoom-input'(evt) {
|
||||
if (evt.which === 13) { // Enter key
|
||||
if (evt.which === 13) {
|
||||
// Enter key
|
||||
const newZoomPercent = parseInt(evt.target.value);
|
||||
|
||||
if (!isNaN(newZoomPercent) && newZoomPercent >= 50 && newZoomPercent <= 300) {
|
||||
if (
|
||||
!isNaN(newZoomPercent) &&
|
||||
newZoomPercent >= 50 &&
|
||||
newZoomPercent <= 300
|
||||
) {
|
||||
const newZoom = newZoomPercent / 100;
|
||||
Utils.setZoomLevel(newZoom);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
BlazeLayout.setRoot('body');
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
|
||||
let alreadyCheck = 1;
|
||||
let isCheckDone = false;
|
||||
|
|
@ -47,7 +46,7 @@ Template.userFormsLayout.onCreated(function () {
|
|||
|
||||
Template.userFormsLayout.onRendered(() => {
|
||||
Meteor.call('getAuthenticationsEnabled', (_, result) => {
|
||||
let enabledAuthenticationMethods = [ 'password' ]; // we show/hide this based on isPasswordLoginEnabled
|
||||
let enabledAuthenticationMethods = ['password']; // we show/hide this based on isPasswordLoginEnabled
|
||||
|
||||
if (result) {
|
||||
Object.keys(result).forEach((m) => {
|
||||
|
|
@ -88,16 +87,26 @@ Template.userFormsLayout.onRendered(() => {
|
|||
EscapeActions.executeAll();
|
||||
|
||||
// Add autocomplete attribute to login input for WCAG compliance
|
||||
const loginInput = document.querySelector('input[type="text"], input[type="email"]');
|
||||
if (loginInput && loginInput.name && (loginInput.name.toLowerCase().includes('user') || loginInput.name.toLowerCase().includes('email'))) {
|
||||
const loginInput = document.querySelector(
|
||||
'input[type="text"], input[type="email"]',
|
||||
);
|
||||
if (
|
||||
loginInput &&
|
||||
loginInput.name &&
|
||||
(loginInput.name.toLowerCase().includes('user') ||
|
||||
loginInput.name.toLowerCase().includes('email'))
|
||||
) {
|
||||
loginInput.setAttribute('autocomplete', 'username email');
|
||||
}
|
||||
|
||||
// Add autocomplete attributes to password fields for WCAG compliance
|
||||
const passwordInputs = document.querySelectorAll('input[type="password"]');
|
||||
passwordInputs.forEach(input => {
|
||||
passwordInputs.forEach((input) => {
|
||||
if (input.name && input.name.includes('password')) {
|
||||
if (input.name.includes('password_again') || input.name.includes('new_password')) {
|
||||
if (
|
||||
input.name.includes('password_again') ||
|
||||
input.name.includes('new_password')
|
||||
) {
|
||||
input.setAttribute('autocomplete', 'new-password');
|
||||
} else {
|
||||
input.setAttribute('autocomplete', 'current-password');
|
||||
|
|
@ -111,18 +120,18 @@ Template.userFormsLayout.helpers({
|
|||
isLegalNoticeLinkExist() {
|
||||
const currSet = Template.instance().currentSetting.get();
|
||||
if (currSet && currSet !== undefined && currSet != null) {
|
||||
return currSet.legalNotice !== undefined && currSet.legalNotice.trim() != "";
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return (
|
||||
currSet.legalNotice !== undefined && currSet.legalNotice.trim() != ''
|
||||
);
|
||||
} else return false;
|
||||
},
|
||||
|
||||
getLegalNoticeWithWritTraduction() {
|
||||
let spanLegalNoticeElt = $("#legalNoticeSpan");
|
||||
let spanLegalNoticeElt = $('#legalNoticeSpan');
|
||||
if (spanLegalNoticeElt != null && spanLegalNoticeElt != undefined) {
|
||||
spanLegalNoticeElt.html(TAPi18n.__('acceptance_of_our_legalNotice', {}));
|
||||
}
|
||||
let atLinkLegalNoticeElt = $("#legalNoticeAtLink");
|
||||
let atLinkLegalNoticeElt = $('#legalNoticeAtLink');
|
||||
if (atLinkLegalNoticeElt != null && atLinkLegalNoticeElt != undefined) {
|
||||
atLinkLegalNoticeElt.html(TAPi18n.__('legalNotice', {}));
|
||||
}
|
||||
|
|
@ -180,43 +189,52 @@ Template.userFormsLayout.events({
|
|||
'DOMSubtreeModified #at-oidc'(event) {
|
||||
if (alreadyCheck <= 2) {
|
||||
let currSetting = ReactiveCache.getCurrentSetting();
|
||||
let oidcBtnElt = $("#at-oidc");
|
||||
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
||||
let oidcBtnElt = $('#at-oidc');
|
||||
if (
|
||||
currSetting &&
|
||||
currSetting !== undefined &&
|
||||
currSetting.oidcBtnText !== undefined &&
|
||||
oidcBtnElt != null &&
|
||||
oidcBtnElt != undefined
|
||||
) {
|
||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||
if (alreadyCheck == 1) {
|
||||
alreadyCheck++;
|
||||
oidcBtnElt.html("");
|
||||
}
|
||||
else {
|
||||
oidcBtnElt.html('');
|
||||
} else {
|
||||
alreadyCheck++;
|
||||
oidcBtnElt.html(htmlvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
alreadyCheck = 1;
|
||||
}
|
||||
},
|
||||
'DOMSubtreeModified .at-form'(event) {
|
||||
if (alreadyCheck <= 2 && !isCheckDone) {
|
||||
if (document.getElementById("at-oidc") != null) {
|
||||
if (document.getElementById('at-oidc') != null) {
|
||||
let currSetting = ReactiveCache.getCurrentSetting();
|
||||
let oidcBtnElt = $("#at-oidc");
|
||||
if (currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined) {
|
||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||
let oidcBtnElt = $('#at-oidc');
|
||||
if (
|
||||
currSetting &&
|
||||
currSetting !== undefined &&
|
||||
currSetting.oidcBtnText !== undefined &&
|
||||
oidcBtnElt != null &&
|
||||
oidcBtnElt != undefined
|
||||
) {
|
||||
let htmlvalue =
|
||||
"<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||
if (alreadyCheck == 1) {
|
||||
alreadyCheck++;
|
||||
oidcBtnElt.html("");
|
||||
}
|
||||
else {
|
||||
oidcBtnElt.html('');
|
||||
} else {
|
||||
alreadyCheck++;
|
||||
isCheckDone = true;
|
||||
oidcBtnElt.html(htmlvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
alreadyCheck = 1;
|
||||
}
|
||||
},
|
||||
|
|
@ -247,14 +265,14 @@ async function authentication(event, templateInstance) {
|
|||
|
||||
switch (result) {
|
||||
case 'ldap':
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
Meteor.loginWithLDAP(match, password, function () {
|
||||
resolve(FlowRouter.go('/'));
|
||||
});
|
||||
});
|
||||
|
||||
case 'saml':
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
const provider = Meteor.settings.public.SAML_PROVIDER;
|
||||
Meteor.loginWithSaml(
|
||||
{
|
||||
|
|
@ -267,7 +285,7 @@ async function authentication(event, templateInstance) {
|
|||
});
|
||||
|
||||
case 'cas':
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
Meteor.loginWithCas(match, password, function () {
|
||||
resolve(FlowRouter.go('/'));
|
||||
});
|
||||
|
|
@ -279,9 +297,15 @@ async function authentication(event, templateInstance) {
|
|||
}
|
||||
|
||||
function getAuthenticationMethod(
|
||||
{ displayAuthenticationMethod, defaultAuthenticationMethod },
|
||||
settings,
|
||||
match,
|
||||
) {
|
||||
if (!settings) {
|
||||
return getUserAuthenticationMethod(undefined, match);
|
||||
}
|
||||
|
||||
const { displayAuthenticationMethod, defaultAuthenticationMethod } = settings;
|
||||
|
||||
if (displayAuthenticationMethod) {
|
||||
return $('.select-authentication').val();
|
||||
}
|
||||
|
|
@ -289,7 +313,7 @@ function getAuthenticationMethod(
|
|||
}
|
||||
|
||||
function getUserAuthenticationMethod(defaultAuthenticationMethod, match) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
try {
|
||||
Meteor.subscribe('user-authenticationMethod', match, {
|
||||
onReady() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue