bp/app/Modules/CRM/Views/deals/kanban_card.twig

54 lines
2.2 KiB
Twig

{#
kanban_card.twig - Карточка сделки для Канбана
Используется как кастомный компонент карточки в kanban.twig
#}
<div class="card mb-2 kanban-card"
draggable="true"
data-item-id="{{ item.id }}"
style="cursor: grab;">
<div class="card-body py-2 px-3">
<div class="d-flex justify-content-between align-items-start mb-2">
<a href="{{ site_url('/crm/deals/' ~ item.id) }}" class="text-decoration-none flex-grow-1">
<strong class="text-dark">{{ item.title }}</strong>
</a>
<span class="badge bg-light text-dark ms-2">
{{ item.amount|number_format(0, ',', ' ') }}
</span>
</div>
{% if item.contact_name or item.client_name %}
<small class="text-muted d-block mb-2">
<i class="fa-solid fa-user me-1"></i>
{{ item.contact_name|default(item.client_name) }}
</small>
{% endif %}
<div class="d-flex justify-content-between align-items-center">
{% if item.assigned_user_name %}
<small class="text-muted">
<i class="fa-solid fa-user-check me-1"></i>
{{ item.assigned_user_name }}
</small>
{% else %}
<small></small>
{% endif %}
{% if item.expected_close_date %}
<small class="{{ item.expected_close_date < date('today') ? 'text-danger fw-bold' : 'text-muted' }}">
<i class="fa-regular fa-calendar me-1"></i>
{{ item.expected_close_date|date('d.m') }}
{% if item.expected_close_date < date('today') %}
<i class="fa-solid fa-circle-exclamation ms-1" style="font-size: 0.6rem;" title="Просрочено"></i>
{% endif %}
</small>
{% endif %}
{# Кнопка просмотра #}
<a href="{{ site_url('/crm/deals/' ~ item.id) }}" class="btn btn-sm btn-outline-primary ms-2" title="Просмотр">
<i class="fa-solid fa-eye"></i>
</a>
</div>
</div>
</div>