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

78 lines
4.1 KiB
HTML

{% extends 'layouts/main-layout.html' %}
{% block content %}
<div class="page-heading">
<div class="page-title">
<div class="row">
<div class="col-12 col-md-6 order-md-1 order-last">
<h3>Deleted Products</h3>
</div>
<div class="col-12 col-md-6 order-md-2 order-first">
<nav aria-label="breadcrumb" class="breadcrumb-header float-start float-lg-end">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Dashboard</a></li>
<li class="breadcrumb-item" aria-current="page">Recycle Bin</li>
<li class="breadcrumb-item active" aria-current="page">Products</li>
</ol>
</nav>
</div>
</div>
</div>
<section class="section">
<div class="card">
<div class="card-body">
{% if page_object %}
<div class="d-flex justify-content-end my-2 gap-2">
<input name="search_text" type="search" class='dataTable-input' autocomplete="off" placeholder='Search here...'
hx-get="{% url 'recycle_bin:deleted_products_search' page_object.number %}" hx-trigger="keyup changed delay:500ms, search" hx-target="#search_result">
</div>
{% endif %}
<table class="table table-hover" id="table1">
<thead>
<tr>
<th>Sl No.</th>
<th>Product Image</th>
<th>Product Name</th>
<th>Product Type</th>
<th>Product Category</th>
<th>Datetime</th>
<th>Actions</th>
</tr>
</thead>
{% if page_object %}
<tbody id="search_result">
{% for product in page_object %}
<tr>
<td>{{page_object.start_index|add:forloop.counter0}}</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 %}
</tbody>
{% else %}
<div class="alert alert-info" role="alert">
No record available!
</div>
{% endif %}
</table>
{% include 'commons/pagination.html' %}
</div>
</div>
</section>
</div>
{% endblock content%}