- Add custom border, background, and spacing utilities to base template - Enhance message notification styling and layout - Update delete modal button appearance and behavior - Refine comment card component with Tailwind classes and responsive behavior - Adjust sidebar responsiveness for mobile view
44 lines
2.7 KiB
HTML
44 lines
2.7 KiB
HTML
{% load form_helpers %}
|
|
<div class="card-surface" id="comment-{{ comment.pk }}">
|
|
<div class="p-4">
|
|
<div class="flex items-start gap-3">
|
|
<div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center text-white text-xs font-bold flex-shrink-0">{{ comment.author.username|first|upper }}</div>
|
|
<div class="flex-1 min-w-0">
|
|
<div class="flex items-center gap-2 mb-1">
|
|
<span class="text-sm font-semibold text-primary">{{ comment.author.username }}</span>
|
|
<span class="text-xs text-muted">{{ comment.created_at|timesince }} ago</span>
|
|
</div>
|
|
<div class="prose prose-sm max-w-none text-secondary mb-2">
|
|
{{ comment.body|render_markdown }}
|
|
</div>
|
|
{% if not comment.parent %}
|
|
<button type="button"
|
|
class="text-xs text-blue-600 hover:text-blue-800 font-medium"
|
|
onclick="event.stopPropagation(); document.getElementById('reply-form-{{ comment.pk }}').classList.toggle('hidden')">
|
|
Reply
|
|
</button>
|
|
<form method="post" action="{% url 'card_comment' comment.card.pk %}"
|
|
id="reply-form-{{ comment.pk }}"
|
|
class="hidden mt-3 space-y-2"
|
|
hx-target="#comment-{{ comment.pk }}" hx-swap="afterend">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="parent" value="{{ comment.pk }}">
|
|
<textarea name="body" class="w-full px-3 py-2 rounded-lg border border-soft bg-white text-sm text-primary focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-500 transition-colors resize-y min-h-[80px]" placeholder="Write a reply..." required></textarea>
|
|
<div class="flex gap-2">
|
|
<button type="submit" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 transition-colors">Reply</button>
|
|
<button type="button" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors" onclick="this.closest('form').classList.add('hidden')">Cancel</button>
|
|
</div>
|
|
</form>
|
|
{% endif %}
|
|
{% if comment.replies.all %}
|
|
<div class="mt-3 space-y-3 pl-4 border-l-2 border-soft">
|
|
{% for reply in comment.replies.all %}
|
|
{% include "partials/kanban/comment.html" with comment=reply %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|