From c63e6a4f32886430571d7b2e5a04fcf1b5485602 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 10 Jun 2021 13:31:39 +0200 Subject: [PATCH] Info message when there are no responses --- www/form/inner.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/www/form/inner.js b/www/form/inner.js index fa62de74b..fda6bbf38 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -1734,11 +1734,18 @@ define([ var renderResults = function (content, answers) { var $container = $('div.cp-form-creator-results').empty(); + + if (!Object.keys(answers || {}).length) { + $container.append(h('div.alert.alert-info', Messages.form_results_empty)); + return; + } + var controls = h('div.cp-form-creator-results-controls'); var $controls = $(controls).appendTo($container); var results = h('div.cp-form-creator-results-content'); var $results = $(results).appendTo($container); + var summary = true; var form = content.form;