{#
 # Copyright 2006 - 2016 TubePress LLC (http://tubepress.com)
 #
 # This file is part of TubePress (http://tubepress.com)
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #}
{% if fieldProvider.fieldsShouldBeInSeparateBoxes %}
    <div class="panel panel-default tubepress-field-provider-{{ providerId }}">
        <div class="panel-heading">
            <h3 class="panel-title">
                {{ fieldProvider.untranslatedDisplayName|trans }}
            </h3>
        </div>
    <div class="panel-body">
{% endif %}

{% for fieldId in fieldIds %}
    {% if fieldId in fields|keys %}
        {% set field = attribute(fields, fieldId) %}
        {% include 'options-ui/page-fragments/single-field.html.twig' %}
    {% endif %}
{% endfor %}

{% if fieldProvider.fieldsShouldBeInSeparateBoxes %}

        </div>{# end of div.panel-body #}
    </div>{# end of div.panel #}
{% endif %}
{#
 # Copyright 2006 - 2016 TubePress LLC (http://tubepress.com)
 #
 # This file is part of TubePress (http://tubepress.com)
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #}

{% set hasFieldsToShow = false %}
{% for fieldId in fieldIds %}
    {% if fieldId in fields|keys %}
        {% set hasFieldsToShow = true %}
    {% endif %}
{% endfor %}

{% if hasFieldsToShow %}

    {% if fieldProvider.fieldsShouldBeInSeparateBoxes %}
        <div class="panel panel-default tubepress-field-provider-{{ providerId }}">
            <div class="panel-heading">
                <h3 class="panel-title">
                    {{ fieldProvider.untranslatedDisplayName|trans }}
                </h3>
            </div>
        <div class="panel-body">
    {% endif %}

    {% for fieldId in fieldIds %}
        {% if fieldId in fields|keys %}
            {% set field = attribute(fields, fieldId) %}
            {% include 'options-ui/page-fragments/single-field.html.twig' %}
        {% endif %}
    {% endfor %}

    {% if fieldProvider.fieldsShouldBeInSeparateBoxes %}

            </div>{# end of div.panel-body #}
        </div>{# end of div.panel #}
    {% endif %}

{% endif %}
Hide option boxes without any fields
Hide option boxes without any fields
