revert to classical bootstrap form layout (#4632)
This commit is contained in:
@@ -126,15 +126,14 @@
|
|||||||
{% set format = locale_format('date') %}
|
{% set format = locale_format('date') %}
|
||||||
{% set jsFormat = format|js_format %}
|
{% set jsFormat = format|js_format %}
|
||||||
{% set attr = attr|merge({'pattern': format|pattern, 'autocomplete': 'off', 'data-datepicker': 'on', 'data-format': jsFormat, 'placeholder': jsFormat}) -%}
|
{% set attr = attr|merge({'pattern': format|pattern, 'autocomplete': 'off', 'data-datepicker': 'on', 'data-format': jsFormat, 'placeholder': jsFormat}) -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
<a href="#" data-form-widget="date-now" data-format="{{ jsFormat }}" data-target="{{ id }}">{{ icon('calendar') }}</a>
|
<a href="#" data-form-widget="date-now" data-format="{{ jsFormat }}" data-target="{{ id }}">{{ icon('calendar') }}</a>
|
||||||
</span>
|
</div>
|
||||||
{{- block('form_widget_simple') -}}
|
{{- block('form_widget_simple') -}}
|
||||||
<div class="form-control"></div>
|
|
||||||
{% if not required %}
|
{% if not required %}
|
||||||
<span class="input-group-text">
|
<span class="input-group-text">
|
||||||
<a href="#" class="link-secondary fs-5" onclick="document.getElementById('{{ id }}').value = ''">
|
<a href="javascript: void(0)" class="link-secondary fs-5" onclick="document.getElementById('{{ id }}').value = ''">
|
||||||
{{ icon('cancel') }}
|
{{ icon('cancel') }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
@@ -147,10 +146,10 @@
|
|||||||
{%- set format = locale_format('time') -%}
|
{%- set format = locale_format('time') -%}
|
||||||
{%- set jsFormat = format|js_format -%}
|
{%- set jsFormat = format|js_format -%}
|
||||||
{%- set attr = attr|merge({'pattern': format|pattern, 'autocomplete': 'off', 'data-timepicker': 'on', 'data-format': jsFormat, 'placeholder': jsFormat}) -%}
|
{%- set attr = attr|merge({'pattern': format|pattern, 'autocomplete': 'off', 'data-timepicker': 'on', 'data-format': jsFormat, 'placeholder': jsFormat}) -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
<a href="#" data-form-widget="date-now" data-format="{{ jsFormat }}" data-target="{{ id }}">{{ icon('calendar') }}</a>
|
<a href="#" data-form-widget="date-now" data-format="{{ jsFormat }}" data-target="{{ id }}">{{ icon('calendar') }}</a>
|
||||||
</span>
|
</div>
|
||||||
{{ block('form_widget_simple') }}
|
{{ block('form_widget_simple') }}
|
||||||
{% set time_presets = form_time_presets(app.user.timezone) %}
|
{% set time_presets = form_time_presets(app.user.timezone) %}
|
||||||
{% if time_presets|length > 0 and form.vars.disabled is same as (false) %}
|
{% if time_presets|length > 0 and form.vars.disabled is same as (false) %}
|
||||||
@@ -176,27 +175,27 @@
|
|||||||
{% block daterange_widget %}
|
{% block daterange_widget %}
|
||||||
{% set format = locale_format('date')|js_format %}
|
{% set format = locale_format('date')|js_format %}
|
||||||
{% set attr = attr|merge({'data-daterangepicker': 'on', 'autocomplete': 'off', 'data-format': format, 'placeholder': format ~ attr['data-separator'] ~ format}) -%}
|
{% set attr = attr|merge({'data-daterangepicker': 'on', 'autocomplete': 'off', 'data-format': format, 'placeholder': format ~ attr['data-separator'] ~ format}) -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
|
{{ block('form_widget_simple') }}
|
||||||
{% if ranges is defined %}
|
{% if ranges is defined %}
|
||||||
<button type="button" class="btn dropdown-toggle btn-duration-preset" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
|
<button type="button" class="input-group-text dropdown-toggle btn-duration-preset" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
|
||||||
<div class="dropdown-menu dropdown-menu-start pre-scrollable">
|
<div class="dropdown-menu dropdown-menu-start pre-scrollable">
|
||||||
{% for title, range in ranges %}
|
{% for title, range in ranges %}
|
||||||
<a class="dropdown-item" href="#" data-form-widget="copy-data" data-target="#{{ form.vars.id }}" data-value="{% if range[0] is not null %}{{ range[0]|format_date('short', rangeFormat) }}{{ attr['data-separator'] }}{{ range[1]|format_date('short', rangeFormat) }}{% endif %}" data-event="change keyup">{{ title|trans({}, 'daterangepicker') }}</a>
|
<a class="dropdown-item" href="#" data-form-widget="copy-data" data-target="#{{ form.vars.id }}" data-value="{% if range[0] is not null %}{{ range[0]|format_date('short', rangeFormat) }}{{ attr['data-separator'] }}{{ range[1]|format_date('short', rangeFormat) }}{% endif %}" data-event="change keyup">{{ title|trans({}, 'daterangepicker') }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ block('form_widget_simple') }}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock daterange_widget %}
|
{% endblock daterange_widget %}
|
||||||
|
|
||||||
{% block duration_widget %}
|
{% block duration_widget %}
|
||||||
<div class="duration-widget">
|
<div class="duration-widget">
|
||||||
{% if (form.vars.duration_presets is defined and form.vars.duration_presets is not empty) and (form.vars.disabled is same as (false)) %}
|
{% if (form.vars.duration_presets is defined and form.vars.duration_presets is not empty) and (form.vars.disabled is same as (false)) %}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
{% if form.vars.icon is defined and form.vars.icon is not null %}
|
{% if form.vars.icon is defined and form.vars.icon is not null %}
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
{{ icon(form.vars.icon) }}
|
{{ icon(form.vars.icon) }}
|
||||||
</span>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ block('form_widget_simple') }}
|
{{ block('form_widget_simple') }}
|
||||||
{% if form.vars.toggle is defined and form.vars.toggle %}
|
{% if form.vars.toggle is defined and form.vars.toggle %}
|
||||||
@@ -221,10 +220,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if icon is defined and icon is not empty %}
|
{% if icon is defined and icon is not empty %}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
<i class="{{ icon|icon(false, icon) }}"></i>
|
<i class="{{ icon|icon(false, icon) }}"></i>
|
||||||
</span>
|
</div>
|
||||||
{{ block('form_widget_simple') }}
|
{{ block('form_widget_simple') }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -251,10 +250,10 @@
|
|||||||
|
|
||||||
{% block text_widget -%}
|
{% block text_widget -%}
|
||||||
{% if icon is not empty %}
|
{% if icon is not empty %}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
<i class="{{ icon|icon(false, icon) }}"></i>
|
<i class="{{ icon|icon(false, icon) }}"></i>
|
||||||
</span>
|
</div>
|
||||||
{{ block('form_widget_simple') }}
|
{{ block('form_widget_simple') }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -263,20 +262,20 @@
|
|||||||
{%- endblock text_widget %}
|
{%- endblock text_widget %}
|
||||||
|
|
||||||
{% block mail_widget -%}
|
{% block mail_widget -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
{{ icon('mail') }}
|
{{ icon('mail') }}
|
||||||
</span>
|
</div>
|
||||||
{{ block('email_widget') }}
|
{{ block('email_widget') }}
|
||||||
</div>
|
</div>
|
||||||
{%- endblock mail_widget %}
|
{%- endblock mail_widget %}
|
||||||
|
|
||||||
{# user password fields, search for "secret" block_prefix #}
|
{# user password fields, search for "secret" block_prefix #}
|
||||||
{% block secret_widget -%}
|
{% block secret_widget -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
{{ icon('password') }}
|
{{ icon('password') }}
|
||||||
</span>
|
</div>
|
||||||
{{ block('password_widget') }}
|
{{ block('password_widget') }}
|
||||||
</div>
|
</div>
|
||||||
{%- endblock secret_widget %}
|
{%- endblock secret_widget %}
|
||||||
@@ -370,10 +369,10 @@
|
|||||||
|
|
||||||
{# customer phone/fax, search for "phone" block_prefix #}
|
{# customer phone/fax, search for "phone" block_prefix #}
|
||||||
{% block phone_widget -%}
|
{% block phone_widget -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
<span class="input-group-text">
|
<div class="input-group-text">
|
||||||
{{ icon(attr.icon ?? 'phone') }}
|
{{ icon(attr.icon ?? 'phone') }}
|
||||||
</span>
|
</div>
|
||||||
{{ block('tel_widget') }}
|
{{ block('tel_widget') }}
|
||||||
</div>
|
</div>
|
||||||
{%- endblock phone_widget %}
|
{%- endblock phone_widget %}
|
||||||
@@ -382,13 +381,13 @@
|
|||||||
{%- set prepend = not (money_pattern starts with '{{') -%}
|
{%- set prepend = not (money_pattern starts with '{{') -%}
|
||||||
{%- set append = not (money_pattern ends with '}}') -%}
|
{%- set append = not (money_pattern ends with '}}') -%}
|
||||||
{%- if prepend or append -%}
|
{%- if prepend or append -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
{%- if prepend -%}
|
{%- if prepend -%}
|
||||||
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
|
<div class="input-group-text">{{ money_pattern|form_encode_currency }}</div>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{{- block('form_widget_simple') -}}
|
{{- block('form_widget_simple') -}}
|
||||||
{%- if append -%}
|
{%- if append -%}
|
||||||
<span class="input-group-text">{{ money_pattern|form_encode_currency }}</span>
|
<div class="input-group-text">{{ money_pattern|form_encode_currency }}</div>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</div>
|
</div>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
@@ -398,9 +397,9 @@
|
|||||||
|
|
||||||
{# customer homepage, search for "homepage" block_prefix #}
|
{# customer homepage, search for "homepage" block_prefix #}
|
||||||
{% block homepage_widget -%}
|
{% block homepage_widget -%}
|
||||||
<div class="input-group input-group-flat">
|
<div class="input-group">
|
||||||
{% if '://' not in value %}
|
{% if '://' not in value %}
|
||||||
<span class="input-group-text">https://</span>
|
<div class="input-group-text">https://</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ block('url_widget') }}
|
{{ block('url_widget') }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user