{%- extends "_layout_list.html" %}

{%- block searchformfields %}

                            <div class="row gy-2 gx-3 mb-3">
                                <div class="col-sm-4">
                                    {{ macros_form.render_form_item_default(g.search_form.search) }}
                                </div>
                                <div class="col-sm-4">
                                    {{ macros_form.render_form_item_datetime(g.search_form.dt_from, 'datetimepicker-hm-from') }}
                                </div>
                                <div class="col-sm-4">
                                    {{ macros_form.render_form_item_datetime(g.search_form.dt_to, 'datetimepicker-hm-to') }}
                                </div>
                            </div>
                            <div class="row gy-2 gx-3">
                                <div class="col-sm-6">
                                    {{ macros_form.render_form_item_select(g.search_form.source) }}
                                </div>
                            </div>

{%- endblock searchformfields %}

{%- block contentinner %}

                    <table class="table table-bordered table-hover table-striped">
                        <thead>
                            <tr>
                                <th>
                                    {{ _('Name') }} {{ macros_site.render_sorter(request.endpoint, query_params, 'name') }}
                                </th>
                                <th>
                                    {{ _('Source') }}
                                </th>
                                <th>
                                    {{ _('Credibility') }} {{ macros_site.render_sorter(request.endpoint, query_params, 'credibility') }}
                                </th>
                                <th>
                                    {{ _('Description') }}
                                </th>
                                <th>
                                    {{ _('Hits') }} {{ macros_site.render_sorter(request.endpoint, query_params, 'hits') }}
                                </th>
                                <th data-bs-toggle="tooltip" title="{{ _('Contextual item actions') }}">
                                    {{ get_icon('actions') }} {{ _('Actions') }}
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            {%- for item in items %}
                            <tr>
                                <td>
                                    {{ item.name | default(_('<< unknown >>'), True) }}
                                </td>
                                <td>
                                    {{ item.source | default(_('<< unknown >>'), True) }}
                                </td>
                                <td>
                                    {{ item.credibility | default(_('<< unknown >>'), True) }}
                                </td>
                                <td>
                                    {{ item.description | default(_('<< unknown >>'), True) | truncate(50) }}
                                </td>
                                <td>
                                    {{ item.hits }}
                                </td>
                                <td class="column-actions">
                                    {{ macros_page.render_menu_context_actions(item) }}
                                </td>
                            </tr>
                            {%- endfor %}
                        </tbody>
                    </table>

{%- endblock contentinner %}
