Files
Evection/templates/core/dashboard.html
T
ksmithandClaude Sonnet 5 fd68400822 Render article/feed times in the viewer's local timezone, client-side
Everything is stored and server-rendered in UTC (config.settings.base's
TIME_ZONE), so article times, the article detail header, and the
dashboard's "last fetched" column were always showing UTC regardless of
where the viewer actually is.

Article/feed timestamps now render as <time datetime="..."> elements
carrying the UTC instant plus a UTC-formatted fallback as their initial
text; static/js/localize-times.js reformats them using the browser's
own timezone via toLocaleString(), both on page load and after every
htmx swap (pagination, the inline article expand, the dashboard's retry
action all inject new <time> elements without a full page load).

No server-side change needed — this doesn't touch the (currently
unused) per-user timezone field, and works correctly even if the
viewer travels or changes their system timezone, with no settings page
required. Verified live in the browser against a UTC-stored timestamp
rendering correctly shifted to the sandbox's local zone.

Known related issue, out of scope here: the stream's "Received
today/yesterday" date-group headers (apps.reader.views._group_by_date)
are still computed server-side via timezone.localdate(), which is also
effectively UTC — an article just before/after UTC midnight could land
in a date group that doesn't match its now-correctly-localized
time-of-day. Flagged for the user rather than fixed, since correcting
it properly would mean moving date-grouping to the client too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-31 13:31:07 -06:00

56 lines
1.8 KiB
HTML

{% extends "base.html" %}
{% block title %}Dashboard — Evection{% endblock %}
{% block content %}
<h1>Dashboard</h1>
<ul class="dashboard-stats">
<li>{{ stats.feed_count }} feed(s) — {{ stats.active_feed_count }} active</li>
<li>{{ stats.subscription_count }} subscription(s)</li>
<li>{{ stats.article_count }} article(s)</li>
<li>{{ stats.error_feed_count }} feed(s) currently erroring</li>
</ul>
<h2>Feeds with errors</h2>
{% if erroring_feeds %}
<table class="feed-error-table">
<thead>
<tr>
<th>Feed</th>
<th>Subscribers</th>
<th>Status</th>
<th>Error count</th>
<th>Last fetched</th>
<th>Last error</th>
<th></th>
</tr>
</thead>
<tbody>
{% for feed in erroring_feeds %}
<tr>
<td><a href="{{ feed.site_url|default:feed.feed_url }}">{{ feed.title|default:feed.feed_url }}</a></td>
<td>{{ feed.subscriber_count }}</td>
<td>{{ feed.get_last_fetch_status_display }}</td>
<td>{{ feed.fetch_error_count }}</td>
<td>
{% if feed.last_fetched_at %}
<time datetime="{{ feed.last_fetched_at|date:"c" }}" data-local-format="long">{{ feed.last_fetched_at|date:"M j, Y H:i" }}</time>
{% else %}
never
{% endif %}
</td>
<td>{{ feed.last_error_message|default:"—" }}</td>
<td>
<form method="post" action="{% url 'core:retry_feed' feed.id %}">
{% csrf_token %}
<button type="submit">Retry now</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No feeds are currently erroring.</p>
{% endif %}
{% endblock %}