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

Skip to content
Snippets Groups Projects
Commit 08744d66 authored by escuriola's avatar escuriola
Browse files

OEL-719: Adapt offcanvas and buttons to BCL 0.11.0.

parent 20dcdf60
No related branches found
No related tags found
1 merge request!42OEL-719: Adapt search changes.
......@@ -72,10 +72,15 @@ function oe_whitelabel_preprocess_links__language_block(&$variables) {
*/
function oe_whitelabel_form_facets_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (isset($form['actions'])) {
$form['actions']['#attributes']['class'][] = 'mt-4';
$action_classes = ['mt-4', 'd-grid', 'gap-4', 'd-md-block'];
foreach ($action_classes as $action_class) {
if (!isset($action_class, $form['actions']['#attributes']['class']) || !in_array($action_class, $form['actions']['#attributes']['class'], TRUE)) {
$form['actions']['#attributes']['class'][] = $action_class;
}
}
}
if (isset($form['actions']['submit'])) {
$submit_classes = ['me-2', 'btn', 'btn-primary'];
$submit_classes = ['me-md-3', 'btn', 'btn-primary', 'btn-md'];
foreach ($submit_classes as $submit_class) {
if (!isset($submit_class, $form['actions']['submit']['#attributes']['class']) || !in_array($submit_class, $form['actions']['submit']['#attributes']['class'], TRUE)) {
$form['actions']['submit']['#attributes']['class'][] = $submit_class;
......@@ -83,7 +88,7 @@ function oe_whitelabel_form_facets_form_alter(&$form, FormStateInterface $form_s
}
}
if (isset($form['actions']['reset'])) {
$reset_classes = ['btn', 'btn-secondary'];
$reset_classes = ['btn', 'btn-light', 'btn-md'];
foreach ($reset_classes as $reset_class) {
if (!isset($form['actions']['reset']['#attributes']['class']) || !in_array($reset_class, $form['actions']['reset']['#attributes']['class'], TRUE)) {
$form['actions']['reset']['#attributes']['class'][] = $reset_class;
......
......@@ -37,7 +37,7 @@
'url': content.actions['reset']['#url'].toString(),
'style': 'secondary',
'attributes': extra_attributes.addClass('ms-2')
})
})
%}
{% set actions = content.actions %}
{% set actions = actions|merge({('reset'): reset}) %}
......@@ -49,7 +49,7 @@
'label': label,
'heading': 4,
'extra_classes': "mb-lg-4",
},
},
'attributes': attributes.addClass('bcl-offcanvas'),
'offcanvas_id': 'bcl-offcanvas',
'body': content,
......@@ -61,6 +61,9 @@
'extra_classes_header': "p-lg-0",
'with_trigger': true,
'toggle_button_label': label,
'icon_name': 'sliders'
'icon_position': 'before',
'icon': {
'name': 'filter',
},
}) }}
{% endblock %}
......@@ -16,8 +16,9 @@
* @ingroup themeable
*/
#}
{% set attributes = create_attribute({'class': ['me-2']}) %}
{% set attributes = create_attribute({'class': ['me-2', 'fs-6']}) %}
{{ pattern('badge', {
'background': 'light',
'label': value,
'assistive_text': assistive_text,
'dismissible': true,
......
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