feat: add like count display on homepage and thumbs-up toggle on detail page
- Display like count with thumbs-up emoji on post cards in index.html
- Add clickable like/unlike button with JS fetch on post_detail.html
- Add POST /web/posts/{slug}/like endpoint in web routes for cookie-auth users
- Guests redirected to /auth/dev-login on 401
- Use block extra_js (matching base template) for inline script
This commit is contained in:
@@ -52,6 +52,9 @@
|
||||
<span class="post-card-meta-item" data-testid="post-date-{{ post.id }}">
|
||||
{{ post.created_at.strftime('%B %d, %Y') }}
|
||||
</span>
|
||||
<span class="post-card-meta-item" data-testid="like-count-{{ post.id }}">
|
||||
👍 {{ post.like_count }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="post-card-content" data-testid="post-content-preview-{{ post.id }}">
|
||||
|
||||
Reference in New Issue
Block a user