Disable comments when a poll is not published

This commit is contained in:
yflory
2017-10-09 14:08:54 +02:00
parent aa744567ed
commit dd141b5c9f
4 changed files with 31 additions and 10 deletions

View File

@@ -679,7 +679,8 @@ define([
]), ]),
h('h2#cp-app-poll-comments-list-title', Msg.poll_comment_list), h('h2#cp-app-poll-comments-list-title', Msg.poll_comment_list),
h('div#cp-app-poll-comments-list') h('div#cp-app-poll-comments-list')
]) ]),
h('div#cp-app-poll-nocomments', Msg.poll_comment_disabled)
]) ])
]) ])
]) ])

View File

@@ -267,6 +267,8 @@ define(function () {
out.poll_comment_submit = "Envoyer"; out.poll_comment_submit = "Envoyer";
out.poll_comment_remove = "Supprimer ce commentaire"; out.poll_comment_remove = "Supprimer ce commentaire";
out.poll_comment_disabled = "Publiez ce sondage en utilisant le bouton ✓ afin d'activer les commentaires.";
// Canvas // Canvas
out.canvas_clear = "Nettoyer"; out.canvas_clear = "Nettoyer";
out.canvas_delete = "Supprimer la sélection"; out.canvas_delete = "Supprimer la sélection";

View File

@@ -271,6 +271,8 @@ define(function () {
out.poll_comment_submit = "Send"; out.poll_comment_submit = "Send";
out.poll_comment_remove = "Delete this comment"; out.poll_comment_remove = "Delete this comment";
out.poll_comment_disabled = "Publish this poll using the ✓ button to enable the comments.";
// Canvas // Canvas
out.canvas_clear = "Clear"; out.canvas_clear = "Clear";
out.canvas_delete = "Delete selection"; out.canvas_delete = "Delete selection";

View File

@@ -125,6 +125,7 @@ table#cp-app-poll-table {
min-width: 80%; min-width: 80%;
width: 80%; width: 80%;
min-height: 200px; min-height: 200px;
height: 200px;
border: 1px solid black; border: 1px solid black;
.CodeMirror-placeholder { .CodeMirror-placeholder {
color: #777; color: #777;
@@ -149,7 +150,8 @@ table#cp-app-poll-table {
max-height: 20em; max-height: 20em;
} }
} }
.cp-app-poll-published { div.cp-app-poll-published {
div.cp-app-poll-realtime {
#cp-app-poll-description { #cp-app-poll-description {
display: none; display: none;
&~ .CodeMirror { &~ .CodeMirror {
@@ -162,6 +164,13 @@ table#cp-app-poll-table {
display: none; display: none;
} }
} }
#cp-app-poll-nocomments {
display: none;
}
#cp-app-poll-comments {
display: block;
}
}
} }
#cp-app-poll-help { #cp-app-poll-help {
@@ -490,11 +499,18 @@ div.cp-app-poll-realtime {
display: none; display: none;
} }
} }
#cp-app-poll-nocomments {
color: #999;
text-align: center;
margin: 20px;
font: @colortheme_app-font;
}
#cp-app-poll-comments { #cp-app-poll-comments {
width: 50%; width: 50%;
margin: 20px auto; margin: 20px auto;
min-width: 400px; min-width: 400px;
padding-bottom: 5px; padding-bottom: 5px;
display: none;
button { button {
border-radius: 0; border-radius: 0;
} }