diff --git a/core/modules/comment/comment-rtl.css b/core/modules/comment/comment-rtl.css deleted file mode 100644 index 39c3929651d6e552f9cbf6508907132f5b76282d..0000000000000000000000000000000000000000 --- a/core/modules/comment/comment-rtl.css +++ /dev/null @@ -1,5 +0,0 @@ - -.indented { - margin-left: 0; - margin-right: 25px; -} diff --git a/core/modules/comment/comment.css b/core/modules/comment/comment.css deleted file mode 100644 index a55f527c8ad34dbd64c4a5d5c37cd8b7dc047a5b..0000000000000000000000000000000000000000 --- a/core/modules/comment/comment.css +++ /dev/null @@ -1,13 +0,0 @@ - -#comments { - margin-top: 15px; -} -.indented { - margin-left: 25px; /* LTR */ -} -.comment-unpublished { - background-color: #fff4f4; -} -.comment-preview { - background-color: #ffffea; -} diff --git a/core/modules/comment/comment.info b/core/modules/comment/comment.info index db6dc2c0d9a919c85b22c8349e76c15bc011cf30..6bbd275242737cda97c9b19e11f24a01270d94fd 100644 --- a/core/modules/comment/comment.info +++ b/core/modules/comment/comment.info @@ -9,4 +9,4 @@ dependencies[] = entity files[] = comment.entity.inc files[] = comment.test configure = admin/content/comment -stylesheets[all][] = comment.css +stylesheets[all][] = comment.theme.css diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 09cce4c676d5377f33268e0bd0e61fb9a51519c0..40ef0d1987eae25093207b9d15e6b5c1bcb4bbbd 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -2143,30 +2143,29 @@ function template_preprocess_comment(&$variables) { // Set status to a string representation of comment->status. if (isset($comment->in_preview)) { - $variables['status'] = 'comment-preview'; + $variables['status'] = 'preview'; } else { - $variables['status'] = ($comment->status == COMMENT_NOT_PUBLISHED) ? 'comment-unpublished' : 'comment-published'; + $variables['status'] = ($comment->status == COMMENT_NOT_PUBLISHED) ? 'unpublished' : 'published'; } // Gather comment classes. - // 'comment-published' class is not needed, it is either 'comment-preview' or - // 'comment-unpublished'. - if ($variables['status'] != 'comment-published') { + // 'published' class is not needed, it is either 'preview' or 'unpublished'. + if ($variables['status'] != 'published') { $variables['classes_array'][] = $variables['status']; } if ($variables['new']) { - $variables['classes_array'][] = 'comment-new'; + $variables['classes_array'][] = 'new'; } if (!$comment->uid) { - $variables['classes_array'][] = 'comment-by-anonymous'; + $variables['classes_array'][] = 'by-anonymous'; } else { if ($comment->uid == $variables['node']->uid) { - $variables['classes_array'][] = 'comment-by-node-author'; + $variables['classes_array'][] = 'by-node-author'; } if ($comment->uid == $variables['user']->uid) { - $variables['classes_array'][] = 'comment-by-viewer'; + $variables['classes_array'][] = 'by-viewer'; } } } diff --git a/core/modules/comment/comment.test b/core/modules/comment/comment.test index f980c2dc48c46055d5f69e01820f36f049f3589f..375d7550d384258e362af2a6b40c418ab36701ba 100644 --- a/core/modules/comment/comment.test +++ b/core/modules/comment/comment.test @@ -525,56 +525,56 @@ class CommentInterfaceTest extends CommentHelperCase { // Verify classes if the comment is visible for the current user. if ($case['comment_status'] == COMMENT_PUBLISHED || $case['user'] == 'admin') { - // Verify the comment-by-anonymous class. - $comments = $this->xpath('//*[contains(@class, "comment-by-anonymous")]'); + // Verify the by-anonymous class. + $comments = $this->xpath('//*[contains(@class, "comment") and contains(@class, "by-anonymous")]'); if ($case['comment_uid'] == 0) { - $this->assertTrue(count($comments) == 1, 'comment-by-anonymous class found.'); + $this->assertTrue(count($comments) == 1, 'by-anonymous class found.'); } else { - $this->assertFalse(count($comments), 'comment-by-anonymous class not found.'); + $this->assertFalse(count($comments), 'by-anonymous class not found.'); } - // Verify the comment-by-node-author class. - $comments = $this->xpath('//*[contains(@class, "comment-by-node-author")]'); + // Verify the by-node-author class. + $comments = $this->xpath('//*[contains(@class, "comment") and contains(@class, "by-node-author")]'); if ($case['comment_uid'] > 0 && $case['comment_uid'] == $case['node_uid']) { - $this->assertTrue(count($comments) == 1, 'comment-by-node-author class found.'); + $this->assertTrue(count($comments) == 1, 'by-node-author class found.'); } else { - $this->assertFalse(count($comments), 'comment-by-node-author class not found.'); + $this->assertFalse(count($comments), 'by-node-author class not found.'); } - // Verify the comment-by-viewer class. - $comments = $this->xpath('//*[contains(@class, "comment-by-viewer")]'); + // Verify the by-viewer class. + $comments = $this->xpath('//*[contains(@class, "comment") and contains(@class, "by-viewer")]'); if ($case['comment_uid'] > 0 && $case['comment_uid'] == $case['user_uid']) { - $this->assertTrue(count($comments) == 1, 'comment-by-viewer class found.'); + $this->assertTrue(count($comments) == 1, 'by-viewer class found.'); } else { - $this->assertFalse(count($comments), 'comment-by-viewer class not found.'); + $this->assertFalse(count($comments), 'by-viewer class not found.'); } } - // Verify the comment-unpublished class. - $comments = $this->xpath('//*[contains(@class, "comment-unpublished")]'); + // Verify the unpublished class. + $comments = $this->xpath('//*[contains(@class, "comment") and contains(@class, "unpublished")]'); if ($case['comment_status'] == COMMENT_NOT_PUBLISHED && $case['user'] == 'admin') { - $this->assertTrue(count($comments) == 1, 'comment-unpublished class found.'); + $this->assertTrue(count($comments) == 1, 'unpublished class found.'); } else { - $this->assertFalse(count($comments), 'comment-unpublished class not found.'); + $this->assertFalse(count($comments), 'unpublished class not found.'); } - // Verify the comment-new class. + // Verify the new class. if ($case['comment_status'] == COMMENT_PUBLISHED || $case['user'] == 'admin') { - $comments = $this->xpath('//*[contains(@class, "comment-new")]'); + $comments = $this->xpath('//*[contains(@class, "comment") and contains(@class, "new")]'); if ($case['user'] != 'anonymous') { - $this->assertTrue(count($comments) == 1, 'comment-new class found.'); + $this->assertTrue(count($comments) == 1, 'new class found.'); - // Request the node again. The comment-new class should disappear. + // Request the node again. The new class should disappear. $this->drupalGet('node/' . $node->nid); - $comments = $this->xpath('//*[contains(@class, "comment-new")]'); - $this->assertFalse(count($comments), 'comment-new class not found.'); + $comments = $this->xpath('//*[contains(@class, "comment") and contains(@class, "new")]'); + $this->assertFalse(count($comments), 'new class not found.'); } else { - $this->assertFalse(count($comments), 'comment-new class not found.'); + $this->assertFalse(count($comments), 'new class not found.'); } } } @@ -1005,7 +1005,7 @@ class CommentPreviewTest extends CommentHelperCase { $this->assertLink($test_signature); // Check that the user picture is displayed. - $this->assertFieldByXPath("//div[contains(@class, 'comment-preview')]//div[contains(@class, 'user-picture')]//img", NULL, 'User picture displayed.'); + $this->assertFieldByXPath("//div[contains(@class, 'preview')]//div[contains(@class, 'user-picture')]//img", NULL, 'User picture displayed.'); } /** diff --git a/core/modules/comment/comment.tpl.php b/core/modules/comment/comment.tpl.php index 678f79810fa9641ea00323e392567fafd186d6c2..6a1738713a58445e03f7313234ac78d5fc30bcf2 100644 --- a/core/modules/comment/comment.tpl.php +++ b/core/modules/comment/comment.tpl.php @@ -23,21 +23,20 @@ * - $user_picture: The comment author's picture from user-picture.tpl.php. * - $signature: Authors signature. * - $status: Comment status. Possible values are: - * comment-unpublished, comment-published or comment-preview. + * unpublished, published, or preview. * - $title: Linked title. * - $classes: String of classes that can be used to style contextually through * CSS. It can be manipulated through the variable $classes_array from * preprocess functions. The default values can be one or more of the * following: - * - comment: The current template type, i.e., "theming hook". - * - comment-by-anonymous: Comment by an unregistered user. - * - comment-by-node-author: Comment by the author of the parent node. - * - comment-preview: When previewing a new or edited comment. + * - comment: The current template type; e.g., 'theming hook'. + * - by-anonymous: Comment by an unregistered user. + * - by-node-author: Comment by the author of the parent node. + * - preview: When previewing a new or edited comment. * The following applies only to viewers who are registered users: - * - comment-unpublished: An unpublished comment visible only to - * administrators. - * - comment-by-viewer: Comment by the user currently viewing the page. - * - comment-new: New comment since last the visit. + * - unpublished: An unpublished comment visible only to administrators. + * - by-viewer: Comment by the user currently viewing the page. + * - new: New comment since the last visit. * - $title_prefix (array): An array containing additional output populated by * modules, intended to be displayed in front of the main title tag that * appears in the template. diff --git a/core/themes/bartik/css/style-rtl.css b/core/themes/bartik/css/style-rtl.css index da0b86ee481fed0ea5df34df209679d53906ac0c..90638eb28bd55650f51047ca514e479a9fdeb9a3 100644 --- a/core/themes/bartik/css/style-rtl.css +++ b/core/themes/bartik/css/style-rtl.css @@ -1,4 +1,3 @@ - /* ------------------ Reset Styles ------------------ */ caption, @@ -125,7 +124,7 @@ ul.tips { .comment ul.links li { padding: 0 0 0.5em; } -.comment-unpublished { +.comment.unpublished { margin-left: 5px; margin-right: 0; padding: 5px 5px 5px 2px; diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 4eaf4d82f7fff238530818c5452ed9c1c48aaa3a..8fbe5aa1fd8bf224b98a9c8de13fe930de93ca0b 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -1,4 +1,3 @@ - /* ---------- Overall Specifications ---------- */ body { @@ -716,11 +715,11 @@ ul.links { .comment ul.links li { padding: 0 0.5em 0 0; /* LTR */ } -.comment-unpublished { +.comment.unpublished { margin-right: 5px; /* LTR */ padding: 5px 2px 5px 5px; /* LTR */ } -.comment-unpublished .comment-text .comment-arrow { +.comment.unpublished .comment-text .comment-arrow { border-left: 1px solid #fff4f4; border-right: 1px solid #fff4f4; } diff --git a/core/themes/bartik/templates/comment.tpl.php b/core/themes/bartik/templates/comment.tpl.php index 553fb53a32566f79bcdf730e5ff333b35adde304..27e8a4660e0aa587896fbff04563da8eca57221a 100644 --- a/core/themes/bartik/templates/comment.tpl.php +++ b/core/themes/bartik/templates/comment.tpl.php @@ -23,19 +23,19 @@ * - $picture: Authors picture. * - $signature: Authors signature. * - $status: Comment status. Possible values are: - * comment-unpublished, comment-published or comment-preview. + * unpublished, published, or preview. * - $title: Linked title. * - $classes: String of classes that can be used to style contextually through * CSS. It can be manipulated through the variable $classes_array from * preprocess functions. The default values can be one or more of the following: - * - comment: The current template type, i.e., "theming hook". - * - comment-by-anonymous: Comment by an unregistered user. - * - comment-by-node-author: Comment by the author of the parent node. - * - comment-preview: When previewing a new or edited comment. + * - comment: The current template type; e.g., 'theming hook'. + * - by-anonymous: Comment by an unregistered user. + * - by-node-author: Comment by the author of the parent node. + * - preview: When previewing a new or edited comment. * The following applies only to viewers who are registered users: - * - comment-unpublished: An unpublished comment visible only to administrators. - * - comment-by-viewer: Comment by the user currently viewing the page. - * - comment-new: New comment since last the visit. + * - unpublished: An unpublished comment visible only to administrators. + * - by-viewer: Comment by the user currently viewing the page. + * - new: New comment since the last visit. * - $title_prefix (array): An array containing additional output populated by * modules, intended to be displayed in front of the main title tag that * appears in the template.