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:
2026-05-10 19:12:50 +03:00
parent 3cf6c94da2
commit c8e19e3ce5
3 changed files with 83 additions and 0 deletions

View File

@@ -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 }}">