Compare commits

..

2 Commits

Author SHA1 Message Date
961cfcb9cd При наведении на строку курсор меняется на pointer
Двойной клик открывает заказ на редактирование (как клик на карандаш)
2026-01-18 20:40:18 +03:00
b6206ebe09 fix(orders): убрать ограничение строк в резюме и добавить центровку
- Убрать -webkit-line-clamp для полного отображения резюме заказа
- Убрать клик для раскрытия/сворачивания текста
- Добавить vertical-align: middle для центровки содержимого ячеек

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 20:21:43 +03:00

View File

@@ -10,24 +10,21 @@
max-width: 280px;
}
.order-summary-text {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
word-break: break-word;
white-space: pre-wrap;
cursor: pointer;
transition: all 0.2s ease;
color: #212529;
}
.order-summary-text:hover {
color: #0d6efd;
.table td {
vertical-align: middle;
}
.order-summary-text.expanded {
-webkit-line-clamp: unset;
max-height: none;
position: relative;
z-index: 10;
.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>
{% endblock %}
@@ -118,7 +115,6 @@
<table class="table table-hover">
<thead>
<tr>
<th>Номер</th>
<th>Дата</th>
<th>Время</th>
<th>Тип</th>
@@ -127,16 +123,13 @@
<th>Сумма</th>
<th>Оплата</th>
<th>Действия</th>
<th>Номер заказа</th>
</tr>
</thead>
<tbody>
{% for order in page_obj %}
<tr {% if order.status and order.status.is_negative_end and order.amount_paid > 0 %}class="table-warning"{% endif %}>
<td>
<a href="{% url 'orders:order-detail' order.order_number %}" class="text-decoration-none">
<strong>{{ order.order_number }}</strong>
</a>
</td>
<tr {% if order.status and order.status.is_negative_end and order.amount_paid > 0 %}class="table-warning"{% endif %}
data-edit-url="{% url 'orders:order-update' order.order_number %}">
<td>
{% if order.delivery_date %}
{{ order.delivery_date|date:"d.m.Y" }}
@@ -160,7 +153,7 @@
</td>
<td class="order-summary-cell">
{% if order.summary %}
<div class="order-summary-text" title="Клик для раскрытия/сворачивания">{{ order.summary|safe }}</div>
<div class="order-summary-text">{{ order.summary|safe }}</div>
{% else %}
<span class="text-muted">&mdash;</span>
{% endif %}
@@ -215,6 +208,11 @@
<i class="bi bi-pencil"></i>
</a>
</td>
<td>
<a href="{% url 'orders:order-detail' order.order_number %}" class="text-decoration-none">
<strong>{{ order.order_number }}</strong>
</a>
</td>
</tr>
{% endfor %}
</tbody>
@@ -381,10 +379,13 @@
});
});
// Toggle для раскрытия/сворачивания резюме заказа
document.querySelectorAll('.order-summary-text').forEach(function(el) {
el.addEventListener('click', function() {
this.classList.toggle('expanded');
// Двойной клик на строку для перехода к редактированию
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;
}
});
});
})();