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->write();
|
||||
|
||||
$moderationMsg = _t('CommentInterface_Form.AWAITINGMODERATION', "Your comment has been submitted and is now awaiting moderation.");
|
||||
|
||||
// clear the users comment since it passed validation
|
||||
Cookie::set('CommentsForm_Comment', false);
|
||||
|
||||
if(Director::is_ajax()) {
|
||||
if($comment->NeedsModeration){
|
||||
echo $moderationMsg;
|
||||
} else{
|
||||
if(!$comment->Moderated) {
|
||||
echo $comment->renderWith('CommentInterface_pendingcomment');
|
||||
} else {
|
||||
echo $comment->renderWith('CommentInterface_singlecomment');
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if($comment->NeedsModeration){
|
||||
|
@ -115,7 +115,7 @@ class Comment extends DataObject {
|
||||
$labels['Name'] = _t('Comment.NAME', 'Author Name');
|
||||
$labels['Comment'] = _t('Comment.COMMENT', 'Comment');
|
||||
$labels['IsSpam'] = _t('Comment.ISSPAM', 'Spam?');
|
||||
$labels['NeedsModeration'] = _t('Comment.NEEDSMODERATION', 'Needs Moderation?');
|
||||
$labels['Moderated'] = _t('Comment.MODERATED', 'Moderated?');
|
||||
|
||||
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