FIX: use template for storing pending comment message.

This commit is contained in:
Will Rossiter 2012-07-22 13:50:17 +12:00
parent 8819fb8381
commit a3328641e7
3 changed files with 8 additions and 7 deletions

View File

@ -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){

View File

@ -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;
}

View File

@ -0,0 +1,3 @@
<div class="pending-comment">
<p><% _t('AWAITINGMODERATION', 'Your comment has been submitted and is now awaiting moderation.') %></p>
</div>