Your IP : 216.73.217.117


Current Path : /var/www/v3.cesa.co.za/src/CoreBundle/Resources/views/Form/
Upload File :
Current File : /var/www/v3.cesa.co.za/src/CoreBundle/Resources/views/Form/fields.html.twig

{% block choice_widget_expanded %}
    <div class="checkbox-row container-fluid">
        <div class="row row-100">
            {% for name, child in form.vars.choices %}
                {% if child is iterable %}
                    <div class="col-sm-12">
                        <h4>{{ name }}</h4>
                    </div>
                    {% for catId, catChild in child %}
                        {% if catChild is iterable %}
                            <div style="margin-left: 12px; border-left: dotted 1px; padding-left: 4px; margin-bottom: 8px;">
                                <div class="col-sm-12">
                                    <h5>{{ catId }}</h5>
                                </div>
                                {% for catId2, catChild2 in catChild %}
                                    <div class="col-sm-3 choice-widget-col checkbox-choice-around">
                                        <table width="100%" border="0" cellspacing="0" cellpadding="2" class="borderless">
                                            <tr>
                                                <td width="20%" align="center">{{ form_widget(form[catId2]) }}</td>
                                                <td width="4%"></td>
                                                <td align="left">{{ form_label(form[catId2]) }}</td>
                                            </tr>
                                        </table>
                                    </div>
                                {% endfor %}
                            </div>
                        {% else %}
                            <div class="col-sm-3 choice-widget-col checkbox-choice-around">
                                <table width="100%" border="0" cellspacing="0" cellpadding="2" class="borderless">
                                    <tr>
                                        <td width="20%" align="center">{{ form_widget(form[catId]) }}</td>
                                        <td width="4%"></td>
                                        <td align="left">{{ form_label(form[catId]) }}</td>
                                    </tr>
                                </table>
                            </div>
                        {% endif %}
                    {% endfor %}
                {% else %}
                    <div class="col-sm-3 choice-widget-col">
                        <table width="100%" border="0" cellspacing="0" cellpadding="2" class="borderless">
                            <tr>
                                <td width="20%" align="center">{{ form_widget(form[name]) }}</td>
                                <td width="4%"></td>
                                <td align="left">{{ form_label(form[name]) }}</td>
                            </tr>
                        </table>
                    </div>
                {% endif %}

            {% endfor %}
        </div>
    </div>
    <div class="clearfix"></div>
{% endblock choice_widget_expanded %}

{% block choice_single_widget %}
    <input type="checkbox" {{ block('widget_attributes') }} value="{{ form.vars.value }}"  {% if form.vars.checked is defined and form.vars.checked %}checked{% endif %}/>
{% endblock choice_single_widget %}

{% block checkbox_widget %}
    <input type="checkbox" {{ block('widget_attributes') }} value="{{ form.vars.value }}" {% if form.vars.checked is defined and form.vars.checked %}checked{% endif %}/>
{% endblock checkbox_widget %}

{% block display_widget %}
    {% if form.vars.date_time %}
        {% if isObject(form.vars.value) %}
            {{ form.vars.value.format('l j F Y H:i:s') }}
        {% else %}
            -
        {% endif %}
    {% elseif form.vars.file_raw and form.vars.value != '' %}
        <img src="data:{{ form.vars.file_mime }};base64,{{ form.vars.value }}" class="img img-responsive" style="max-width: 300px; margin: auto;" border="0" />
    {% elseif form.vars.is_file_secure and form.vars.value != '' %}
        {% if 'image' not in form.vars.file_mime %}
            <a href="{{ path('iga_content_files_display', { 'cultureString': 'en_US', 'fileId': form.vars.value } ) }}" target="_blank">{{ 'View file'|phrase }}</a>
        {% else %}
            <a href="{{ path('iga_content_files_display', { 'cultureString': 'en_US', 'fileId': form.vars.value } ) }}" target="_blank"><img
                    src="{{ path('iga_content_files_display', { 'cultureString': 'en_US', 'fileId': form.vars.value } ) }}" border="0" class="img img-responsive" style="max-width: 300px; margin: auto;" /></a>
            {% endif %}
        {% elseif form.vars.is_count %}
            {{ form.vars.value|length }}
        {% elseif form.vars.is_money %}
            {{ form.vars.value|format_currency }}
        {% elseif form.vars.is_user %}
            {{ getUserString(form.vars.value) }}
        {% elseif form.vars.yes_no %}
            {{ form.vars.value|yes_no }}
        {% elseif form.vars.html %}
            {{ form.vars.value|raw }}
        {% else %}
            {{ form.vars.value }}
        {% endif %}
    {% endblock display_widget %}

{% block form_label %}
    {% if not compound %}
        {% set label_attr = label_attr|merge({'for': id}) %}
    {% endif %}
    {% if required %}
        {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
    {% endif %}
    {% if label is empty %}
        {% set label = name|humanize %}
    {% endif %}

    <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
{% endblock form_label %}

{% block form_row %}
    {% set field_row_classes = ['control-group'] %}
    {% if errors|length > 0 %}
        {% set field_row_classes = field_row_classes|merge(['error']) %}
    {% endif %}

    <div class="row {{ field_row_classes|join(' ') }}">
        <div class="col-sm-12 col-lg-3 formLabel">
            {{ form_label(form, label|default(null)) }}
        </div>
        <div class="col-sm-12 col-lg-9 formPrompt">
            {{ form_widget(form, { 'attr' : attr|default({}) }) }}
            {{ form_errors(form) }}
            {% if help is defined %}
                <p class="help-block">{{ help }}</p>
            {% endif %}
        </div>
    </div>
{% endblock form_row %}