<div>
    <ul class="nav nav-tabs" id="texts_tab_section" role="tablist">
        {% for per_ in persons %}
        <li class="nav-item">
            {% if forloop.first %}
            <a class="nav-link active" id="{{per_.id}}_tab_link" data-toggle="tab" href="#{{per_.id}}_tab" role="tab" aria-controls="{{per_.id}}" aria-selected="true">{{per_.id}}</a>
            {% else %}
            <a class="nav-link" id="{{per_.id}}_tab_link" data-toggle="tab" href="#{{per_.id}}_tab" role="tab" aria-controls="{{per_.id}}" aria-selected="false">{{per_.id}}</a>
            {% endif %}
        </li>
        {% endfor %}
    </ul>
    <div class="tab-content">
        {% for per_ in persons %}
        {% if forloop.first %}
        <div class="tab-pane active" id="{{per_.id}}_tab" role="tabpanel" aria-labelledby="{{per_.id}}_tab_link">
        {% else %}
        <div class="tab-pane" id="{{per_.id}}_tab" role="tabpanel" aria-labelledby="{{per_.id}}_tab_link">
        {% endif %}
        {% if per_.text.all %}
            {% for x in per_.text.all %}
                {% if x.text %}
                <span class="my-1 p-1 d-flex"><label class="w-25"><b>{{x.kind}}</b></label><label class="w-75">{{x.text}}</label></span>
                {% endif %}
            {% endfor %}
        {% else %}
            <div>
                <legend>No text provided for {{per_.name}}, {{per_.first_name}} [{{per_.id}}]</legend>
            </div>
        {% endif %}
        </div>
        {% endfor %}
    </div>
</div>
