diff --git a/core/includes/theme.inc b/core/includes/theme.inc index b1a911a..65a0aa6 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -32,21 +32,6 @@ */ /** - * Mark content as read. - */ -const MARK_READ = 0; - -/** - * Mark content as being new. - */ -const MARK_NEW = 1; - -/** - * Mark content as being updated. - */ -const MARK_UPDATED = 2; - -/** * A responsive table class; hide table cell on narrow devices. * * Indicates that a column has medium priority and thus can be hidden on narrow @@ -1705,7 +1690,7 @@ function drupal_common_theme() { 'variables' => array('style' => NULL), ), 'mark' => array( - 'variables' => array('status' => MARK_NEW), + 'variables' => array('status' => t('new'), 'type' => 'info'), ), 'item_list' => array( 'variables' => array('items' => array(), 'title' => '', 'list_type' => 'ul', 'attributes' => array(), 'empty' => NULL, 'context' => array()), diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 0756a53..76f9a8c 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -736,9 +736,20 @@ function template_preprocess_comment(&$variables) { if (isset($comment->in_preview)) { $variables['status'] = 'preview'; } - else { - $variables['status'] = $comment->isPublished() ? 'published' : 'unpublished'; + elseif (!$comment->isPublished()) { + $variables['status'] = 'unpublished'; + } + + // Create markers to display the status. + $markers = array(); + if($variables['status']) { + $markers[] = array( + '#theme' => 'mark', + '#status' => $variables['status'], + '#type' => 'warning' + ); } + $variables['markers'] = drupal_render($markers); // Add comment author user ID. Necessary for the comment-by-viewer library. $variables['attributes']['data-comment-user-id'] = $comment->getOwnerId(); diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig index 14c52eb..2b7bc47 100644 --- a/core/modules/comment/templates/comment.html.twig +++ b/core/modules/comment/templates/comment.html.twig @@ -74,6 +74,7 @@ indicator here would break the render cache. #} + {{ markers }}