Files
project-behind-the-desk/_includes/mobile_comment_nested.liquid
T

62 lines
3.7 KiB
Plaintext

<h3 class="mt-4 text-lg font-medium">Comments</h3>
<div class="mt-4">
<!-- Nested Comment -->
<div id="mobile-comment-thread-view" class="mt-4 flex">
<div class="mr-2">
<a href="#" class="text-text-muted no-underline text-sm leading-none inline-block pt-0.5 hover:text-link-hover" title="Back"><i class="fas fa-arrow-left"></i></a>
</div>
<div id="mobile-comment-thread-content">
<div class="border-b border-gray-200 pb-3 mb-3">
<p class="text-sm mb-2">{{ page.content }}</p>
<div class="mt-2 mb-1 text-sm flex flex-col md:flex-row items-start md:items-center md:space-x-2">
<div class="flex items-start space-x-2 mb-2 md:mb-0">
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
<i class="fa-solid fa-arrow-up mr-1"></i> {{ page.upvotes }}
</span>
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
<i class="fas fa-reply mr-1"></i> REPLY
</span>
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
<i class="fas fa-comment mr-1"></i> {{ page.replies }}
</span>
</div>
<small class="text-sm font-action">
<a href="#" class="text-sm hover:underline">{{ page.author }}</a>
<span class="text-text-muted text-sm opacity-75">{{ page.date | date: "%d %b %Y" }}</span>
</small>
</div>
</div>
<div class="ml-4 mt-3 border-l-2 border-gray-200 pl-2">
{% assign nested_comments = site.comments | where: "parent", page.slug | sort: "date" %}
{% for comment in nested_comments %}
<div class="mb-3 pb-3 border-b border-gray-200">
<p class="text-sm mb-2">{{ comment.content }}</p>
<div class="mt-2 mb-1 text-sm flex flex-col md:flex-row items-start md:items-center md:space-x-2">
<div class="flex items-start space-x-2 mb-2 md:mb-0">
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
<i class="fa-solid fa-arrow-up mr-1"></i>
</span>
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
<i class="fas fa-reply mr-1"></i> REPLY
</span>
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
<i class="fas fa-comment mr-1"></i> {{ comment.replies }}
</span>
</div>
<small class="text-sm font-action">
<a href="#" class="text-sm hover:underline">{{ comment.author }}</a>
<span class="text-text-muted text-sm opacity-75">{{ comment.date | date: "%d %b %Y" }}</span>
</small>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>