some fixes
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
{#
|
||||
task_card.twig - Карточка задачи для Канбан-компонента
|
||||
|
||||
Параметры:
|
||||
- item: Объект задачи
|
||||
- column: Объект колонки (для доступа к color и т.д.)
|
||||
#}
|
||||
<div class="card mb-2 kanban-card {{ item.completed_at ? 'opacity-75' : '' }}"
|
||||
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="{{ base_url('/tasks/' ~ item.id) }}" class="text-decoration-none flex-grow-1">
|
||||
<strong class="text-dark">{{ item.title }}</strong>
|
||||
</a>
|
||||
|
||||
{# Индикатор приоритета #}
|
||||
{% if item.priority == 'urgent' %}
|
||||
<span class="badge bg-danger ms-2" style="font-size: 0.6rem;">Срочно</span>
|
||||
{% elseif item.priority == 'high' %}
|
||||
<span class="badge bg-warning text-dark ms-2" style="font-size: 0.6rem;">Высокий</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Описание #}
|
||||
{% if item.description is defined and item.description %}
|
||||
<small class="text-muted d-block mb-2">
|
||||
{{ item.description|length > 50 ? item.description|slice(0, 50) ~ '...' : item.description }}
|
||||
</small>
|
||||
{% endif %}
|
||||
|
||||
{# Нижняя панель #}
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
{# Дата и статус просроченности #}
|
||||
{% if item.due_date is defined and item.due_date %}
|
||||
{% set isOverdue = item.due_date < date('now') and not item.completed_at %}
|
||||
<small class="{{ isOverdue ? 'text-danger fw-bold' : (item.completed_at ? 'text-success' : 'text-muted') }}">
|
||||
<i class="fa-regular fa-calendar me-1"></i>
|
||||
{{ item.due_date|date('d.m') }}
|
||||
{% if item.completed_at %}
|
||||
<i class="fa-solid fa-check ms-1" style="font-size: 0.7rem;"></i>
|
||||
{% elseif isOverdue %}
|
||||
<i class="fa-solid fa-circle-exclamation ms-1" style="font-size: 0.6rem;" title="Просрочено"></i>
|
||||
{% endif %}
|
||||
</small>
|
||||
{% else %}
|
||||
<small></small>
|
||||
{% endif %}
|
||||
|
||||
{# Кнопка просмотра #}
|
||||
<a href="{{ base_url('/tasks/' ~ item.id) }}" class="btn btn-sm btn-outline-primary" title="Просмотр">
|
||||
<i class="fa-solid fa-eye"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
{#
|
||||
task_event.twig - Событие задачи для Календарь-компонента
|
||||
|
||||
Параметры:
|
||||
- event: Объект задачи
|
||||
- onEventClick: JavaScript функция при клике (опционально)
|
||||
#}
|
||||
{% set isOverdue = event.due_date is defined and event.due_date < date('now') and not event.completed_at %}
|
||||
<a href="{{ event.url|default('/tasks/' ~ event.id) }}"
|
||||
class="calendar-event {{ isOverdue ? 'border-danger text-danger' : '' }}"
|
||||
style="border-left-color: {{ event.color|default(event.column_color|default('#6B7280')) }};"
|
||||
{% if onEventClick %}onclick="{{ onEventClick }}({{ event.id }}); return false;"{% endif %}>
|
||||
{% if event.priority in ['urgent', 'high'] %}
|
||||
<i class="fa-solid fa-flag me-1" style="color: {{ event.priority == 'urgent' ? '#dc3545' : '#ffc107' }};"></i>
|
||||
{% endif %}
|
||||
{{ event.title }}
|
||||
</a>
|
||||
Reference in New Issue
Block a user