Add placeholders for the comment form in poll
This commit is contained in:
parent
95ad25973e
commit
50090a3af6
@ -668,9 +668,12 @@ define([
|
|||||||
h('h2#cp-app-poll-comments-add-title', Msg.poll_comment_add),
|
h('h2#cp-app-poll-comments-add-title', Msg.poll_comment_add),
|
||||||
h('div#cp-app-poll-comments-add', [
|
h('div#cp-app-poll-comments-add', [
|
||||||
h('input.cp-app-poll-comments-add-name', {
|
h('input.cp-app-poll-comments-add-name', {
|
||||||
type: 'text'
|
type: 'text',
|
||||||
|
placeholder: Msg.anonymous
|
||||||
|
}),
|
||||||
|
h('textarea.cp-app-poll-comments-add-msg', {
|
||||||
|
placeholder: Msg.poll_comment_placeholder
|
||||||
}),
|
}),
|
||||||
h('textarea.cp-app-poll-comments-add-msg'),
|
|
||||||
h('button.cp-app-poll-comments-add-submit.btn.btn-secondary',
|
h('button.cp-app-poll-comments-add-submit.btn.btn-secondary',
|
||||||
Msg.poll_comment_submit),
|
Msg.poll_comment_submit),
|
||||||
h('button.cp-app-poll-comments-add-cancel.btn.btn-secondary',
|
h('button.cp-app-poll-comments-add-cancel.btn.btn-secondary',
|
||||||
|
|||||||
@ -268,6 +268,7 @@ define(function () {
|
|||||||
out.poll_comment_add = "Ajouter un commentaire";
|
out.poll_comment_add = "Ajouter un commentaire";
|
||||||
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_placeholder = "Votre commentaire";
|
||||||
|
|
||||||
out.poll_comment_disabled = "Publiez ce sondage en utilisant le bouton ✓ afin d'activer les commentaires.";
|
out.poll_comment_disabled = "Publiez ce sondage en utilisant le bouton ✓ afin d'activer les commentaires.";
|
||||||
|
|
||||||
|
|||||||
@ -272,6 +272,7 @@ define(function () {
|
|||||||
out.poll_comment_add = "Add a comment";
|
out.poll_comment_add = "Add a comment";
|
||||||
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_placeholder = "Your comment";
|
||||||
|
|
||||||
out.poll_comment_disabled = "Publish this poll using the ✓ button to enable the comments.";
|
out.poll_comment_disabled = "Publish this poll using the ✓ button to enable the comments.";
|
||||||
|
|
||||||
|
|||||||
@ -697,6 +697,7 @@ define([
|
|||||||
return comments[a].time > comments[b].time;
|
return comments[a].time > comments[b].time;
|
||||||
}).forEach(function (k) {
|
}).forEach(function (k) {
|
||||||
var c = comments[k];
|
var c = comments[k];
|
||||||
|
var name = c.name || Messages.anonymous;
|
||||||
var $c = $('<div>', {
|
var $c = $('<div>', {
|
||||||
'class': 'cp-app-poll-comments-list-el'
|
'class': 'cp-app-poll-comments-list-el'
|
||||||
}).prependTo($comments);
|
}).prependTo($comments);
|
||||||
@ -708,7 +709,7 @@ define([
|
|||||||
if (c.avatar && avatars[c.avatar]) {
|
if (c.avatar && avatars[c.avatar]) {
|
||||||
$avatar.append(avatars[c.avatar]);
|
$avatar.append(avatars[c.avatar]);
|
||||||
} else {
|
} else {
|
||||||
common.displayAvatar($avatar, c.avatar, c.name, function ($img) {
|
common.displayAvatar($avatar, c.avatar, name, function ($img) {
|
||||||
if (c.avatar && $img.length) { avatars[c.avatar] = $img[0].outerHTML; }
|
if (c.avatar && $img.length) { avatars[c.avatar] = $img[0].outerHTML; }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -717,11 +718,11 @@ define([
|
|||||||
'href': APP.origin + '/profile/#' + c.profile,
|
'href': APP.origin + '/profile/#' + c.profile,
|
||||||
'target': '_blank',
|
'target': '_blank',
|
||||||
'class': 'cp-app-poll-comments-list-data-name'
|
'class': 'cp-app-poll-comments-list-data-name'
|
||||||
}).appendTo($data).text(c.name);
|
}).appendTo($data).text(name);
|
||||||
} else {
|
} else {
|
||||||
$('<span>', {
|
$('<span>', {
|
||||||
'class': 'cp-app-poll-comments-list-data-name'
|
'class': 'cp-app-poll-comments-list-data-name'
|
||||||
}).appendTo($data).text(c.name);
|
}).appendTo($data).text(name);
|
||||||
}
|
}
|
||||||
$('<span>', {
|
$('<span>', {
|
||||||
'class': 'cp-app-poll-comments-list-data-time'
|
'class': 'cp-app-poll-comments-list-data-time'
|
||||||
@ -759,10 +760,12 @@ define([
|
|||||||
};
|
};
|
||||||
var addComment = function () {
|
var addComment = function () {
|
||||||
if (!APP.proxy.comments) { APP.proxy.comments = {}; }
|
if (!APP.proxy.comments) { APP.proxy.comments = {}; }
|
||||||
var name = APP.$addComment.find('.cp-app-poll-comments-add-name').val();
|
var name = APP.$addComment.find('.cp-app-poll-comments-add-name').val().trim();
|
||||||
var msg = APP.$addComment.find('.cp-app-poll-comments-add-msg').val();
|
var msg = APP.$addComment.find('.cp-app-poll-comments-add-msg').val().trim();
|
||||||
var time = +new Date();
|
var time = +new Date();
|
||||||
|
|
||||||
|
if (!msg) { return; }
|
||||||
|
|
||||||
var profile, avatar;
|
var profile, avatar;
|
||||||
if (common.isLoggedIn()) {
|
if (common.isLoggedIn()) {
|
||||||
profile = metadataMgr.getUserData().profile;
|
profile = metadataMgr.getUserData().profile;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user