Commit 89df46f5 authored by alexpott's avatar alexpott

Issue #2428509 by andypost, rahul.shinde, emma.maria: Comment links weight...

Issue #2428509 by andypost, rahul.shinde, emma.maria: Comment links weight should be managed by view display
parent e3829955
......@@ -66,7 +66,7 @@ public function testCommentLinks() {
'subject' => $this->randomMachineName(),
'hostname' => '127.0.0.1',
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
'comment_body' => array(LanguageInterface::LANGCODE_NOT_SPECIFIED => array($this->randomMachineName())),
'comment_body' => array(array('value' => $this->randomMachineName())),
));
$comment->save();
$this->comment = $comment;
......@@ -101,6 +101,26 @@ public function testCommentLinks() {
$this->assertLink('Add new comment');
}
// Change weight to make links go before comment body.
entity_get_display('comment', 'comment', 'default')
->setComponent('links', array('weight' => -100))
->save();
$this->drupalGet($this->node->urlInfo());
$element = $this->cssSelect('article.js-comment > div');
// Get last child element.
$element = end($element[0]);
$this->assertIdentical($element[0]->getName(), 'div', 'Last element is comment body.');
// Change weight to make links go after comment body.
entity_get_display('comment', 'comment', 'default')
->setComponent('links', array('weight' => 100))
->save();
$this->drupalGet($this->node->urlInfo());
$element = $this->cssSelect('article.js-comment > div');
// Get last child element.
$element = end($element[0]);
$this->assertIdentical($element[0]->getName(), 'ul', 'Last element is comment links.');
// Make sure we can hide node links.
entity_get_display('node', $this->node->bundle(), 'default')
->removeComponent('links')
......
......@@ -105,9 +105,6 @@
margin-bottom: 0.45em;
font-size: 1.171em;
}
.comment__content nav {
padding-top: 1px;
}
.indented {
margin-left: 40px; /* LTR */
}
......
......@@ -103,9 +103,6 @@
<h3{{ title_attributes }}>{{ title }}</h3>
{{ title_suffix }}
{% endif %}
{{ content|without('links') }}
{% if content.links %}
<nav>{{ content.links }}</nav>
{% endif %}
{{ content }}
</div>
</article>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment