Commit 94201c5d authored by alexpott's avatar alexpott

Issue #2329779 by lauriii | davidhernandez: Move user classes from preprocess to templates.

parent f98fd49d
......@@ -23,7 +23,7 @@
* @ingroup themeable
*/
#}
<article{{ attributes }}>
<article{{ attributes.addClass('profile') }}>
{% if content %}
{{- content -}}
{% endif %}
......
......@@ -19,7 +19,7 @@
*/
#}
{% if link_path -%}
<a{{ attributes }}>{{ name }}{{ extra }}</a>
<a{{ attributes.addClass('username') }}>{{ name }}{{ extra }}</a>
{%- else -%}
<span{{ attributes }}>{{ name }}{{ extra }}</span>
{%- endif -%}
......@@ -625,11 +625,7 @@ function template_preprocess_username(&$variables) {
$variables['link_path'] = $account->homepage;
$variables['homepage'] = $account->homepage;
}
// Set a default class.
$variables['attributes']['class'] = array('username');
// We have a link path, so we should generate a link using url().
// Additional classes may be added as array elements like
// $variables['attributes']['class'][] = 'myclass';
if (isset($variables['link_path'])) {
$variables['attributes']['href'] = url($variables['link_path'], $variables['link_options']);
}
......
......@@ -29,9 +29,6 @@ function template_preprocess_user(&$variables) {
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
// Set up attributes.
$variables['attributes']['class'][] = 'profile';
}
/**
......
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