File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
templates/bootstrap4/admin Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 119
119
{% set direct_error = h.is_field_error(field.errors) %}
120
120
{% set prepend = kwargs.pop('prepend', None) %}
121
121
{% set append = kwargs.pop('append', None) %}
122
- < div class ="form-group {{ kwargs.get('column_class', '') }} ">
123
- < label for ="{{ field.id }} " class ="col-form-label {% if field.widget.input_type == 'checkbox' %}d-block mb-0{% endif %} "> {{ field.label.text }}
122
+ < div class ="form-group {% if theme.horizontal %}row {% endif %}{ { kwargs.get('column_class', '') }} ">
123
+ < label for ="{{ field.id }} " class ="col-form-label {% if theme.horizontal %}col-sm-2 {% endif %}{% if field.widget.input_type == 'checkbox' %}d-block mb-0{% endif %} "> {{ field.label.text }}
124
124
{% if h.is_required_form_field(field) %}
125
125
< strong class ="text-danger "> *</ strong >
126
126
{%- else -%}
127
127
128
128
{%- endif %}
129
129
</ label >
130
- {% if prepend or append %}
131
- < div class ="input-group ">
130
+ {% if prepend or append or theme.horizontal %}
131
+ < div class ="{% if prepend or append %} input-group {% endif %}{% if theme.horizontal %}col-sm-10{% endif %} ">
132
132
{%- if prepend -%}
133
133
< div class ="input-group-prepend ">
134
134
{{ prepend }}
162
162
{{ field.description|safe }}
163
163
</ small >
164
164
{% endif %}
165
- {% if prepend or append %}
165
+ {% if prepend or append or theme.horizontal %}
166
166
</ div >
167
167
{% endif %}
168
168
{% if caller %}
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class BootstrapTheme(Theme):
15
15
base_template : str = 'admin/base.html'
16
16
swatch : str = 'default'
17
17
fluid : bool = False
18
+ horizontal : bool = False
18
19
19
20
20
21
Bootstrap4Theme = partial (BootstrapTheme , folder = 'bootstrap4' )
You can’t perform that action at this time.
0 commit comments