Files
2025-05-23 14:44:12 +08:00

34 lines
1.6 KiB
HTML

{% if page_object %}
{% for product in page_object %}
<tr>
<td>
{% if page_object.start_index %}
{{page_object.start_index|add:forloop.counter0}}
{% else %}
{{forloop.counter}}
{% endif %}
</td>
<td>{% if product.product_picture %} <img src="{{product.product_picture.url}}" class="rounded" width="100" height="80" /> {% else %} Not uploaded {% endif %}</td>
<td>{{product.name}}</td>
<td>{{product.product_type}}</td>
<td>{{product.product_category}}</td>
<td>{{product.updated_at}}</td>
<td>
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
<form action="{% url 'recycle_bin:deleted_products_restore' product.id %}" method="post" onsubmit="return confirm('Are you sure you want to restore it?')">
{% csrf_token %}
<button type="submit" class="btn btn-success btn-sm" title="Restore"><i class="bi bi-arrow-repeat"></i></button>
</form>
<form action="{% url 'recycle_bin:deleted_products_permanently' product.id %}" method="post" onsubmit="return confirm('Are you sure you want to delete this permanently?')">
{% csrf_token %}
<button type="submit" class="btn btn-danger btn-sm" title="Delete"><i class="bi bi-trash3-fill"></i></button>
</form>
</div>
</td>
</tr>
{% endfor %}
{% else %}
<td colspan="8" class="text-center"> No record found related to your search keyword</td>
{% endif %}