Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 1510a63c authored by escuriola's avatar escuriola
Browse files

OEL-1160: Refactor. Remove attributes object.

parent f7e58cc3
No related branches found
No related tags found
1 merge request!71OEL-1160: Header refactor.
......@@ -18,37 +18,19 @@
{% apply spaceless %}
{# Project name. #}
{% if site_logo is not empty or site_name is not empty %}
{% set project_classes = 'bcl-header__project' %}
{% if light is not empty %}
{% set project_classes = project_classes ~ ' light' %}
{% endif %}
<div {{ create_attribute().addClass(project_classes) }}>
<div class="bcl-header__project{{ light is not empty ? ' light' }}">
<div class="container">
{% if site_logo is not empty and bcl_component_library != 'neutral' %}
{% set img_classes = ['d-none','d-lg-inline-block', 'text-decoration-none', 'site-logo'] %}
<a {{ create_attribute().addClass(img_classes).setAttribute('rel', 'Home') }} href="{{ path('<front>') }}">
<img {{ site_logo_img_attr.setAttribute('alt', 'Home'|t) }} src="{{ site_logo }}"/>
<a class="d-none d-lg-inline-block text-decoration-none site-logo" href="{{ path('<front>') }}">
<img alt="{{ 'Home'|t }}" src="{{ site_logo }}"/>
</a>
{% endif %}
{% if site_name is not empty %}
{% set name_classes = [
'text-decoration-none',
'align-bottom',
'bcl-header__site-name',
'mw-100',
] %}
{% set _site_name %}
<a {{ create_attribute().addClass(name_classes).setAttribute('rel', 'Home') }}
href="{{ path('<front>') }}">
<div class="bcl-header__site-name site-name{{ bcl_component_library == 'neutral' ? ' h5 d-inline-block d-lg-none' }}">
<a class="text-decoration-none align-bottom bcl-header__site-name mw-100"
href="{{ path('<front>') }}">
{{ site_name }}
</a>
{% endset %}
{% set _site_name_classes = ['bcl-header__site-name', 'site-name'] %}
{% if bcl_component_library == 'neutral' %}
{% set _site_name_classes = _site_name_classes|merge(['h5', 'd-inline-block', 'd-lg-none']) %}
{% endif %}
<div {{ create_attribute().addClass(_site_name_classes) }}>
{{ _site_name }}
</div>
{% endif %}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment