При наведении на строку курсор меняется на pointer
Двойной клик открывает заказ на редактирование (как клик на карандаш)
This commit is contained in:
@@ -17,6 +17,15 @@
|
|||||||
.table td {
|
.table td {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
.table tbody tr {
|
||||||
|
border-bottom: 2px solid #dee2e6;
|
||||||
|
}
|
||||||
|
.table tbody tr:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
.table tbody tr[data-edit-url] {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@@ -106,7 +115,6 @@
|
|||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Номер</th>
|
|
||||||
<th>Дата</th>
|
<th>Дата</th>
|
||||||
<th>Время</th>
|
<th>Время</th>
|
||||||
<th>Тип</th>
|
<th>Тип</th>
|
||||||
@@ -115,16 +123,13 @@
|
|||||||
<th>Сумма</th>
|
<th>Сумма</th>
|
||||||
<th>Оплата</th>
|
<th>Оплата</th>
|
||||||
<th>Действия</th>
|
<th>Действия</th>
|
||||||
|
<th>Номер заказа</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for order in page_obj %}
|
{% for order in page_obj %}
|
||||||
<tr {% if order.status and order.status.is_negative_end and order.amount_paid > 0 %}class="table-warning"{% endif %}>
|
<tr {% if order.status and order.status.is_negative_end and order.amount_paid > 0 %}class="table-warning"{% endif %}
|
||||||
<td>
|
data-edit-url="{% url 'orders:order-update' order.order_number %}">
|
||||||
<a href="{% url 'orders:order-detail' order.order_number %}" class="text-decoration-none">
|
|
||||||
<strong>{{ order.order_number }}</strong>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
{% if order.delivery_date %}
|
{% if order.delivery_date %}
|
||||||
{{ order.delivery_date|date:"d.m.Y" }}
|
{{ order.delivery_date|date:"d.m.Y" }}
|
||||||
@@ -203,6 +208,11 @@
|
|||||||
<i class="bi bi-pencil"></i>
|
<i class="bi bi-pencil"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="{% url 'orders:order-detail' order.order_number %}" class="text-decoration-none">
|
||||||
|
<strong>{{ order.order_number }}</strong>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -368,6 +378,16 @@
|
|||||||
}, 200);
|
}, 200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Двойной клик на строку для перехода к редактированию
|
||||||
|
document.querySelectorAll('tbody tr[data-edit-url]').forEach(function(row) {
|
||||||
|
row.addEventListener('dblclick', function() {
|
||||||
|
const editUrl = this.dataset.editUrl;
|
||||||
|
if (editUrl) {
|
||||||
|
window.location.href = editUrl;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user