<table class="table table-condensed table-bordered table-striped" data-toggle="table" data-search="true"
       data-flat="true" data-pagination="true" data-show-pagination-switch="true" data-show-columns="true"
       data-show-export="true" data-reorderable-columns="true" data-resizable="false" data-export-types="['excel','csv','txt','sql']">
    <thead>
        <tr>
            <th data-field="name" data-sortable="true">Name</th>
            <th data-field="url" data-sortable="true">URL</th>
            <th data-field="created_at" data-sortable="true">Last Visited</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
    {% for row in queryset %}
        <tr>
            <td>{{ row.name }}</td>
            <td><a href="{{ row.url }}">{{ row.url }}</a></td>
            <td>{{ row.updated_at }}</td>

            <!-- actions -->
            <td>
                <!-- edit favorite -->
                <a href="#" title="edit favorite" role="button" data-toggle="tooltip" data-placement="left" class="hvr-grow align-baseline"
                   onClick="EditFavorite('{% url 'userextensions:edit_favorite' %}?id={{ row.id }}', 'Edit Favorite: {{ row.name }} ', '{{ row.name }}', 'Update');">
                    <i class="fas fa-edit text-primary ms-1 me-1"></i>
                </a>

                <!-- delete favorite -->
                <a href="#" title="delete favorite" role="button" data-toggle="tooltip" data-placement="left" class="hvr-grow align-baseline"
                   onClick="confirmAction('{% url "userextensions:delete_favorite" row.pk %}', 'Delete Favorite', 'This favorite will be permanently removed from your list of favorites; do you wish to continue?', 'Continue', 'POST');">
                   <i class="fas fa-trash ms-1 me-1"></i>
                </a>
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
