feat(templates/partials): enhance Kanban card UI with Tailwind styling and interactive controls- New Features: added edit link with icon, delete form with confirmation dialog; render card description and due date; introduced responsive Tailwind design

- Enhancements: upgraded visual styling with rounded-xl, shadow, hover effects, improved spacing and accessibility- Bug Fixes: removed redundant attributes, fixed event propagation for inline actions
This commit is contained in:
sankalp committed 2026-05-28 00:00:09 +05:45
1 parent a42fd580b7
commit 5bffdcfc1d
1 file changed
+29 -11
+29 -11
View File
@@ -1,16 +1,34 @@
<div class="card bg-base-200 shadow-sm cursor-move" draggable="true"
id="card-{{ card.pk }}"
hx-post="{% url 'card_move' card.pk %}"
hx-trigger="end"
hx-target="#column-{{ card.column.pk }}"
hx-swap="innerHTML">
<div class="card-body p-2 text-sm">
<div class="flex justify-between items-start">
<span>{{ card.title }}</span>
<a href="{% url 'card_edit' card.pk %}" class="text-xs opacity-50 hover:opacity-100">edit</a>
<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 }}">
<div class="p-3">
<div class="flex items-start justify-between gap-2">
<p class="text-sm font-medium text-gray-900 leading-snug">{{ card.title }}</p>
<div class="flex gap-1 flex-shrink-0">
<a href="{% url 'card_edit' card.pk %}"
class="text-gray-300 hover:text-gray-600 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="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"/></svg>
</a>
<form method="post" action="{% url 'card_delete' card.pk %}"
hx-target="#card-{{ card.pk }}" hx-swap="outerHTML swap:0.3s"
onsubmit="event.stopPropagation()"
class="inline">
{% csrf_token %}
<button type="submit" class="text-gray-300 hover:text-red-500 transition-colors"
onclick="return confirm('Delete this card?')">
<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>
</form>
</div>
</div>
{% if card.description %}
<p class="text-xs text-gray-500 mt-1 line-clamp-2">{{ card.description }}</p>
{% endif %}
{% if card.due_date %}
<span class="text-xs opacity-60">Due: {{ card.due_date }}</span>
<div class="flex items-center gap-1 mt-2">
<svg class="w-3 h-3 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
<span class="text-xs text-gray-500">{{ card.due_date }}</span>
</div>
{% endif %}
</div>
</div>