Files
project-managment/templates/partials/kanban/card.html
T
sankalp 7271e01186 feat(templates/partials/kanban): add edit action and improve drag handling in cardAdds an inline edit link to each Kanban card and introduces a data-card-id attribute for easier identification. Updates class handling to prevent accidental dragging and refines hover interactions, enhancing the card UI.
New Features
- Add edit action link that opens the card edit modal.
- Introduce `data-card-id` attribute for stable card identification.

Enhancements
- Add `no-drag` class to the card container to stop drag propagation.
- Refine hover styling and transition behavior.

Bug Fixes
- Preserve original `id="card-{{ card.pk }}"` attribute without regression.
2026-05-28 00:31:16 +05:45

42 lines
2.8 KiB
HTML

<div class="bg-white rounded-xl shadow-sm border border-gray-200 hover:border-blue-300 hover:shadow-md transition-all cursor-grab active:cursor-grabbing"
id="card-{{ card.pk }}"
data-card-id="{{ card.pk }}">
<div class="p-3">
<div class="flex items-start justify-between gap-2">
<div class="flex-1 min-w-0">
<a href="{% url 'card_detail' card.pk %}"
class="text-sm font-medium text-gray-900 leading-snug hover:text-blue-600 block truncate"
onclick="event.stopPropagation()">
{{ card.title }}
</a>
<div class="flex items-center gap-2 mt-1.5">
{% if card.priority == 'urgent' %}
<span class="text-[10px] px-1.5 py-0.5 rounded font-semibold bg-red-100 text-red-700">Urgent</span>
{% elif card.priority == 'high' %}
<span class="text-[10px] px-1.5 py-0.5 rounded font-semibold bg-amber-100 text-amber-700">High</span>
{% elif card.priority == 'medium' %}
<span class="text-[10px] px-1.5 py-0.5 rounded font-semibold bg-blue-100 text-blue-700">Med</span>
{% elif card.priority == 'low' %}
<span class="text-[10px] px-1.5 py-0.5 rounded font-semibold bg-gray-100 text-gray-600">Low</span>
{% endif %}
{% if card.assignee %}
<span class="text-[10px] text-gray-400 truncate">{{ card.assignee.username }}</span>
{% endif %}
</div>
</div>
<div class="flex gap-1 flex-shrink-0 no-drag">
<a href="{% url 'card_edit' card.pk %}"
class="text-gray-300 hover:text-blue-500 transition-colors"
onclick="event.stopPropagation()">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
</a>
<button type="button"
class="text-gray-300 hover:text-red-500 transition-colors"
onclick="event.stopPropagation(); openCardDeleteModal('{% url 'card_delete' card.pk %}')">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
</button>
</div>
</div>
</div>
</div>