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.
This commit is contained in:
sankalp committed 2026-05-28 00:31:16 +05:45
1 parent 3197ef1665
commit 7271e01186
1 file changed
+8 -2
+8 -2
View File
@@ -1,5 +1,6 @@
<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 }}">
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">
@@ -23,7 +24,12 @@
{% endif %}
</div>
</div>
<div class="flex gap-1 flex-shrink-0">
<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 %}')">