From dd141b5c9f087747bdc1e6e44ac01d62629d9c88 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 9 Oct 2017 14:08:54 +0200 Subject: [PATCH] Disable comments when a poll is not published --- customize.dist/pages.js | 3 +- customize.dist/translations/messages.fr.js | 2 ++ customize.dist/translations/messages.js | 2 ++ www/poll/app-poll.less | 32 ++++++++++++++++------ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 5fac0939b..f120a628f 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -679,7 +679,8 @@ define([ ]), h('h2#cp-app-poll-comments-list-title', Msg.poll_comment_list), h('div#cp-app-poll-comments-list') - ]) + ]), + h('div#cp-app-poll-nocomments', Msg.poll_comment_disabled) ]) ]) ]) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 91bba1fbf..c33616a40 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -267,6 +267,8 @@ define(function () { out.poll_comment_submit = "Envoyer"; out.poll_comment_remove = "Supprimer ce commentaire"; + out.poll_comment_disabled = "Publiez ce sondage en utilisant le bouton ✓ afin d'activer les commentaires."; + // Canvas out.canvas_clear = "Nettoyer"; out.canvas_delete = "Supprimer la sélection"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index f7bb3ffca..2d41b4dc2 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -271,6 +271,8 @@ define(function () { out.poll_comment_submit = "Send"; out.poll_comment_remove = "Delete this comment"; + out.poll_comment_disabled = "Publish this poll using the ✓ button to enable the comments."; + // Canvas out.canvas_clear = "Clear"; out.canvas_delete = "Delete selection"; diff --git a/www/poll/app-poll.less b/www/poll/app-poll.less index 1b58841e3..526d1b2af 100644 --- a/www/poll/app-poll.less +++ b/www/poll/app-poll.less @@ -125,6 +125,7 @@ table#cp-app-poll-table { min-width: 80%; width: 80%; min-height: 200px; + height: 200px; border: 1px solid black; .CodeMirror-placeholder { color: #777; @@ -149,18 +150,26 @@ table#cp-app-poll-table { max-height: 20em; } } -.cp-app-poll-published { - #cp-app-poll-description { - display: none; - &~ .CodeMirror { +div.cp-app-poll-published { + div.cp-app-poll-realtime { + #cp-app-poll-description { display: none; + &~ .CodeMirror { + display: none; + } } - } - #cp-app-poll-description-published { - display: block; - &:empty { + #cp-app-poll-description-published { + display: block; + &:empty { + display: none; + } + } + #cp-app-poll-nocomments { display: none; } + #cp-app-poll-comments { + display: block; + } } } @@ -490,11 +499,18 @@ div.cp-app-poll-realtime { display: none; } } + #cp-app-poll-nocomments { + color: #999; + text-align: center; + margin: 20px; + font: @colortheme_app-font; + } #cp-app-poll-comments { width: 50%; margin: 20px auto; min-width: 400px; padding-bottom: 5px; + display: none; button { border-radius: 0; }