- Re-applied redesign to new partial templates (_comment.html, _reply.html, etc.) - Preserved HTMX and reactions functionality from v2 update - Improved spacing and typography across all comment components - Verified all E2E tests pass with new structure
43 lines
2.5 KiB
HTML
43 lines
2.5 KiB
HTML
<div class="group">
|
|
<!-- Top-level Comment -->
|
|
<article id="comment-{{ comment.id }}" class="relative bg-brand-surfaceLight dark:bg-brand-surfaceDark border border-zinc-200 dark:border-zinc-800 p-6 sm:p-8 hover:border-brand-pink/30 transition-colors">
|
|
<div class="flex items-start gap-4 mb-4">
|
|
<div class="w-10 h-10 bg-gradient-to-tr from-brand-cyan to-brand-pink shrink-0 rounded-sm shadow-solid-dark/10 dark:shadow-solid-light/5"></div>
|
|
<div class="flex-1 min-w-0">
|
|
<div class="flex flex-wrap items-baseline gap-x-3 gap-y-1">
|
|
<span class="font-display font-bold text-base text-zinc-900 dark:text-zinc-100">{{ comment.author_name }}</span>
|
|
<time datetime="{{ comment.created_at|date:'c' }}" class="font-mono text-xs text-zinc-500 uppercase tracking-wider">{{ comment.created_at|date:"M j, Y" }}</time>
|
|
</div>
|
|
<div class="mt-3 prose prose-sm dark:prose-invert max-w-none text-zinc-700 dark:text-zinc-300 leading-relaxed">
|
|
{{ comment.body|linebreaks }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center justify-between mt-6">
|
|
{% include "comments/_reactions.html" with comment=comment counts=comment.reaction_counts user_reacted=comment.user_reacted %}
|
|
|
|
<details class="group/details">
|
|
<summary class="list-none cursor-pointer flex items-center gap-2 font-mono text-xs font-bold uppercase tracking-widest text-zinc-500 hover:text-brand-pink transition-colors [&::-webkit-details-marker]:hidden">
|
|
<svg class="w-4 h-4 transition-transform group-open/details:-translate-y-0.5 group-open/details:translate-x-0.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6" />
|
|
</svg>
|
|
<span class="group-open/details:hidden">Reply</span>
|
|
<span class="hidden group-open/details:inline text-brand-pink">Cancel Reply</span>
|
|
</summary>
|
|
|
|
<div class="mt-8 pt-8 border-t border-zinc-100 dark:border-zinc-800 animate-in fade-in slide-in-from-top-2 duration-300">
|
|
{% include "comments/_reply_form.html" with page=page comment=comment %}
|
|
</div>
|
|
</details>
|
|
</div>
|
|
</article>
|
|
|
|
<!-- Nested Replies -->
|
|
<div class="replies-container relative ml-6 sm:ml-12 mt-4 space-y-4 pl-6 sm:pl-8 border-l-2 border-zinc-100 dark:border-zinc-800">
|
|
{% for reply in comment.replies.all %}
|
|
{% include "comments/_reply.html" with reply=reply %}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|