<h2>{{ 'Reports search results'|trans }}</h2>

<p>
    {{ 'total reports matching the search'|trans({'total' : total}) }}&nbsp;:
    <a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-sm">
        <i class="fa fa-search" aria-hidden="true"></i> {{ pattern }}
    </a>
</p>

{% if reports|length > 0 %}
    <table class="striped rounded">
        <thead>
            <tr>
                <th>{{ 'Person'|trans }}</th>
                <th>{{ 'Date'|trans }}</th>
                <th>{{ 'Report type'|trans }}</th>
                <th>{{ 'Scope'|trans }}</th>
                <th>&nbsp;</th>
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            {% for report in reports %}
            <tr>
                <td>{{ report.person }}</td>
                <td>{% if report.date %}{{ report.date|format_date('long') }}{% endif %}</td>
                <td>{{ report.cFGroup.getName|localize_translatable_string  }}</td>
                <td>{{ report.scope.name|localize_translatable_string }}</td>
                <td><a href="{{ path('report_view', { 'person_id': report.person.id, 'report_id': report.id }) }}">{{ 'View the report' | trans }}</a></td>
                <td><a href="{{ path('report_edit', { 'person_id': report.person.id, 'report_id': report.id }) }}">{{ 'Update the report' | trans }}</a></td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% endif %}
