{% load i18n %}
<table class="table table-striped align-middle">
    <thead>
        <tr>
            <th>{% trans "Name" %}</th>
            <th>{% trans "Slug" %}</th>
            <th>{% trans "Type" %}</th>
            <th>{% trans "Published" %}</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        {% for shop in shops %}
        <tr>
            <td>{{ shop.name }}</td>
            <td><code>{{ shop.slug }}</code></td>
            <td>{{ shop.get_shop_type_display }}</td>
            <td>
                {% if shop.is_published %}
                <span class="badge bg-success">{% trans "Published" %}</span>
                {% else %}
                <span class="badge bg-secondary">{% trans "Draft" %}</span>
                {% endif %}
            </td>
            <td>
                <div class="d-flex justify-content-end gap-1">
                    <a href="{% url 'storefront:detail' slug=shop.slug %}" target="_blank"
                       class="btn btn-sm btn-outline-theme">
                        <i class="fa-solid fa-up-right-from-square fa-fw"></i> {% trans "View" %}</a>
                    <a href="{% url 'backoffice:manage' shop.pk %}"
                       class="btn btn-sm btn-outline-success">
                        <i class="fa-solid fa-warehouse fa-fw"></i> {% trans "Manage" %}</a>
                    <a href="{% url 'backoffice:edit' shop.pk %}"
                       class="btn btn-sm btn-outline-primary">
                        <i class="fa-solid fa-pen-to-square fa-fw"></i> {% trans "Edit" %}</a>
                    <a href="{% url 'backoffice:delete' shop.pk %}"
                       class="btn btn-sm btn-outline-danger">
                        <i class="fa-solid fa-trash fa-fw"></i> {% trans "Delete" %}</a>
                </div>
            </td>
        </tr>
        {% empty %}
        <tr><td colspan="5" class="text-muted">{% trans "No shops yet." %}</td></tr>
        {% endfor %}
    </tbody>
</table>
