Commit 00df5bad authored by alexpott's avatar alexpott

Issue #2407743 by mortendk, danquah, rteijeiro, davidhernandez,...

Issue #2407743 by mortendk, danquah, rteijeiro, davidhernandez, sivaji@knackforge.com: Remove classes from system templates s*.html.twig
parent 2bbeb8f3
...@@ -25,6 +25,10 @@ class MessageTest extends KernelTestBase { ...@@ -25,6 +25,10 @@ class MessageTest extends KernelTestBase {
* Tests setting messages output. * Tests setting messages output.
*/ */
function testMessages() { function testMessages() {
// Enable the Classy theme.
\Drupal::service('theme_handler')->install(['classy']);
$this->config('system.theme')->set('default', 'classy')->save();
drupal_set_message('An error occurred', 'error'); drupal_set_message('An error occurred', 'error');
drupal_set_message('But then something nice happened'); drupal_set_message('But then something nice happened');
$messages = array( $messages = array(
......
...@@ -26,13 +26,7 @@ ...@@ -26,13 +26,7 @@
*/ */
#} #}
{% for type, messages in message_list %} {% for type, messages in message_list %}
{% <div class="{{ attributes.class }}" role="contentinfo" aria-label="{{ status_headings[type] }}">
set classes = [
'messages',
'messages--' ~ type,
]
%}
<div class="{{ attributes.addClass(classes).class }}" role="contentinfo" aria-label="{{ status_headings[type] }}">
{% if type == 'error' %} {% if type == 'error' %}
<div role="alert"> <div role="alert">
{% endif %} {% endif %}
...@@ -40,9 +34,9 @@ ...@@ -40,9 +34,9 @@
<h2 class="visually-hidden">{{ status_headings[type] }}</h2> <h2 class="visually-hidden">{{ status_headings[type] }}</h2>
{% endif %} {% endif %}
{% if messages|length > 1 %} {% if messages|length > 1 %}
<ul class="messages__list"> <ul>
{% for message in messages %} {% for message in messages %}
<li class="messages__item">{{ message }}</li> <li>{{ message }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
...@@ -52,6 +46,4 @@ ...@@ -52,6 +46,4 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
{# Remove type specific classes. #}
{{ attributes.removeClass(classes) }}
{% endfor %} {% endfor %}
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