User comments
This commit is contained in:
@@ -3,13 +3,20 @@
|
||||
<div class="flex items-start justify-between">
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="mb-1">
|
||||
<span class="text-sm font-medium text-gray-900">
|
||||
{% if let Some(name) = comment.author %}
|
||||
{{ name }}
|
||||
{% else %}
|
||||
Anonymous
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if let Some(user_id) = comment.user_id %}
|
||||
<a href="/users/{{ comment.username.as_ref().unwrap() }}"
|
||||
class="font-semibold text-blue-600 hover:text-blue-800 hover:underline">
|
||||
{{ comment.username.as_ref().unwrap() }}
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="font-medium text-gray-600">
|
||||
{% if let Some(name) = comment.author %}
|
||||
{{ name }}
|
||||
{% else %}
|
||||
Anonymous
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<p class="text-sm text-gray-700 mb-2 line-clamp-2">{{ comment.content }}</p>
|
||||
<div class="flex items-center text-xs text-gray-500 mb-1">
|
||||
@@ -17,8 +24,7 @@
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<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"/>
|
||||
<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>
|
||||
<time datetime="{{ comment.published_at }}">
|
||||
{{ comment.formatted_date() }}
|
||||
@@ -26,9 +32,8 @@
|
||||
</div>
|
||||
<div class="flex items-center text-xs text-gray-500">
|
||||
<span class="mr-1">on</span>
|
||||
<a href="/posts/{{ comment.post_id }}" class="text-blue-600 hover:underline truncate">
|
||||
#{{ comment.post_id }}
|
||||
</a>
|
||||
<a href="/posts/{{ comment.post_id }}"
|
||||
class="text-blue-600 hover:underline truncate">#{{ comment.post_id }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<button hx-delete="/admin/comments/{{ comment.comment_id }}"
|
||||
@@ -40,9 +45,8 @@
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<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"/>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user