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

Skip to content
Snippets Groups Projects
Commit 0c734e5c authored by escuriola's avatar escuriola
Browse files

OEL-1367: Add button pattern from template instead from drupal form.

parent f6b607f5
No related branches found
No related tags found
2 merge requests!157OEL-1668: Update epic list pages.,!136OEL-1367: New Look & Feel for search form in search page and remove theming from block config form.
......@@ -6,34 +6,31 @@
* @see ./core/modules/system/templates/form.html.twig
*/
#}
{% set submit = element.submit|merge({
'#type': 'pattern',
'#variant': 'primary',
'#icon': 'search',
'#id': 'button',
'#fields': {
'label': 'Search'|t,
'icon': 'search',
'settings': {
'type': 'submit',
'icon_position': 'before',
},
'attributes': {
'id': 'submit',
'class': [
'bcl-search-form__submit',
'px-3',
],
},
{% set submit_button = pattern('button', {
'variant': 'primary',
'icon': 'search',
'label': 'Search'|t
'type': 'submit',
'attributes': {
'id': 'submit',
'class': [
'border-start-0',
'rounded-0',
'rounded-end',
'px-3',
],
},
}) %}
})%}
{% set element = element|merge({submit}) %}
{% set submit = element.submit|merge({
'#markup': submit_button|render,
})
%}
<div class="bg-lighter py-4 py-lg-3">
<div class="container">
<div class="row">
<div class="col-12 col-lg-6 offset-lg-3">
<form action="search" {{ attributes.addClass('bcl-search-form', 'submittable') }}>
<form {{ attributes.addClass('bcl-search-form', 'submittable') }}>
<div class="bcl-search-form__group">
{{ element.search_input }}
{{ element.submit }}
......
......@@ -6,31 +6,30 @@
* @see ./core/modules/system/templates/form.html.twig
*/
#}
{% set submit = element.submit|merge({
'#type': 'pattern',
'#variant': 'light',
'#icon': 'search',
'#id': 'button',
'#fields': {
'icon': 'search',
'settings': {
'type': 'submit',
},
'attributes': {
'id': 'submit',
'class': [
'border-start-0',
'rounded-0',
'rounded-end',
'px-3',
],
},
{% set submit_button = pattern('button', {
'variant': 'light',
'icon': 'search',
'type': 'submit',
'attributes': {
'id': 'submit',
'class': [
'border-start-0',
'rounded-0',
'rounded-end',
'px-3',
],
},
})%}
{% set submit = element.submit|merge({
'#markup': submit_button|render,
})
%}
{% set element = element|merge({submit}) %}
<form action="search" {{ attributes.addClass('d-flex', 'mt-3', 'mt-lg-0') }}>
<form {{ attributes.addClass('d-flex', 'mt-3', 'mt-lg-0') }}>
{{ element.search_input }}
{{ element.submit }}
{{ element.form_build_id }}
......
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