Files
Evection/templates/base.html
T
ksmithandClaude Sonnet 5.5 2a3e9f632e Make the banner and sidebar counts live on every page
One 5-minute poll (/new-since/) now drives the new-articles banner, the
tab dot and the sidebar counts, across all subscriptions rather than the
selected feed/tag. The banner lives in the base layout with a
server-rendered baseline id and reloads the current view on click; new
articles are never inserted automatically.

Sidebar counts are patched in place by the poll, and immediately after
reading or starring (HX-Trigger: countsChanged). Ingestion, filter rules
and subscription changes now drop the cached counts instead of waiting
out the TTL.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 07:39:36 -07:00

68 lines
2.7 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>
<script src="{% static 'js/theme-init.js' %}"></script>
<link rel="manifest" href="{% url 'pwa:manifest' %}">
<meta name="theme-color" content="#0f2038">
<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 %}">
{% if user.is_authenticated %}
<button type="button" class="new-articles-banner" data-stream-url="{% url 'reader:stream' %}" hidden></button>
{% else %}
<div class="auth-brand">
<img src="{% static 'img/brand-full-dark.png' %}" alt="Evection" class="brand-wordmark-dark">
<img src="{% static 'img/brand-full-light.png' %}" alt="Evection" class="brand-wordmark-light">
</div>
{% endif %}
{% block content %}{% endblock %}
</main>
{% if user.is_authenticated %}
</div>
</div>
{% endif %}
<script src="{% static 'js/stream.js' %}" defer></script>
<script src="{% static 'js/localize-times.js' %}" defer></script>
<script src="{% static 'js/date-groups.js' %}" defer></script>
{% if user.is_authenticated %}
<script src="{% static 'js/theme.js' %}" defer></script>
<script src="{% static 'js/sidebar-state.js' %}" defer></script>
<script src="{% static 'js/live-updates.js' %}" data-url="{% url 'reader:new_since' %}" data-since="{{ latest_article_id }}" defer></script>
{% endif %}
<script src="{% static 'js/register-sw.js' %}" defer></script>
</body>
</html>