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..8fb892930 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 { @@ -554,6 +558,9 @@ & > div { display: flex; } + .cp-poll-total { + display: flex; + } .cp-form-poll-body { flex-flow: column; max-height: 225px; @@ -642,6 +649,9 @@ } } } + .cp-poll-total { + flex-flow: column; + } .cp-poll-cell:not(.cp-poll-switch) { &:first-child { width: 100px; diff --git a/www/form/inner.js b/www/form/inner.js index 2e6564465..26d591320 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 ]); }; @@ -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