mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
FIX: use template for storing pending comment message.
This commit is contained in:
parent
8819fb8381
commit
a3328641e7
@ -357,19 +357,17 @@ class CommentingController extends Controller {
|
|||||||
$comment->Moderated = ($moderated) ? false : true;
|
$comment->Moderated = ($moderated) ? false : true;
|
||||||
$comment->write();
|
$comment->write();
|
||||||
|
|
||||||
$moderationMsg = _t('CommentInterface_Form.AWAITINGMODERATION', "Your comment has been submitted and is now awaiting moderation.");
|
|
||||||
|
|
||||||
// clear the users comment since it passed validation
|
// clear the users comment since it passed validation
|
||||||
Cookie::set('CommentsForm_Comment', false);
|
Cookie::set('CommentsForm_Comment', false);
|
||||||
|
|
||||||
if(Director::is_ajax()) {
|
if(Director::is_ajax()) {
|
||||||
if($comment->NeedsModeration){
|
if(!$comment->Moderated) {
|
||||||
echo $moderationMsg;
|
echo $comment->renderWith('CommentInterface_pendingcomment');
|
||||||
} else{
|
} else {
|
||||||
echo $comment->renderWith('CommentInterface_singlecomment');
|
echo $comment->renderWith('CommentInterface_singlecomment');
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($comment->NeedsModeration){
|
if($comment->NeedsModeration){
|
||||||
|
@ -115,7 +115,7 @@ class Comment extends DataObject {
|
|||||||
$labels['Name'] = _t('Comment.NAME', 'Author Name');
|
$labels['Name'] = _t('Comment.NAME', 'Author Name');
|
||||||
$labels['Comment'] = _t('Comment.COMMENT', 'Comment');
|
$labels['Comment'] = _t('Comment.COMMENT', 'Comment');
|
||||||
$labels['IsSpam'] = _t('Comment.ISSPAM', 'Spam?');
|
$labels['IsSpam'] = _t('Comment.ISSPAM', 'Spam?');
|
||||||
$labels['NeedsModeration'] = _t('Comment.NEEDSMODERATION', 'Needs Moderation?');
|
$labels['Moderated'] = _t('Comment.MODERATED', 'Moderated?');
|
||||||
|
|
||||||
return $labels;
|
return $labels;
|
||||||
}
|
}
|
||||||
|
3
templates/CommentsInterface_pendingcomment.ss
Normal file
3
templates/CommentsInterface_pendingcomment.ss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<div class="pending-comment">
|
||||||
|
<p><% _t('AWAITINGMODERATION', 'Your comment has been submitted and is now awaiting moderation.') %></p>
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user