style: Apply merit list style from notifications.liquid

This commit is contained in:
Kerby Martino (aider) committed 2025-05-04 18:49:21 +08:00
1 parent 0d7d7eb159
commit 5259d42716
1 file changed
+35 -46
+35 -46
View File
@@ -149,62 +149,51 @@
{% if user_merit_events.size > 0 %} {% if user_merit_events.size > 0 %}
<ul class="space-y-4"> <ul class="space-y-4">
{% for event in user_merit_events %} {% for event in user_merit_events %}
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50"> <div class="pb-4 mb-4 border-b border-border-light">
<div class="flex-shrink-0 pt-1"> <small class="text-sm mb-1 block">
{% if event.type == 'upvote' %} <a href="/user/{{ event.username }}" class="text-primary font-action hover:underline">{{ event.username }}</a>
<i class="fas fa-arrow-up text-green-500 fa-fw" title="Upvote"></i> <span class="text-text-muted opacity-75">{{ event.action }}</span>
{% elsif event.type == 'comment' %} <a href="{{ event.content_url }}" class="text-primary font-action hover:underline">"{{ event.content_title | truncate: 50 }}"</a>
<i class="fas fa-comment text-blue-500 fa-fw" title="Comment"></i> <span class="text-text-muted text-xs opacity-75 ml-1">{{ event.date | date: "%b %d, %Y %I:%M %p" }}</span>
{% elsif event.type == 'post' %} </small>
<i class="fas fa-file-alt text-purple-500 fa-fw" title="Post"></i>
{% else %}
<i class="fas fa-star text-yellow-500 fa-fw" title="Merit"></i>
{% endif %}
</div> </div>
<div class="flex-grow">
<p class="text-sm font-medium text-primary">
<span class="font-bold text-green-600">+{{ event.amount | default: 1 }} Merit</span>
{% if event.reason %} - {{ event.reason }}{% endif %}
{% if event.content_title %}
on <a href="{{ event.content_url }}" class="hover:underline">"{{ event.content_title | truncate: 50 }}"</a>
{% endif %}
</p>
<p class="text-xs text-text-muted">{{ event.date | date: "%b %d, %Y %I:%M %p" }}</p>
</div>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
<!-- Static Examples for Demonstration --> <!-- Static Examples for Demonstration -->
<ul class="space-y-4"> <ul class="space-y-4">
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50"> <div class="pb-4 mb-4 border-b border-border-light">
<div class="flex-shrink-0 pt-1"><i class="fas fa-arrow-up text-green-500 fa-fw" title="Upvote"></i></div> <small class="text-sm mb-1 block">
<div class="flex-grow"> <a href="/user/user123" class="text-primary font-action hover:underline">user123</a>
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+1 Merit</span> - Upvote received on post <a href="#" class="hover:underline">"Found the perfect focus playlist"</a></p> <span class="text-text-muted opacity-75">upvoted your post:</span>
<p class="text-xs text-text-muted">May 04, 2025 10:30 AM</p> <a href="/single-post/1" class="text-primary font-action hover:underline">"Found the perfect focus playlist"</a>
<span class="text-text-muted text-xs opacity-75 ml-1">May 04, 2025 10:30 AM</span>
</small>
</div> </div>
</li> <div class="pb-4 mb-4 border-b border-border-light">
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50"> <small class="text-sm mb-1 block">
<div class="flex-shrink-0 pt-1"><i class="fas fa-comment text-blue-500 fa-fw" title="Comment"></i></div> <a href="/user/anotherUser" class="text-primary font-action hover:underline">anotherUser</a>
<div class="flex-grow"> <span class="text-text-muted opacity-75">commented on your post:</span>
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+2 Merits</span> - New comment on your post <a href="#" class="hover:underline">"My standing desk setup"</a></p> <a href="/single-post/2" class="text-primary font-action hover:underline">"My standing desk setup"</a>
<p class="text-xs text-text-muted">May 03, 2025 08:15 PM</p> <span class="text-text-muted text-xs opacity-75 ml-1">May 03, 2025 08:15 PM</span>
</small>
</div> </div>
</li> <div class="pb-4 mb-4 border-b border-border-light">
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50"> <small class="text-sm mb-1 block">
<div class="flex-shrink-0 pt-1"><i class="fas fa-file-alt text-purple-500 fa-fw" title="Post"></i></div> <a href="/user/helpfulHannah" class="text-primary font-action hover:underline">helpfulHannah</a>
<div class="flex-grow"> <span class="text-text-muted opacity-75">created a new post:</span>
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+5 Merits</span> - Created new post <a href="#" class="hover:underline">"The best ergonomic accessories..."</a></p> <a href="/single-post/3" class="text-primary font-action hover:underline">"The best ergonomic accessories..."</a>
<p class="text-xs text-text-muted">May 02, 2025 11:00 AM</p> <span class="text-text-muted text-xs opacity-75 ml-1">May 02, 2025 11:00 AM</span>
</small>
</div> </div>
</li> <div class="pb-4 mb-4 border-b border-border-light">
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50"> <small class="text-sm mb-1 block">
<div class="flex-shrink-0 pt-1"><i class="fas fa-arrow-up text-green-500 fa-fw" title="Upvote"></i></div> <a href="/user/techGuru" class="text-primary font-action hover:underline">techGuru</a>
<div class="flex-grow"> <span class="text-text-muted opacity-75">upvoted your comment on:</span>
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+1 Merit</span> - Upvote received on comment for <a href="#" class="hover:underline">"Office plants that actually survive..."</a></p> <a href="/single-post/4#comment-5" class="text-primary font-action hover:underline">"Office plants that actually survive..."</a>
<p class="text-xs text-text-muted">May 01, 2025 09:45 AM</p> <span class="text-text-muted text-xs opacity-75 ml-1">May 01, 2025 09:45 AM</span>
</small>
</div> </div>
</li>
</ul> </ul>
<!-- End Static Examples --> <!-- End Static Examples -->
{% endif %} {% endif %}