diff --git a/modules/comment/comment.test b/modules/comment/comment.test index 2e96ba3..8775bec 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -331,7 +331,7 @@ class CommentInterfaceTest extends CommentHelperCase { $comment = $this->postComment($this->node, $comment_text); $comment_loaded = comment_load($comment->id); $this->assertTrue($this->commentExists($comment), t('Comment found.')); - $by_viewer_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-viewer")]', array(':comment_id' => 'comment-' . $comment->id)); + $by_viewer_class = $this->xpath('//a[@id=:comment_id]/following-sibling::article[1][contains(@class, "comment-by-viewer")]', array(':comment_id' => 'comment-' . $comment->id)); $this->assertTrue(!empty($by_viewer_class), t('HTML class for comments by viewer found.')); // Set comments to have subject and preview to required. @@ -421,7 +421,7 @@ class CommentInterfaceTest extends CommentHelperCase { // Create comment #5 to assert HTML class. $comment = $this->postComment($this->node, $this->randomName(), $this->randomName()); - $by_node_author_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-node-author")]', array(':comment_id' => 'comment-' . $comment->id)); + $by_node_author_class = $this->xpath('//a[@id=:comment_id]/following-sibling::article[1][contains(@class, "comment-by-node-author")]', array(':comment_id' => 'comment-' . $comment->id)); $this->assertTrue(!empty($by_node_author_class), t('HTML class for node author found.')); // Attempt to post to node with comments disabled. @@ -970,7 +970,7 @@ class CommentAnonymous extends CommentHelperCase { // Post anonymous comment without contact info. $anonymous_comment1 = $this->postComment($this->node, $this->randomName(), $this->randomName()); $this->assertTrue($this->commentExists($anonymous_comment1), t('Anonymous comment without contact info found.')); - $anonymous_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-anonymous")]', array(':comment_id' => 'comment-' . $anonymous_comment1->id)); + $anonymous_class = $this->xpath('//a[@id=:comment_id]/following-sibling::article[1][contains(@class, "comment-by-anonymous")]', array(':comment_id' => 'comment-' . $anonymous_comment1->id)); $this->assertTrue(!empty($anonymous_class), t('HTML class for anonymous comments found.')); // Allow contact info. diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php index a483813..02e504c 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -56,35 +56,33 @@ * @see template_process() * @see theme_comment() */ +// Hide links so they can be rendered apart. +hide($content['links']); ?> -
> - - - - - +
> - > + +
+ + + + + > + + +
+ - -
> - + -
- -
+ + +
- -
+ + diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test index 7586235..b768c65 100644 --- a/modules/rdf/rdf.test +++ b/modules/rdf/rdf.test @@ -502,7 +502,7 @@ class RdfCommentAttributesTestCase extends CommentHelperCase { // Tests comment #2 as anonymous user. $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user); // Tests the RDFa markup for the homepage (specific to anonymous comments). - $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); + $comment_homepage = $this->xpath('//article[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); $this->assertTrue(!empty($comment_homepage), t('RDFa markup for the homepage of anonymous user found.')); // There should be no about attribute on anonymous comments. $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[@about]'); @@ -513,7 +513,7 @@ class RdfCommentAttributesTestCase extends CommentHelperCase { $this->drupalGet('node/' . $this->node2->nid); $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user); // Tests the RDFa markup for the homepage (specific to anonymous comments). - $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); + $comment_homepage = $this->xpath('//article[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name" and @href="http://example.org/" and contains(@rel, "foaf:page")]'); $this->assertTrue(!empty($comment_homepage), t("RDFa markup for the homepage of anonymous user found.")); // There should be no about attribute on anonymous comments. $comment_homepage = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/a[@about]'); @@ -529,9 +529,9 @@ class RdfCommentAttributesTestCase extends CommentHelperCase { $comments[] = $this->postComment($this->node1, $this->randomName(), $this->randomName()); // Tests the reply_of relationship of a first level comment. - $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=1]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}"))); + $result = $this->xpath("(id('comments')//article[contains(@class,'comment ')])[position()=1]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}"))); $this->assertEqual(1, count($result), t('RDFa markup referring to the node is present.')); - $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=1]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1#comment-1'))); + $result = $this->xpath("(id('comments')//article[contains(@class,'comment ')])[position()=1]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1#comment-1'))); $this->assertFalse($result, t('No RDFa markup referring to the comment itself is present.')); // Posts a reply to the first comment. @@ -539,11 +539,11 @@ class RdfCommentAttributesTestCase extends CommentHelperCase { $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE); // Tests the reply_of relationship of a second level comment. - $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}"))); + $result = $this->xpath("(id('comments')//article[contains(@class,'comment ')])[position()=2]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}"))); $this->assertEqual(1, count($result), t('RDFa markup referring to the node is present.')); - $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1', array('fragment' => 'comment-1')))); + $result = $this->xpath("(id('comments')//article[contains(@class,'comment ')])[position()=2]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1', array('fragment' => 'comment-1')))); $this->assertEqual(1, count($result), t('RDFa markup referring to the parent comment is present.')); - $comments = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]"); + $comments = $this->xpath("(id('comments')//article[contains(@class,'comment ')])[position()=2]"); } /** @@ -557,17 +557,17 @@ class RdfCommentAttributesTestCase extends CommentHelperCase { * An array containing information about an anonymous user. */ function _testBasicCommentRdfaMarkup($comment, $account = array()) { - $comment_container = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]'); + $comment_container = $this->xpath('//article[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]'); $this->assertTrue(!empty($comment_container), t("Comment RDF type for comment found.")); - $comment_title = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//h3[@property="dc:title"]'); + $comment_title = $this->xpath('//article[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//h3[@property="dc:title"]'); $this->assertEqual((string)$comment_title[0]->a, $comment->subject, t("RDFa markup for the comment title found.")); - $comment_date = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//*[contains(@property, "dc:date") and contains(@property, "dc:created")]'); + $comment_date = $this->xpath('//article[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//*[contains(@property, "dc:date") and contains(@property, "dc:created")]'); $this->assertTrue(!empty($comment_date), t("RDFa markup for the date of the comment found.")); // The author tag can be either a or span - $comment_author = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/*[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name"]'); + $comment_author = $this->xpath('//article[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//span[@rel="sioc:has_creator"]/*[contains(@class, "username") and @typeof="sioc:UserAccount" and @property="foaf:name"]'); $name = empty($account["name"]) ? $this->web_user->name : $account["name"] . " (not verified)"; $this->assertEqual((string)$comment_author[0], $name, t("RDFa markup for the comment author found.")); - $comment_body = $this->xpath('//div[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//div[@class="content"]//div[contains(@class, "comment-body")]//div[@property="content:encoded"]'); + $comment_body = $this->xpath('//article[contains(@class, "comment") and contains(@typeof, "sioct:Comment")]//div[@class="content"]//div[contains(@class, "comment-body")]//div[@property="content:encoded"]'); $this->assertEqual((string)$comment_body[0]->p, $comment->comment, t("RDFa markup for the comment body found.")); } } diff --git a/themes/bartik/templates/comment.tpl.php b/themes/bartik/templates/comment.tpl.php index d64487d..433e7e2 100644 --- a/themes/bartik/templates/comment.tpl.php +++ b/themes/bartik/templates/comment.tpl.php @@ -57,7 +57,7 @@ * @see theme_comment() */ ?> -
> +
>
@@ -84,14 +84,18 @@ - > + +
+ > +
+
>
@@ -100,6 +104,6 @@
- +
-
+