From 9777a2a370cbcd5e5f65774aba36f86a6a870dbd Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 17 May 2020 18:12:02 +0200 Subject: [PATCH] Add new setting when creating survey --- assets/js/components/posts/form.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/js/components/posts/form.js b/assets/js/components/posts/form.js index 91101472..7bd093a3 100644 --- a/assets/js/components/posts/form.js +++ b/assets/js/components/posts/form.js @@ -275,6 +275,14 @@ ComunicWeb.components.posts.form = { multiple: true, }); + // Specify whether anyone can add suggestions to the survey or not + const allowNewChoicesInput = createFormGroup({ + target: surveyForm, + type: "checkbox", + label: tr("Allow everyone to add new answers after the creation of the survey"), + checked: false + }); + //Survey message help var surveyAnswerHelper = createElem2({ appendTo: surveyForm, @@ -536,6 +544,7 @@ ComunicWeb.components.posts.form = { datas.append("kind", "survey"); datas.append("question", surveyQuestionInput.value); datas.append("answers", answers.join("<>")); + datas.append("allowNewAnswers", allowNewChoicesInput.checked); }