mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-06 02:59:29 +00:00
27 lines
1.2 KiB
Twig
27 lines
1.2 KiB
Twig
|
|
{% extends 'bootstrap_5_layout.html.twig' %}
|
||
|
|
|
||
|
|
|
||
|
|
{%- block choice_widget_collapsed -%}
|
||
|
|
{# Only add the BS5 form-select class if we dont use bootstrap-selectpicker #}
|
||
|
|
{# {% if attr["data-controller"] is defined and attr["data-controller"] not in ["elements--selectpicker"] %}
|
||
|
|
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-select')|trim}) -%}
|
||
|
|
{% else %}
|
||
|
|
{# If it is an selectpicker add form-control class to fill whole width
|
||
|
|
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%}
|
||
|
|
{% endif %}
|
||
|
|
#}
|
||
|
|
|
||
|
|
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-select')|trim}) -%}
|
||
|
|
|
||
|
|
{# If no data-controller was explictly defined add data-controller=elements--select #}
|
||
|
|
{% if attr["data-controller"] is not defined %}
|
||
|
|
{%- set attr = attr|merge({"data-controller": "elements--select"}) -%}
|
||
|
|
|
||
|
|
{% if attr["data-empty-message"] is not defined %}
|
||
|
|
{%- set attr = attr|merge({"data-empty-message": ("selectpicker.nothing_selected"|trans)}) -%}
|
||
|
|
{% endif %}
|
||
|
|
{% endif %}
|
||
|
|
|
||
|
|
{{- block("choice_widget_collapsed", "bootstrap_base_layout.html.twig") -}}
|
||
|
|
{%- endblock choice_widget_collapsed -%}
|