Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% if allow_add %}
{% apply spaceless %}
<a class="btn btn-primary new">
<i class="fa fa-plus"></i>
{{- ' ' ~ 's2a_bootstrap_collection.add'|trans({}, 'AdmingeneratorFormExtensions') -}}
</a>
{% endapply %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{% if allow_delete %}
{% apply spaceless %}
<a class="btn btn-danger batch-delete">
<i class="fa fa-trash-can fa-regular"></i>
{{- ' ' ~ 's2a_bootstrap_collection.delete'|trans({}, 'AdmingeneratorFormExtensions') -}}
</a>
<label class="btn btn-link btn-toggle input-append">
<input type="checkbox" name="toggle">
</label>
{% endapply %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% if allow_delete %}
{% apply spaceless %}
<div class="collection-item-actions {{ id ~ '_actions' }}">
<label class="btn btn-link btn-toggle input-append">
<input type="checkbox" name="delete" value="1">
Expand All @@ -8,5 +7,4 @@
<i class="fa fa-times"></i>
</a>
</div>
{% endapply %}
{% endif %}
14 changes: 6 additions & 8 deletions Resources/views/Form/SingleUpload/macros.html.twig
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
{% macro bytesToSize(bytes) %}
{% apply spaceless %}
{% set kilobyte = 1000 %}
{% set megabyte = kilobyte * 1000 %}
{% set gigabyte = megabyte * 1000 %}
{% set terabyte = gigabyte * 1000 %}
{% set petabyte = terabyte * 1000 %}

{% if bytes < kilobyte %}
{{ bytes ~ ' B' }}
{{- bytes ~ ' B' -}}
{% elseif bytes < megabyte %}
{{ (bytes / kilobyte)|number_format(2, '.') ~ ' KB' }}
{{- (bytes / kilobyte)|number_format(2, '.') ~ ' KB' -}}
{% elseif bytes < gigabyte %}
{{ (bytes / megabyte)|number_format(2, '.') ~ ' MB' }}
{{- (bytes / megabyte)|number_format(2, '.') ~ ' MB' -}}
{% elseif bytes < terabyte %}
{{ (bytes / gigabyte)|number_format(2, '.') ~ ' GB' }}
{{- (bytes / gigabyte)|number_format(2, '.') ~ ' GB' -}}
{% elseif bytes < petabyte %}
{{ (bytes / terabyte)|number_format(2, '.') ~ ' TB' }}
{{- (bytes / terabyte)|number_format(2, '.') ~ ' TB' -}}
{% else %}
{{ (bytes / petabyte)|number_format(2, '.') ~ ' PB' }}
{{- (bytes / petabyte)|number_format(2, '.') ~ ' PB' -}}
{% endif %}
{% endapply %}
{% endmacro %}
16 changes: 4 additions & 12 deletions Resources/views/Form/form_css.html.twig
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{% block s2a_collection_fieldset_css %}
{% apply spaceless %}
{% include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" %}
{% endapply %}
{%- include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" -%}
{% endblock s2a_collection_fieldset_css %}

{% block s2a_collection_table_css %}
{% apply spaceless %}
{% include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" %}
{% endapply %}
{%- include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/stylesheet.html.twig" -%}
{% endblock s2a_collection_table_css %}

{% block s2a_collection_upload_css %}
{% apply spaceless %}
{% include "@AdmingeneratorFormExtensions/Form/UploadCollection/stylesheet.html.twig" %}
{% endapply %}
{%- include "@AdmingeneratorFormExtensions/Form/UploadCollection/stylesheet.html.twig" -%}
{% endblock s2a_collection_upload_css %}

{% block s2a_google_map_css %}
{% apply spaceless %}
{% include "@AdmingeneratorFormExtensions/Form/GoogleMap/stylesheet.html.twig" %}
{% endapply %}
{%- include "@AdmingeneratorFormExtensions/Form/GoogleMap/stylesheet.html.twig" -%}
{% endblock s2a_google_map_css %}

42 changes: 7 additions & 35 deletions Resources/views/Form/form_html.html.twig
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
{% block form_row %}
{% apply spaceless %}
<div class="control-group control-group-{{ name }}{% if errors|length > 0 %} has-error{% endif %}">
{{ form_label(form) }}
{{ form_widget(form) }}
{{ form_errors(form) }}
{{ block('form_help') }}
</div>
{% endapply %}
{% endblock form_row %}

{% block form_help %}
{% apply spaceless %}
{% if help %}
{%- if help -%}
<span class="help-block">
<p class="muted">{{ help|trans({}, translation_domain) }}</p>
</span>
{% endif %}
{% endapply %}
{%- endif -%}
{% endblock form_help %}

{% block s2a_collection_fieldset_widget %}
{% apply spaceless %}
{% if prototype is defined %}
{%- if prototype is defined %}
{% set item = prototype %}
{% set attr = attr|merge({'data-prototype': block('s2a_collection_fieldset_item') }) %}
{% endif %}
{% set attr = attr|merge({'class': 'control-group' }) %}
{% set attr = attr|merge({'class': 'control-group' }) -%}
<div {{ block('widget_container_attributes') }}>
<div id="{{ id ~ '_toolbar' }}" class="btn-toolbar form-actions form-actions-condensed">
{%- include "@AdmingeneratorFormExtensions/Form/BootstrapCollection/collection_add.html.twig" -%}
Expand All @@ -39,7 +34,6 @@
<div class="clearfix"></div>
{{ form_rest(form) }}
</div>
{% endapply %}
{% endblock s2a_collection_fieldset_widget %}

{% block s2a_collection_fieldset_item %}
Expand All @@ -54,7 +48,6 @@
{% endblock s2a_collection_fieldset_item %}

{% block s2a_collection_table_widget %}
{% apply spaceless %}
{% if prototype is defined %}
{% set item = prototype %}
{% set attr = attr|merge({'data-prototype': block('s2a_collection_table_item') }) %}
Expand All @@ -75,7 +68,6 @@
{% endfor %}
</tbody>
</table>
{% endapply %}
{% endblock s2a_collection_table_widget %}

{% block s2a_collection_table_item %}
Expand Down Expand Up @@ -119,7 +111,6 @@
{% endblock s2a_collection_table_item %}

{% block s2a_upload_collection_widget %}
{% apply spaceless %}
{% set original_full_name = full_name %}
{% set full_name = full_name ~ '[uploads][]' %}
<div id="{{ id ~ '_widget_container' }}">
Expand Down Expand Up @@ -164,11 +155,9 @@
{% include "@AdmingeneratorFormExtensions/Form/UploadCollection/template_upload.html.twig" %}
{% endif %}
</div>
{% endapply %}
{% endblock s2a_upload_collection_widget %}

{% block s2a_double_list_prototype %}
{% apply spaceless %}
<div id="{{ id ~ '_widget_container' }}" class="double-list">
<div class="col-xs-12 col-sm-5 list-unselected dropdown open">
{% include "@AdmingeneratorFormExtensions/Form/DoubleList/unselected_list.html.twig" %}
Expand All @@ -181,7 +170,6 @@
</div>
{{ block('choice_widget') }}
</div>
{% endapply %}
{% endblock s2a_double_list_prototype %}

{% block s2a_double_list_document_widget %}
Expand All @@ -197,7 +185,6 @@
{% endblock s2a_double_list_model_widget %}

{% block s2a_single_upload_widget %}
{% apply spaceless %}
<div id="{{ id ~ '_widget_container' }}" class="single-upload">
<div class="btn-toolbar form-actions form-actions-condensed singleupload-buttonbar">
<span class="btn btn-success fileinput">
Expand All @@ -210,7 +197,6 @@
{% include "@AdmingeneratorFormExtensions/Form/SingleUpload/preview.html.twig" %}
</div>
</div>
{% endapply %}
{% endblock s2a_single_upload_widget %}

{% block s2a_select2_choice_widget %}
Expand Down Expand Up @@ -246,7 +232,6 @@
{% endblock %}

{% block s2a_datetime_family_prototype %}
{% apply spaceless %}
<input id="{{ id }}" name="{{ full_name }}" type="hidden" value="{{ value }}" />
<div id="{{ id ~ '_widget' }}" class="s2a-date" {% if width is defined and width is not null %}style="width: {{ width }}px"{% endif %}>
<input {{ block('s2a_datetime_family_widget_attributes') }} />
Expand All @@ -257,7 +242,6 @@
<i class="{{ widgetIcon }}"></i>
</a>
</div>
{% endapply %}
{% endblock s2a_datetime_family_prototype %}

{% block s2a_datetime_family_widget_attributes -%}
Expand All @@ -280,28 +264,21 @@
{%- endblock s2a_datetime_family_widget_attributes %}

{% block s2a_datetime_picker_widget %}
{% apply spaceless %}
{% set widgetIcon = 'fa-regular fa-calendar-days' %}
{{ block('s2a_datetime_family_prototype') }}
{% endapply %}
{% endblock s2a_datetime_picker_widget %}

{% block s2a_date_picker_widget %}
{% apply spaceless %}
{% set widgetIcon = 'fa-regular fa-calendar-days' %}
{{ block('s2a_datetime_family_prototype') }}
{% endapply %}
{% endblock s2a_date_picker_widget %}

{% block s2a_time_picker_widget %}
{% apply spaceless %}
{% set widgetIcon = 'fa-regular fa-clock' %}
{{ block('s2a_datetime_family_prototype') }}
{% endapply %}
{% endblock s2a_time_picker_widget %}

{% block s2a_google_map_widget %}
{% apply spaceless %}
<div {{ block('widget_container_attributes') }}>
<div id="{{ id }}_container">
<div class="input-group">
Expand All @@ -323,23 +300,18 @@
{{ form_row(child) }}
{% endfor %}
</div>
{% endapply %}
{% endblock s2a_google_map_widget %}

{% block s2a_money_widget %}
{% apply spaceless %}
<div class="input-group">
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}': '' })|raw }}</span>
{{ block('form_widget_simple')|raw }}
</div>
{% endapply %}
{% endblock %}

{% block s2a_daterange_picker_widget %}
{% apply spaceless %}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-calendar-days fa-regular fa-fw"></i></span>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-calendar-days fa-regular fa-fw"></i></span>
{{ block('form_widget_simple') }}
</div>
{% endapply %}
</div>
{% endblock s2a_daterange_picker_widget %}
Loading