Skip to content

Commit

Permalink
Improve template
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Jun 27, 2022
1 parent a81a3c8 commit aa99a5b
Showing 1 changed file with 20 additions and 31 deletions.
51 changes: 20 additions & 31 deletions src/Bridge/Symfony/Resources/views/Form/datepicker.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@ file that was distributed with this source code.
#}
{% block sonata_type_date_picker_widget_html %}
{% if datepicker_use_button %}
<div
class="input-group date"
id="dp_{{ id }}"
data-controller="datepicker"
data-datepicker-options-value="{{ datepicker_options|json_encode|escape('html_attr') }}"
>
{% endif %}
{% set attr = attr|merge({
'data-input': true
}) %}
{{ block('date_widget') }}
{% if datepicker_use_button %}
<div
class="input-group date"
data-controller="datepicker"
data-datepicker-options-value="{{ datepicker_options|json_encode|escape('html_attr') }}"
>
{{ block('date_widget') }}

{% if datepicker_use_button %}
<span class="input-group-addon" data-toggle><span class="fa fa-calendar"></span></span>
</div>
{% endif %}
{% endif %}
</div>
{% endblock sonata_type_date_picker_widget_html %}

{% block sonata_type_date_picker_widget %}
Expand All @@ -40,25 +35,19 @@ file that was distributed with this source code.
{% endblock sonata_type_date_picker_widget %}

{% block sonata_type_datetime_picker_widget_html %}
{% if datepicker_use_button %}
<div
class="input-group date
{#% if not datepicker_options['pickDate'] %}timepicker{% endif %#}"
id="dtp_{{ id }}"
data-controller="datepicker"
data-datepicker-options-value="{{ datepicker_options|json_encode|escape('html_attr') }}"
>
{% endif %}
{% set attr = attr|merge({
'data-input': true
}) %}
{{ block('datetime_widget') }}
{% if datepicker_use_button %}
<div
class="input-group date {#% if not datepicker_options['pickDate'] %}timepicker{% endif %#}"
data-controller="datepicker"
data-datepicker-options-value="{{ datepicker_options|json_encode|escape('html_attr') }}"
>
{{ block('datetime_widget') }}

{% if datepicker_use_button %}
<span class="input-group-addon" data-toggle>
<span class="fas {#% if datepicker_options['pickDate'] %}fa-calendar{% else %}fa-clock{% endif %#}fa-calendar"></span>
</span>
</div>
{% endif %}
{% endif %}
</div>
{% endblock sonata_type_datetime_picker_widget_html %}

{% block sonata_type_datetime_picker_widget %}
Expand Down

0 comments on commit aa99a5b

Please sign in to comment.