From bcd4d88f8112304ee87d295af14ac1901f026e09 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 1 Sep 2021 17:25:16 +0200 Subject: [PATCH 1/2] Fix reordering questions in forms --- www/form/inner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/form/inner.js b/www/form/inner.js index 85c3c0bfd..e1e719534 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2987,6 +2987,7 @@ define([ updateAddInline(); if (editable) { + if (APP.mainSortable) { APP.mainSortable.destroy(); } APP.mainSortable = Sortable.create($container[0], { direction: "vertical", filter: "input, button, .CodeMirror, .cp-form-type-sort, .cp-form-block-type.editable", From 15eeaa75f65e95ab44a88032e2e501b46487200c Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 1 Sep 2021 17:32:55 +0200 Subject: [PATCH 2/2] Add logo to the submit page --- www/form/app-form.less | 5 +++++ www/form/inner.js | 27 ++++++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/www/form/app-form.less b/www/form/app-form.less index 5bc46a085..2a1533268 100644 --- a/www/form/app-form.less +++ b/www/form/app-form.less @@ -581,11 +581,16 @@ align-items: center; justify-content: center; flex: 1; + flex-flow: column; .cp-form-submit-actions { button:not(:last-child) { margin-right: 10px; } } + .cp-form-view-logo { + margin-top: 100px; + padding-bottom: 20px; + } } div.cp-form-creator-results { display: flex; diff --git a/www/form/inner.js b/www/form/inner.js index 40bc96272..75d4b47af 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2217,6 +2217,20 @@ define([ $container.prepend($res); }; + var getLogo = function () { + var logo = h('div.cp-form-view-logo', [ + h('img', { + src:'/customize/CryptPad_logo_grey.svg?'+ApiConfig.requireConf.urlArgs, + alt:'CryptPad_logo' + }), + h('span', 'CryptPad') + ]); + $(logo).click(function () { + framework._.sfCommon.gotoURL('/drive/'); + }); + return logo; + }; + Messages.form_alreadyAnswered = "You've responded to this form on {0}"; // XXX Messages.form_editAnswer = "Edit my responses"; // XXX Messages.form_viewAnswer = "View my responses"; // XXX @@ -2290,6 +2304,7 @@ define([ new Date(APP.lastAnswerTime).toLocaleString()])), actions ])); + $container.append(getLogo()); }; var getFormResults = function () { @@ -3047,17 +3062,7 @@ define([ // at the bottom var title = framework._.title.title || framework._.title.defaultTitle; $container.prepend(h('h1.cp-form-view-title', title)); - var logo = h('div.cp-form-view-logo', [ - h('img', { - src:'/customize/CryptPad_logo_grey.svg?'+ApiConfig.requireConf.urlArgs, - alt:'CryptPad_logo' - }), - h('span', 'CryptPad') - ]); - $(logo).click(function () { - framework._.sfCommon.gotoURL('/drive/'); - }); - $container.append(logo); + $container.append(getLogo()); if (!answers) { $container.find('.cp-reset-button').attr('disabled', 'disabled');