From 79b0460d809e03575e05f239f9817f33919d934f Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 10 Jun 2021 16:50:16 +0200 Subject: [PATCH 1/3] Fix poll total column UI --- www/form/app-form.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/form/app-form.less b/www/form/app-form.less index dcbe5758a..c5780e589 100644 --- a/www/form/app-form.less +++ b/www/form/app-form.less @@ -554,6 +554,9 @@ & > div { display: flex; } + .cp-poll-total { + display: flex; + } .cp-form-poll-body { flex-flow: column; max-height: 225px; @@ -642,6 +645,9 @@ } } } + .cp-poll-total { + flex-flow: column; + } .cp-poll-cell:not(.cp-poll-switch) { &:first-child { width: 100px; From d35a499fc79d434d229e1afa5a2d5f0a4de55bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Thu, 10 Jun 2021 17:15:15 +0100 Subject: [PATCH 2/3] Fix Submit UI - anonymous checkbox alignment - invalid red colors across light/dark themes --- .../src/less2/include/colortheme-dark.less | 2 +- www/form/app-form.less | 12 ++++++++---- www/form/inner.js | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/customize.dist/src/less2/include/colortheme-dark.less b/customize.dist/src/less2/include/colortheme-dark.less index a16f9b5ca..f8ea0c92b 100644 --- a/customize.dist/src/less2/include/colortheme-dark.less +++ b/customize.dist/src/less2/include/colortheme-dark.less @@ -437,4 +437,4 @@ @cp_form-poll-yes: fade(@cryptpad_color_green, 25%); @cp_form-poll-maybe: @cryptpad_color_grey_700; @cp_form-poll-yes-color: @cryptpad_color_green; -@cp_form-invalid: @cryptpad_color_red; +@cp_form-invalid: @cryptpad_color_light_red; diff --git a/www/form/app-form.less b/www/form/app-form.less index dcbe5758a..4b0be26fc 100644 --- a/www/form/app-form.less +++ b/www/form/app-form.less @@ -197,9 +197,6 @@ } } - .cp-form-page + .cp-form-send-container { - margin-top: 10px; - } .cp-form-send-container { text-align: center; margin: 50px auto 100px auto; @@ -215,8 +212,15 @@ } li { text-align: left; + a { + color: @cryptpad_color_link; + } } } + .cp-form-anon-answer { + text-align: center; + margin: 20px 0 30px 0; + } } .cp-form-page-container { @@ -293,7 +297,7 @@ justify-content: space-between; } input:invalid { - border: 2px solid @cp_form-invalid; + border: 2px solid @cryptpad_color_red; color: @cp_form-invalid; } media-tag { diff --git a/www/form/inner.js b/www/form/inner.js index 2e6564465..95fe5064b 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -1909,7 +1909,7 @@ define([ return h('div.cp-form-send-container', [ invalid, - cbox ? h('div', cbox) : undefined, + cbox ? h('div.cp-form-anon-answer', cbox) : undefined, send, reset ]); }; From 62761c903c42420dfe391fc070caf7151cf456cb Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 11 Jun 2021 14:07:22 +0530 Subject: [PATCH 3/3] fix login and redirect links for forms without anonymous answers --- www/form/inner.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/www/form/inner.js b/www/form/inner.js index 95fe5064b..26d591320 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2512,6 +2512,16 @@ define([ } }; + var showAnonBlockedAlert = function () { + var content = UI.setHTML(h('span.cp-anon-blocked-msg'), Messages.form_anonymous_blocked); + $(content).find('a').click(function (ev) { + ev.preventDefault(); + var href = ($(this).attr('href') || '').replace(/\//g, ''); + APP.common.setLoginRedirect(href || 'login'); + }); + UI.alert(content); + }; + framework.onReady(function () { var priv = metadataMgr.getPrivateData(); @@ -2581,7 +2591,7 @@ define([ var loggedIn = framework._.sfCommon.isLoggedIn(); if (!loggedIn && !content.answers.anonymous) { - UI.alert(Messages.form_anonymous_blocked); + showAnonBlockedAlert(); } // If the results are public and there is at least one doodle, fetch the results now