Files
Evection/templates/base.html
T
ksmithandClaude Sonnet 5 cfa64b5485 Rebuild the reader UI to match FreshRSS's two-column layout
The previous UI was plain unstyled lists. Rebuilt around what FreshRSS
actually looks like (per reference screenshots): a persistent left sidebar
(folders/feeds with unread counts, favourites, tags) and a single main
column with a date-grouped article list, where clicking a title expands
the full article inline in place rather than navigating to a separate page.

- apps/core/context_processors.py: feeds the sidebar's folder/feed tree,
  tags, and starred count to every authenticated page in one shared query
  set, so base.html can render it without each view wiring it up.
- apps/reader/views.py: date-grouped stream (itertools.groupby over the
  already-ordered queryset), ?feed=/?folder= scoping alongside the existing
  ?tag=, a bulk mark-all-read endpoint (bulk_create/update, not one
  UserArticleState per article), and article_inline — the htmx endpoint
  behind the inline expand, sharing its mark-read logic with the full
  article_detail view via _load_article_and_mark_read.
- templates/reader/_article_inline.html returns the article content plus
  an out-of-band swap of _article_actions.html, so the row's read/star
  icons update immediately when an article is expanded and marked read.
- static/js/stream.js: the accordion toggle (one article open at a time),
  calling htmx.ajax() directly rather than hx-* attributes so a second
  click on an already-open row can collapse it without re-fetching.
- static/css/base.css: full FreshRSS-like dark theme (with a light
  variant under prefers-color-scheme) replacing the previous unstyled
  pass — sidebar, topbar search, row/icon states, inline-expand styling.

Verified end to end against a running dev server: folder/feed/tag scoping,
mark-all-read, the inline-expand mark-read side effect and its icon
update, and — against config.settings.prod specifically — that no inline
<script> crept back in anywhere (would silently break under the CSP added
in the previous commit) and the CSP header is still present on every page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 21:11:17 -06:00

52 lines
1.8 KiB
HTML

{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Evection{% endblock %}</title>
<link rel="stylesheet" href="{% static 'css/base.css' %}">
<script src="{% static 'js/htmx.min.js' %}" defer></script>
<link rel="manifest" href="{% url 'pwa:manifest' %}">
<meta name="theme-color" content="#111111">
<link rel="icon" href="{% static 'pwa/icons/icon-192.png' %}">
<link rel="apple-touch-icon" href="{% static 'pwa/icons/apple-touch-icon.png' %}">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Evection">
</head>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
{% if user.is_authenticated %}
<div class="app-shell">
{% include "core/_sidebar.html" %}
<div class="app-main">
<header class="app-topbar">
<form method="get" action="{% url 'search:search' %}" class="topbar-search">
<input type="search" name="q" placeholder="Search words or #tags" aria-label="Search">
</form>
</header>
{% endif %}
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li class="message message-{{ message.tags }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
<main class="{% if user.is_authenticated %}app-content{% else %}auth-content{% endif %}">
{% block content %}{% endblock %}
</main>
{% if user.is_authenticated %}
</div>
</div>
{% endif %}
<script src="{% static 'js/stream.js' %}" defer></script>
<script src="{% static 'js/register-sw.js' %}" defer></script>
</body>
</html>