Private
Public Access
Implements the main reader surface: a filterable stream (Unread/All/ Starred/Saved) built on the lazy UserArticleState query pattern, an article detail view that marks articles read on open, and htmx-backed read/star/save-for-later toggles that update in place without a full page reload. Rule-hidden articles are excluded from every filter. Vendors htmx locally rather than loading it from a CDN, and adds mobile-first responsive CSS (verified at 375px width in-browser, plus dark mode via prefers-color-scheme). Verified live against the real Hacker News feed subscribed in the previous milestone: ingestion, filter switching, read/star/save toggles, and article detail all confirmed working in the browser, with two UI bugs fixed along the way (low-contrast message banners in dark mode, horizontal overflow from long URLs in article content). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
21 lines
875 B
HTML
21 lines
875 B
HTML
<div id="article-actions-{{ article.pk }}" class="article-actions">
|
|
<button
|
|
hx-post="{% url 'reader:toggle_read' article.pk %}"
|
|
hx-target="#article-actions-{{ article.pk }}"
|
|
hx-swap="outerHTML"
|
|
class="icon-btn{% if article.is_read %} active{% endif %}"
|
|
title="Toggle read">{% if article.is_read %}Read{% else %}Unread{% endif %}</button>
|
|
<button
|
|
hx-post="{% url 'reader:toggle_star' article.pk %}"
|
|
hx-target="#article-actions-{{ article.pk }}"
|
|
hx-swap="outerHTML"
|
|
class="icon-btn{% if article.is_starred %} active{% endif %}"
|
|
title="Toggle star">★</button>
|
|
<button
|
|
hx-post="{% url 'reader:toggle_saved' article.pk %}"
|
|
hx-target="#article-actions-{{ article.pk }}"
|
|
hx-swap="outerHTML"
|
|
class="icon-btn{% if article.is_saved_for_later %} active{% endif %}"
|
|
title="Save for later">🔖</button>
|
|
</div>
|