{# As long as Mautic 5 hasn't been released, and you make a change in one of the blocks below, also update the corresponding PHP template! #} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:button_attributes.html.php #} {% block button_attributes %} id="{{ id|escape }}" name="{{ full_name|escape }}" {{ disabled ? 'disabled="disabled"' : '' }} {% for k,v in attr|filter((v,k) => k not in ['icon']) %} {% if v in ['placeholder', 'title'] %} {{ '%s="%s" '|format(k|escape, v|trans({}, translation_domain)|escape)|raw }} {% elseif v is same as true %} {{ '%s="%s" '|format(k|escape, k|escape)|raw }} {% elseif v is not same as false %} {{ '%s="%s" '|format(k|escape, v|escape)|raw }} {% endif %} {% endfor %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:button_group_grow.html.php #} {% block button_group_row %} {% set hasErrors = form.vars.errors|length %} {% set feedbackClass = (app.request.getMethod() is same as 'POST' and hasErrors > 0) ? ' has-error' : '' %}
{{ form_label(form, label) }}
{{ form_widget(form) }} {{ form_errors(form) }}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:button_group_widget.html.php #} {% block button_group_widget %} {# apply attributes to radios #} {% set attr = form.vars.attr %}
{% for child in form %} {% set class = (child.vars.checked is not empty ? ' active' : '') ~ (child.vars.disabled is not empty or attr.readonly is not empty ? ' disabled' : '') %} {% endfor %}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:button_row.html.php #} {% block button_row %} {{ form_widget(form) }} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:button_widget.html.php #} {% block button_widget %} {% if not label %} {% set label = name|humanize %} {% endif %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:checkbox_row.html.php #} {% block checkbox_row %} {% set hasErrors = form.vars.errors|length %} {% set feedbackClass = hasErrors is not empty ? ' has-error' : '' %}
{{ form_errors(form) }}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:choice_attributes.html.php #} {% block choice_attributes %} {% for k,v in choice_attr %} {% if v is same as true %} {{ '%s="%s" '|format(k|escape, k|escape)|raw }} {% elseif v is not same as false %} {{ '%s="%s" '|format(k|escape, v|escape)|raw }} {% endif %} {% endfor %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:choice_row.html.php #} {% block choice_row %} {% set hasErrors = form.vars.errors|length %} {% set feedbackClass = hasErrors is not empty ? ' has-error' : '' %} {# apply attributes to radios #} {% set attr = form.vars.attr %}
{{ form_label(form, label) }}
{% if expanded and multiple %} {% for child in form.children %}
{% endfor %} {% else %} {{ form_widget(form) }} {% endif %} {{ form_errors(form) }}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:dynamiclist_entry_row.html.php #} {% block dynamiclist_entry_row %}
{{ block('form_widget_simple') }} {{ form_errors(form) }}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:dynamiclist_row.html.php #} {% block dynamiclist_row %} {% set list = form.children %} {% set hasErrors = form.vars.errors|length %} {% set feedbackClass = hasErrors is not empty ? ' has-error' : '' %} {% set datePrototype = list.vars.prototype is defined ? ('
' ~ form_widget(list.vars.prototype) ~ '
')|escape : '' %}
{{ form_label(form, label) }} {{ 'mautic.core.form.list.additem'|trans }} {% if isSortable %}
{% endif %} {% for item in list.children %} {{ block('sortablelist_entry_row') }} {% endfor %}
{{ form_errors(list) }} {% if isSortable %} {% endif %}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:form_buttons_row.html.php #} {% block form_buttons_row %}
{% if not form.parent and errors %}
{{ form_errors(form) }}
{% endif %} {{- block('form_rows') -}} {{ form_rest(form) }}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:form_errors.html.php #} {% block form_errors %} {% if errors|length > 0 %}
{% if errors|length > 1 %} {% else %} {{ (errors|first).getMessage()|escape }} {% endif %}
{% endif %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:form_label.html.php #} {% block form_label %} {% if label is not same as false %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class is defined ? label_attr.class : '')|trim ~ ' required'}) %} {% endif %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if not label %} {% set label = name|humanize %} {% endif %} {% set tooltip = form.vars.attr.tooltip is defined and form.vars.attr.tooltip is not empty ? form.vars.attr.tooltip|trans : false %} {% endif %} {% endblock form_label %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:form_row.html.php #} {% block form_row %} {% set hasErrors = form.vars.errors|length %} {% set feedbackClass = hasErrors > 0 ? ' has-error' : '' %}
{{ form_label(form, label) }} {{ form_widget(form) }} {{ form_errors(form) }}
{% endblock form_row %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:form_start.html.php #} {% block form_start %} {% set method = method|upper %} {% set form_method = method is same as 'GET' or method is same as 'POST' ? method : 'POST' %}
{% if form_method is not same as method %} {% endif %} {% if form.vars.errors|length > 0 %}
{{ form_errors(form) }}
{% endif %} {% endblock form_start %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:form_widget_compound.html.php #} {% block form_widget_compound %}
{% if not form.parent and errors %}
{{ form_errors(form) }}
{% endif %} {{ block('form_rows') }} {{ form_rest(form) }}
{% endblock form_widget_compound %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:form_widget_simple.html.php #} {% block form_widget_simple %} {% set preaddonAttr = attr.preaddon_attr is defined ? attr.preaddon_attr : {} %} {% set postaddonAttr = attr.postaddon_attr is defined ? attr.postaddon_attr : {} %} {% if (attr.preaddon is defined and attr.preaddon is not empty) or (attr.postaddon is defined and attr.postaddon is not empty) or (attr.preaddon_text is defined and attr.preaddon_text is not empty) or (attr.postaddon_text is defined and attr.postaddon_text is not empty) %}
{% if attr.preaddon is defined and attr.preaddon is not empty %} {% endif %} {% if attr.preaddon_text is defined and attr.preaddon_text is not empty %} {{ attr.preaddon_text }} {% endif %} {% if attr.postaddon is defined and attr.postaddon is not empty %} {% endif %} {% if attr.postaddon_text is defined and attr.postaddon_text is not empty %} {{ attr.postaddon_text }} {% endif %}
{% else %} {% endif %} {% endblock form_widget_simple %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:sortable_value_label_list_widget.html.php #} {% block sortable_value_label_list_widget %} {% if form.label.vars.value is not iterable and form.value.vars.vale is not iterable %}
{% if preaddon is not empty %} {% endif %}
{{ form_widget(form.label, {'attr': {'class': 'form-control sortable-label', 'placeholder': form.label.vars.label}}) }}
{{ form_widget(form.value, {'attr': {'class': 'form-control sortable-value', 'placeholder': form.value.vars.label}}) }}
{% if postaddon is not empty %} {% endif %}
{% endif %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:sortablelist_entry_row.html.php #} {% block sortablelist_entry_row %}
{{ form_widget(form) }} {{ form_errors(form) }}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:sortablelist_errors.html.php #} {% block sortablelist_errors %} {% set errorMessages = [] %} {% for error in errors %} {% if error.getMessage() not in errorMessages %} {% set errorMessages = errorMessages|merge([error.getMessage()]) %} {% endif %} {% endfor %} {% if errorMessages|length > 0 %}
{% if errorMessages|length > 1 %} {% else %} {{ (errorMessages|first)|escape }} {% endif %}
{% endif %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:sortablelist_row.html.php #} {% block sortablelist_row %} {% set list = form.children.list %} {% if form_errors(form.parent) and list.vars.value is empty and form.parent.children.properties.list is defined and form.parent.vars.data.getId() is same as null %} {# Work around for Symfony bug not repopulating values only for add action #} {% set list = form.parent.children.properties.list %} {% endif %} {% set feedbackClass = form_errors(list) ? ' has-error' : '' %} {% set datePrototype = list.vars.prototype is defined ? ('
' ~ form_widget(list.vars.prototype) ~ '
')|escape : '' %}
{{ form_label(form, label) }} {{ addValueButton|trans }} {{ block('sortablelist_errors') }} {% if isSortable %}
{% endif %} {% for key,item in list.children %} {{ block('sortablelist_entry_row') }} {% endfor %}
{% if isSortable %} {% endif %}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:standalone_button_row.html.php #} {% block standalone_button_row %}
{{ form_widget(form) }}
{% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:standalone_button_widget.html.php #} {% block standalone_button_widget %} {% if not label %} {% set label = name|humanize %} {% endif %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:tel_widget.html.php #} {% block tel_widget %} {{ block('form_widget_simple', {'type': type is defined ? type : get_class('Mautic\\CoreBundle\\Form\\Type\\TelType')}) }} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:time_widget.html.php #} {% block time_widget %} {% if widget is same as 'single_text' %} {{ block('form_widget_simple') }} {% else %} {% set size = 4 %} {% if not with_minutes and not with_seconds %} {% set size = 12 %} {% elseif not with_minutes or not with_seconds %} {% set size = 6 %} {% endif %} {% set vars = widget is same as 'text' ? {'attr': {'size': 1, 'class': 'not-chosen'}} : {'attr': {'class': 'not-chosen'}} %}
{# There should be no spaces between the colons and the widgets, that's why this block is written in a single PHP tag #} {{ form_widget(form.hour, vars) }} {% if with_minutes %} {{ ':' ~ form_widget(form.minute, vars) }} {% endif %} {% if with_seconds %} {{ ':' ~ form_widget(form.second, vars) }} {% endif %}
{% endif %} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:widget_attributes.html.php #} {% block widget_attributes %} id="{{ id|escape }}" name="{{ full_name|escape }}" {{ disabled|default(false) ? 'disabled="disabled"' : '' }} {{ required|default(false) ? 'required="required"' : '' }} {% for k,v in attr|filter((v,k) => k not in ['tooltip', 'preaddon', 'preaddon_attr', 'postaddon_attr']) %} {% if k in ['placeholder', 'title'] %} {{ '%s="%s" '|format(k|escape, v|trans({}, translation_domain)|escape)|raw }} {% elseif v is same as true %} {{ '%s="%s" '|format(k|escape, k|escape)|raw }} {% elseif v is iterable %} {% set v = formFieldFormatList(constant('Mautic\\FormBundle\\Helper\\FormFieldHelper::FORMAT_BAR'), v) %} {{ '%s="%s" '|format(k|escape, v|escape)|raw }} {% elseif v is not same as false %} {{ '%s="%s" '|format(k|escape, v|escape)|raw }} {% endif %} {% endfor %} {# Disable by default and use false for chrome support #} {{ attr.autocomplete is not defined ? 'autocomplete="false" ' : '' }} {% endblock %} {# Twig version of MauticCoreBundle:Views:FormTheme:Custom:yesno_button_group_widget.html.php #} {% block yesno_button_group_widget %} {# apply attributes to radios #} {% set attr = form.vars.attr %} {% set onchange = "Mautic.toggleYesNoButtonClass(mQuery(this).attr('id'));" %} {% if attr.onchange is defined %} {% if not (attr.onchange ends with ';') %} {% set attr = attr|merge({'onchange': attr.onchange ~ ';'}) %} {% endif %} {% set attr = attr|merge({'onchange': attr.onchange ~ ' ' ~ onchange}) %} {% else %} {% set attr = attr|merge({'onchange': onchange}) %} {% endif %} {% set attr = attr|merge({'style' : 'width: 1px; height: 1px; top: 0; left: 0; margin-top: 0;'}) %}
{% for child in form %} {% set class = child.vars.checked is not empty ? ' active' : '' ~ (child.vars.disabled is not empty or attr.readonly is not empty) ? ' disabled' : '' ~ child.vars.name is same as '0' ? ' btn-no' : (child.vars.name is same as '1' ? ' btn-yes' : ' btn-extra') ~ (child.vars.name is same as '0' and child.vars.checked is not empty) ? ' btn-danger' : '' ~ (child.vars.name is same as '1' and child.vars.checked is not empty) ? ' btn-success' : '' %} {% endfor %}
{% endblock %}