Compare commits
2 Commits
e3949d249f
...
961cfcb9cd
| Author | SHA1 | Date | |
|---|---|---|---|
| 961cfcb9cd | |||
| b6206ebe09 |
@@ -10,24 +10,21 @@
|
|||||||
max-width: 280px;
|
max-width: 280px;
|
||||||
}
|
}
|
||||||
.order-summary-text {
|
.order-summary-text {
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 3;
|
|
||||||
overflow: hidden;
|
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
color: #212529;
|
color: #212529;
|
||||||
}
|
}
|
||||||
.order-summary-text:hover {
|
.table td {
|
||||||
color: #0d6efd;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.order-summary-text.expanded {
|
.table tbody tr {
|
||||||
-webkit-line-clamp: unset;
|
border-bottom: 2px solid #dee2e6;
|
||||||
max-height: none;
|
}
|
||||||
position: relative;
|
.table tbody tr:last-child {
|
||||||
z-index: 10;
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
.table tbody tr[data-edit-url] {
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -118,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>
|
||||||
@@ -127,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" }}
|
||||||
@@ -160,7 +153,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="order-summary-cell">
|
<td class="order-summary-cell">
|
||||||
{% if order.summary %}
|
{% if order.summary %}
|
||||||
<div class="order-summary-text" title="Клик для раскрытия/сворачивания">{{ order.summary|safe }}</div>
|
<div class="order-summary-text">{{ order.summary|safe }}</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="text-muted">—</span>
|
<span class="text-muted">—</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -215,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>
|
||||||
@@ -381,10 +379,13 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Toggle для раскрытия/сворачивания резюме заказа
|
// Двойной клик на строку для перехода к редактированию
|
||||||
document.querySelectorAll('.order-summary-text').forEach(function(el) {
|
document.querySelectorAll('tbody tr[data-edit-url]').forEach(function(row) {
|
||||||
el.addEventListener('click', function() {
|
row.addEventListener('dblclick', function() {
|
||||||
this.classList.toggle('expanded');
|
const editUrl = this.dataset.editUrl;
|
||||||
|
if (editUrl) {
|
||||||
|
window.location.href = editUrl;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user