{#
    Display only one panel
#}
{% macro displayOne(tabs, panel) %}
    <div class="tabs" id="{{ panel }}">
        <nav>
            <ul class="nav-tabs" role="tablist">
                {% for tab in tabs[panel] %}
                    <li class="nav-item">
                        {% set ref = (tab.link is defined )? tab.link : '#' %}
                        <a class="nav-link" href="{{ ref }}">{{ tab.name }}</a>
                    </li>
                {% endfor %}
            </ul>
        </nav>
        <div class="tab-content">
            {% for tab in tabs[panel] %}
                <div class="tab-pane fade" role="tabpanel">
                    {% if tab.content is defined %}
                        <p>{{ tab.content }}</p>
                    {% endif %}
                </div>
            {% endfor %}
        </div>
    </div>
{% endmacro %}

{#
    Display all panels
#}
{% macro display(tabs) %}
    {% import _self as tabsPanel %}
    {% for panel,array in tabs %}
        {{ tabsPanel.displayOne(tabs, panel) }}
    {% endfor %}
{% endmacro %}