        <table class='table table-bordered'>
            <tr>
                <th colspan="2">
                    <a
                        ng-init="hide_all = false"
                        ng-click="hide_all = !hide_all; {% for suite in test_results.suites -%} hide_{{ suite.id }} = hide_all; {% endfor %}"
                        class="toggle-test-results">
                        <i ng-hide="!hide_all" class="fa fa-minus"></i>
                        <i ng-hide="hide_all" class="fa fa-plus"></i>
                    </a>
                    {{ _('Collapse/expand all') }}
                </th>
            </tr>
        </table>

        {% for suite in test_results.suites %}
        <table id='tests-{{ suite.id }}' class='test-results-box table table-bordered' ng-show='match("tests-{{suite.id}}") || match("details-{{suite.id}}")'>
            <thead>
                <tr>
                    <th colspan="2">
                        {% set hide_suite = 'hide_' + string(suite.id) -%}
                        <a ng-click="{{ hide_suite }} = !{{ hide_suite }}" class="toggle-test-results" ng-init="{{ hide_suite }} = false">
                            <i ng-hide="!{{ hide_suite }}" class="fa fa-minus"></i>
                            <i ng-hide="{{ hide_suite }}" class="fa fa-plus"></i>
                        </a>
                        {{ suite }}
                        {% with status=suite.status %}
                            {% include "squad/_test_results_summary.jinja2" %}
                        {% endwith %}
                    </th>
                </tr>
            </thead>
            <tbody ng-hide="!{{ hide_suite }}" aria-hidden="false">
                <tr>
                    <th>{{ _('Environment') }}</th>
                    <th>{{ _('Test Results') }}</th>
                </tr>
                {% for environment, statuses in suite.environments %}
                <tr>
                    <td class="col-md-4 col-sm-4">{{ environment }}</td>
                    <td class="col-md-4 col-sm-6">
                    {% for status in statuses %}
                        <span>
                        <a href="{{testrun_suite_tests_url(project.group, project, build, status)}}">{% include "squad/_test_results_summary.jinja2" %}</a>
                        {% if status.test_run.attachments.all()|length > 0  %}
                        {% with tr_id = status.test_run.id%}
                        {% set download_key = '%s-%s-%s' % (suite, environment, tr_id) %}
                            <select
                                name="attachment"
                                data-toggle="tooltip"
                                title="{{ _('Download Attachment') }}"
                                class="form-control-lg download-attachment"
                                style="width: 40%;"
                                ng-model='selected_attachment["{{ download_key }}"]'
                                ng-change='show_download_button("{{ download_key }}")'
                                ng-cloak
                                >
                                <option value="" disabled selected hidden>Download Attachment</option>
                                {% for attachment in status.test_run.attachments.all() %}
                                    <option
                                        ng-init='attachments_visibility["{{ download_key }}"]["{{ attachment.filename }}"] = false'
                                        value="{{ attachment.filename }}"
                                    >
                                        {{ attachment.filename }}
                                    </option>
                                {% endfor %}
                            </select>
                            {% for attachment in status.test_run.attachments.all() %}
                            {% set download_url = download_build_attachments_url(project.group.slug, project.slug, build.version, tr_id, attachment.filename) %}
                                <a
                                    href="{{ download_url }}"
                                    value ="{{ _('Download') }}"
                                    class="btn btn-default"
                                    data-toggle="tooltip"
                                    title="Download"
                                    ng-cloak
                                    ng-hide='!attachments_visibility["{{ download_key }}"]["{{ attachment.filename }}"]'
                                    />
                                    <i class='fa fa-download'>&nbsp;</i>
                                </a>
                                {% if statuses|length > 1 %}
                                    <br/>
                                {% endif %}
                            {% endfor %}
                        {% endwith %}
                        {% else%}
                          {% if statuses|length > 1%}
                              <br/>
                          {% endif %}
                        {% endif %}
                        </span>
                    {% endfor %}
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        {% endfor %}
