From 8465fc0e443e7d8e2b48bb113644cebdfa5f8231 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Wed, 9 Oct 2024 20:08:03 +0100 Subject: [PATCH 01/10] Added password warning to Form creation modal #1455 --- customize.dist/src/less2/include/creation.less | 5 +++++ www/common/common-ui-elements.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index cd04cf858..5ff730a64 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -165,6 +165,7 @@ //margin: 10px 0; min-height: 28px; line-height: 28px; + flex-flow: column; label { flex: 1; // Force wrap when the other element in the line is 100% (IE bug): @@ -178,6 +179,10 @@ } } } + + .cp-creation-password-warning { + background-color:@creation-bg-color-light; + } .cp-creation-help, .cp-creation-warning { font-size: 16px; color: @cp_creation-fg; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index ae0dea302..b54cc0f14 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2770,7 +2770,8 @@ define([ ]); // Password - var password = h('div.cp-creation-password', [ + var text = h('div.cp-creation-password-warning', 'Note that for Forms, you can only set the password during creation. This password cannot be changed later.'); + var password = h('div.cp-creation-password', [text, UI.createCheckbox('cp-creation-password', Messages.properties_addPassword, false), h('span.cp-creation-password-picker.cp-creation-slider', [ UI.passwordInput({id: 'cp-creation-password-val'}) From c7be93af3d3acd625e201e0cc1835cbc08f3931a Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Sat, 19 Oct 2024 11:16:53 +0200 Subject: [PATCH 02/10] Changed styling of warning --- customize.dist/src/less2/include/creation.less | 5 ++++- www/common/common-ui-elements.js | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index 5ff730a64..65b7b6e62 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -181,8 +181,11 @@ } .cp-creation-password-warning { - background-color:@creation-bg-color-light; + margin-top: 0.4rem; + font-size: 12px !important; + line-height: normal !important } + .cp-creation-help, .cp-creation-warning { font-size: 16px; color: @cp_creation-fg; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index b54cc0f14..4882efbe1 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -25,6 +25,9 @@ define([ 'css!/customize/fonts/cptools/style.css', ], function ($, Config, Broadcast, Util, Hash, Language, UI, Constants, Feedback, h, Clipboard, Messages, AppConfig, Pages, NThen, InviteInner, Visible, PadTypes) { + + Messages.form_passwordWarning = 'For Forms, you can only set the password during creation. It cannot be changed later.' //XX + var UIElements = {}; var urlArgs = Config.requireConf.urlArgs; @@ -2770,8 +2773,11 @@ define([ ]); // Password - var text = h('div.cp-creation-password-warning', 'Note that for Forms, you can only set the password during creation. This password cannot be changed later.'); - var password = h('div.cp-creation-password', [text, + let text; + if (type === 'form') { + text = h('div.cp-creation-password-warning.alert.alert-warning.dismissable', h('span.cp-inline-alert-text', Messages.form_passwordWarning)); + } + var password = h('div.cp-creation-password', [ UI.createCheckbox('cp-creation-password', Messages.properties_addPassword, false), h('span.cp-creation-password-picker.cp-creation-slider', [ UI.passwordInput({id: 'cp-creation-password-val'}) @@ -2779,6 +2785,7 @@ define([ type: "text" // TODO type password with click to show }),*/ ]), + text, //createHelper('#', "TODO: password protection adds another layer of security ........") // TODO ]); From 54efbe1f82fc175bd4d8812516da0311fd75e5f9 Mon Sep 17 00:00:00 2001 From: David Benque Date: Mon, 21 Oct 2024 11:59:59 +0100 Subject: [PATCH 03/10] Fix LESS nesting --- customize.dist/src/less2/include/creation.less | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index 65b7b6e62..5955b6725 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -180,12 +180,6 @@ } } - .cp-creation-password-warning { - margin-top: 0.4rem; - font-size: 12px !important; - line-height: normal !important - } - .cp-creation-help, .cp-creation-warning { font-size: 16px; color: @cp_creation-fg; @@ -300,6 +294,11 @@ } } } + .cp-creation-password-warning { + margin-top: 0.4rem; + font-size: 0.75em; + line-height: 100%; + } } .cp-creation-settings { button { From 3f2d8566e16bfcb827c8b6ed7b017139e520087c Mon Sep 17 00:00:00 2001 From: David Benque Date: Mon, 21 Oct 2024 15:07:43 +0100 Subject: [PATCH 04/10] Add temporary translation key --- customize.dist/messages.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/customize.dist/messages.js b/customize.dist/messages.js index a5784b495..4c640c17d 100755 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -136,6 +136,8 @@ define(req, function(AppConfig, Default, Language) { } }; + Messages.form_passwordWarning = 'Please note that a Form password can only be set now at creation time and cannot be changed later.' // XXX + return Messages; }); From 36be1e7fc914be4b57eea19ba5bfdbdf27f254ed Mon Sep 17 00:00:00 2001 From: David Benque Date: Mon, 21 Oct 2024 15:08:33 +0100 Subject: [PATCH 05/10] Adjust alert - changed type from warning to info - increased line-height to 120% --- customize.dist/src/less2/include/creation.less | 2 +- www/common/common-ui-elements.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index 5955b6725..c9bb17a7c 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -297,7 +297,7 @@ .cp-creation-password-warning { margin-top: 0.4rem; font-size: 0.75em; - line-height: 100%; + line-height: 120%; } } .cp-creation-settings { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 4882efbe1..3433f297d 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -26,8 +26,6 @@ define([ ], function ($, Config, Broadcast, Util, Hash, Language, UI, Constants, Feedback, h, Clipboard, Messages, AppConfig, Pages, NThen, InviteInner, Visible, PadTypes) { - Messages.form_passwordWarning = 'For Forms, you can only set the password during creation. It cannot be changed later.' //XX - var UIElements = {}; var urlArgs = Config.requireConf.urlArgs; @@ -2775,7 +2773,7 @@ define([ // Password let text; if (type === 'form') { - text = h('div.cp-creation-password-warning.alert.alert-warning.dismissable', h('span.cp-inline-alert-text', Messages.form_passwordWarning)); + text = h('div.cp-creation-password-warning.alert.alert-info.dismissable', h('span.cp-inline-alert-text', Messages.form_passwordWarning)); } var password = h('div.cp-creation-password', [ UI.createCheckbox('cp-creation-password', Messages.properties_addPassword, false), From 0b677cf01ec863bd957c6403d310783e8ca9bc15 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Mon, 21 Oct 2024 16:01:22 +0200 Subject: [PATCH 06/10] Moved .form_passwordWarning key to customize.dist/messages.js --- customize.dist/messages.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/customize.dist/messages.js b/customize.dist/messages.js index 4c640c17d..e3f0c30de 100755 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -135,6 +135,8 @@ define(req, function(AppConfig, Default, Language) { return text; } }; + + Messages.form_passwordWarning = 'For Forms, you can only set the password during creation. It cannot be changed later.' // XXX Messages.form_passwordWarning = 'Please note that a Form password can only be set now at creation time and cannot be changed later.' // XXX From 8daae414533e1e3c25b533a0d918466a8f0cfdf2 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Thu, 5 Dec 2024 14:04:47 +0100 Subject: [PATCH 07/10] Removed redundant newlines --- customize.dist/src/less2/include/creation.less | 1 - www/common/common-ui-elements.js | 1 - 2 files changed, 2 deletions(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index c9bb17a7c..a25640398 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -179,7 +179,6 @@ } } } - .cp-creation-help, .cp-creation-warning { font-size: 16px; color: @cp_creation-fg; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 3433f297d..c2dc088fc 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -25,7 +25,6 @@ define([ 'css!/customize/fonts/cptools/style.css', ], function ($, Config, Broadcast, Util, Hash, Language, UI, Constants, Feedback, h, Clipboard, Messages, AppConfig, Pages, NThen, InviteInner, Visible, PadTypes) { - var UIElements = {}; var urlArgs = Config.requireConf.urlArgs; From a86fe963933d1dd3bc145e04b03a15958b6d7fd0 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Fri, 6 Dec 2024 19:17:25 +0100 Subject: [PATCH 08/10] Removed flex-flow style --- customize.dist/src/less2/include/creation.less | 1 - 1 file changed, 1 deletion(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index a25640398..d200558af 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -165,7 +165,6 @@ //margin: 10px 0; min-height: 28px; line-height: 28px; - flex-flow: column; label { flex: 1; // Force wrap when the other element in the line is 100% (IE bug): From c10bf97e756a608962b38a7d62372f8c06d88543 Mon Sep 17 00:00:00 2001 From: zuzanna-maria Date: Mon, 9 Dec 2024 18:17:55 +0100 Subject: [PATCH 09/10] .cp-creation-form>div styling --- customize.dist/src/less2/include/creation.less | 1 - 1 file changed, 1 deletion(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index d200558af..5dbce1046 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -160,7 +160,6 @@ max-width: 100%; display: flex; align-items: center; - flex-wrap: wrap; font-size: 16px; //margin: 10px 0; min-height: 28px; From ef3ff95bab820f37b62b0c4cf2af71b789b8429a Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 10 Dec 2024 17:21:13 +0100 Subject: [PATCH 10/10] Fix margin issues in form creation screen --- .../src/less2/include/creation.less | 19 +++++++++---------- www/common/common-ui-elements.js | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index 5dbce1046..f61f20d90 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -69,7 +69,7 @@ outline: none; width: 700px; max-width: 90vw; - height: 500px; + //height: 500px; border-radius: @variables_radius_L; max-height: ~"calc(100vh - 20px)"; margin: 0px; @@ -85,6 +85,7 @@ } .cp-creation-checkboxes { + min-width: 300px; flex-flow: column; align-items: baseline !important; max-height: 150px; @@ -156,7 +157,7 @@ flex: 1 0 auto; justify-content: space-around; & > div { - width: 300px; + //width: 300px; max-width: 100%; display: flex; align-items: center; @@ -291,11 +292,11 @@ } } } - .cp-creation-password-warning { - margin-top: 0.4rem; - font-size: 0.75em; - line-height: 120%; - } + } + .cp-creation-password-warning { + font-size: 0.75em; + line-height: 120%; + margin: 0.4rem 1rem calc(0.4rem + 6px); } .cp-creation-settings { button { @@ -425,7 +426,6 @@ #cp-creation-form { & > div { width: 95%; - margin: 0 auto; } .cp-creation-expire { &.active { @@ -435,7 +435,6 @@ .cp-creation-slider { flex: none; order: 10; - width: 100%; } } } @@ -444,7 +443,7 @@ } @media screen and (max-width: 800px) { #cp-creation { - height: 550px; + //height: 550px; #cp-creation-form { div.cp-creation-template { flex-flow: column; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index c2dc088fc..da840dfc4 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2782,7 +2782,6 @@ define([ type: "text" // TODO type password with click to show }),*/ ]), - text, //createHelper('#', "TODO: password protection adds another layer of security ........") // TODO ]); @@ -2813,6 +2812,7 @@ define([ expire, password, ]), + text, templates, createDiv ])).appendTo($creation);