mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-06 17:39:35 +00:00
Made the form more beautiful and space saving
This commit is contained in:
parent
1ec34a2bb0
commit
88d34447aa
3 changed files with 74 additions and 25 deletions
26
templates/form/vertical_bootstrap_layout.html.twig
Normal file
26
templates/form/vertical_bootstrap_layout.html.twig
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{% 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 -%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue