Skip to content
Snippets Groups Projects
Commit dbf50d31 authored by Pierre Dureau's avatar Pierre Dureau
Browse files

Run vincentlanglet/twig-cs-fixer

parent 66013a2d
No related branches found
No related tags found
No related merge requests found
Showing
with 41 additions and 50 deletions
......@@ -26,4 +26,3 @@
{% endfor %}
</div>
</div>
......@@ -11,6 +11,6 @@
#}
{% if breadcrumb %}
{{ pattern('breadcrumbs', {
'items': breadcrumb
items: breadcrumb
}) }}
{% endif %}
......@@ -18,8 +18,7 @@
#}
{% set variant = is_active ? 'active' : '' %}
{{ pattern('tab', {
'variant': variant,
'attributes': attributes,
'text': link
variant: variant,
attributes: attributes,
text: link
}) }}
......@@ -16,12 +16,12 @@
{% if primary %}
<h2 class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
{{ pattern('tab_bar', {
'tabs': primary
tabs: primary
}) }}
{% endif %}
{% if secondary %}
<h2 class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
{{ pattern('tab_bar', {
'tabs': secondary
tabs: secondary
}) }}
{% endif %}
......@@ -37,10 +37,10 @@
#}
{% if page.header_navigation or page.header_title or page.header_buttons %}
{{ pattern('top_app_bar', {
'attributes': create_attribute(),
'navigation': page.header_navigation,
'title': page.header_title,
'buttons': page.header_buttons
attributes: create_attribute(),
navigation: page.header_navigation,
title: page.header_title,
buttons: page.header_buttons
}) }}
{% endif %}
......
......@@ -33,8 +33,8 @@
*/
#}
{% if items.pages|length %}
{{ pattern("pagination", {
"total": "@current of @total"|t({"@current": current, "@total": items.pages|length}),
"controls": controls,
{{ pattern('pagination', {
total: '@current of @total'|t({'@current': current, '@total': items.pages|length}),
controls: controls,
}) }}
{% endif %}
......@@ -24,10 +24,10 @@
<table class="pattern-preview__fields mdc-data-table__table">
<thead>
<tr class="mdc-data-table__header-row">
<th class="mdc-data-table__header-cell">{{ "Name"|t }}</th>
<th class="mdc-data-table__header-cell">{{ "Label"|t }}</th>
<th class="mdc-data-table__header-cell">{{ "Type"|t }}</th>
<th class="mdc-data-table__header-cell">{{ "Description"|t }} / {{ "Options"|t }}</th>
<th class="mdc-data-table__header-cell">{{ 'Name'|t }}</th>
<th class="mdc-data-table__header-cell">{{ 'Label'|t }}</th>
<th class="mdc-data-table__header-cell">{{ 'Type'|t }}</th>
<th class="mdc-data-table__header-cell">{{ 'Description'|t }} / {{ 'Options'|t }}</th>
</tr>
</thead>
<tbody class="mdc-data-table__content">
......
......@@ -9,7 +9,7 @@
<div class="mdc-layout-grid__inner">
<div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-12-phone mdc-layout-grid__cell--span-4">
<h2 class="hidden">{{ "Available patterns"|t }}</h2>
<h2 class="hidden">{{ 'Available patterns'|t }}</h2>
{# List of available patterns with anchor links. #}
<div class="mdc-list-group">
{% for group_name, group_patterns in patterns %}
......@@ -31,7 +31,7 @@
{% for group_patterns in patterns %}
{% for pattern_name, pattern in group_patterns %}
<div class="pattern-preview pattern-preview__{{ pattern.definition.id }}">
<h3 class="pattern-preview__label mdc-typography--headline3" id="{{ pattern.definition.id }}"><a href="{{ url('ui_patterns.patterns.single', {'name': pattern.definition.id}) }}">{{ pattern.label }}</a></h3>
<h3 class="pattern-preview__label mdc-typography--headline3" id="{{ pattern.definition.id }}"><a href="{{ url('ui_patterns.patterns.single', {name: pattern.definition.id}) }}">{{ pattern.label }}</a></h3>
{{ pattern.meta }}
{{ pattern.rendered }}
</div>
......@@ -42,6 +42,3 @@
</div>
{% endif %}
......@@ -10,7 +10,7 @@
<div class="mdc-layout-grid__inner">
<div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-2">
<h2 class="hidden">{{ "Available styles"|t }}</h2>
<h2 class="hidden">{{ 'Available styles'|t }}</h2>
{# List of available styles with anchor links. #}
{% for group_name, group_styles in styles %}
......@@ -70,6 +70,3 @@
</div>
</div>
{% endif %}
......@@ -12,7 +12,7 @@
* @ingroup themeable
*/
#}
{{ pattern("pagination", {
"previous": items.previous,
"next": items.next,
{{ pattern('pagination', {
previous: items.previous,
next: items.next,
}) }}
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('mdc-banner--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-banner--' ~ variant|lower|replace({_: '-'})) %}
{% endif %}
<div{{ attributes.addClass('mdc-banner').setAttribute('role', 'banner') }}>
......
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('mdc-breadcrumbs--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-breadcrumbs--' ~ variant|lower|replace({_: '-'})) %}
{% endif %}
<nav {{ attributes.addClass('mdc-breadcrumbs').setAttribute('aria-label', 'breadcrumb') }}>
......@@ -11,4 +11,3 @@
{% endif %}
{% endfor %}
</nav>
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('mdc-button--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-button--' ~ variant|lower|replace({_: '-'})) %}
{% endif %}
{% set icon_position = icon_position|default('left') %}
......@@ -7,22 +7,22 @@
{% if url or attributes.href %}
{% set url = url|default(attributes.href) %}
<a{{ attributes.addClass('mdc-button').setAttribute('href', url) }}>
{% if icon and icon_position == "left" %}
{% if icon and icon_position == 'left' %}
<i class="material-icons mdc-button__icon" aria-hidden="true">{{ icon }}</i>
{% endif %}
<span class="mdc-button__label">{{ label }}</span>
{% if icon and icon_position == "right" %}
{% if icon and icon_position == 'right' %}
<i class="material-icons mdc-button__icon" aria-hidden="true">{{ icon }}</i>
{% endif %}
</a>
{% else %}
<div{{ attributes.addClass('mdc-button') }}>
<div class="mdc-button__ripple"></div>
{% if icon and (not icon_position == "right") %}
{% if icon and (not icon_position == 'right') %}
<i class="material-icons mdc-button__icon" aria-hidden="true">{{ icon }}</i>
{% endif %}
<span class="mdc-button__label">{{ label }}</span>
{% if icon and (icon_position == "right") %}
{% if icon and (icon_position == 'right') %}
<i class="material-icons mdc-button__icon" aria-hidden="true">{{ icon }}</i>
{% endif %}
</div>
......
{% set attributes = attributes.setAttribute('style', "max-width: 600px") %}
{% set attributes = attributes.setAttribute('style', 'max-width: 600px') %}
{% extends 'pattern-card.html.twig' %}
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('mdc-card--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-card--' ~ variant|lower|replace({_: '-'})) %}
{% endif %}
<div{{ attributes.addClass('mdc-card') }}>
<div class="mdc-card__primary-action">
{{ header }}
{% if media_url %}
{% set media_attributes = create_attribute().addClass("mdc-card__media").setAttribute("style", "background-image: url(" ~ media_url ~ ")") %}
{% set media_attributes = media_scale ? media_attributes.addClass("mdc-card__media--" ~ media_scale) : media_attributes %}
{% set media_attributes = create_attribute().addClass('mdc-card__media').setAttribute('style', 'background-image: url(' ~ media_url ~ ')') %}
{% set media_attributes = media_scale ? media_attributes.addClass('mdc-card__media--' ~ media_scale) : media_attributes %}
<div{{ media_attributes }} >
{% if media_content %}
<div class="mdc-card__media-content">
......
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('mdc-chip--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-chip--' ~ variant|lower|replace({_: '-'})) %}
{% endif %}
<div{{ attributes.addClass('mdc-chip') }}>
......
{% if variant and variant|lower != 'default' %}
{% set variants = variant|split('__') %}
{% for variant in variants %}
{% set attributes = attributes.addClass('mdc-chip-set--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-chip-set--' ~ variant|lower|replace({_: '-'})) %}
{% endfor %}
{% endif %}
......
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('mdc-drawer--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-drawer--' ~ variant|lower|replace({_: '-'})) %}
{% endif %}
<aside{{ attributes.addClass('mdc-drawer') }}>
......
{% if variant and variant|lower != 'default' %}
{% set variants = variant|split('__')|map(v => v|lower|replace({(v): 'mdc-fab--' ~ v})|replace({'_': '-'})) %}
{% set variants = variant|split('__')|map(v => v|lower|replace({(v): 'mdc-fab--' ~ v})|replace({_: '-'})) %}
{% set attributes = attributes.addClass(variants) %}
{% endif %}
......
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('mdc-image-list--' ~ variant|lower|replace({'_': '-'})) %}
{% set attributes = attributes.addClass('mdc-image-list--' ~ variant|lower|replace({_: '-'})) %}
{% endif %}
{% set gutter_size = gutter_size|default(4) %}
{% set column_count = column_count|default(5) %}
{% if variant == "masonry" %}
{% if variant == 'masonry' %}
{% set masonry_style = 'column-count: ' ~ column_count ~ '; column-gap: ' ~ gutter_size ~ 'px;' %}
<ul{{ attributes.addClass('mdc-image-list').setAttribute('style', masonry_style) }}>
{% for image in images %}
......@@ -23,7 +23,7 @@
{% else %}
<ul{{ attributes.addClass('mdc-image-list') }}>
{% for image in images %}
<li class="mdc-image-list__item" style="width: calc(100% / {{ column_count }} - {{ gutter_size + 1/ column_count }}px); margin: {{ gutter_size/2 }}px;">
<li class="mdc-image-list__item" style="width: calc(100% / {{ column_count }} - {{ gutter_size + 1 / column_count }}px); margin: {{ gutter_size / 2 }}px;">
<div class="mdc-image-list__image-aspect-container">
{{ image|add_class('mdc-image-list__image') }}
</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