Private
Public Access
Fix inline article expand and back-to-stream scope in production
Clicking an article title opened the detail page instead of expanding it inline, and "Back to stream" then reset to every feed. Cause: the title (and the new-articles banner) used inline onclick= handlers, which production's CSP (script-src 'self') blocks — dev sends no CSP, so it worked there. The title link just fell through to its href. Behavior moves to delegated listeners in static/js/stream.js (modified clicks still open in a new tab). A test now fails if any template gains an inline on*= handler. The stream also passes its filter/tag/feed scope through the article link so the detail page's back link returns to it. Verified in a dev server enforcing the same CSP: title click expands and collapses in place, URL unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
37e658c49a
commit
7afda7d0ba
6 files changed
+71
-11
No files matched your search
@@ -6,9 +6,8 @@
|
||||
<img src="{{ article.feed.favicon_url }}" alt="" class="feed-favicon">
|
||||
{% endif %}
|
||||
<span class="article-feed-name">{{ article.feed.title|default:article.feed.feed_url }}</span>
|
||||
<a href="{% url 'reader:article_detail' article.pk %}" class="article-title"
|
||||
data-inline-url="{% url 'reader:article_inline' article.pk %}"
|
||||
onclick="return toggleArticle(event, {{ article.pk }})">{{ article.title|default:"(untitled)" }}</a>
|
||||
<a href="{% url 'reader:article_detail' article.pk %}{% if scope_qs %}?{{ scope_qs }}{% endif %}" class="article-title"
|
||||
data-inline-url="{% url 'reader:article_inline' article.pk %}">{{ article.title|default:"(untitled)" }}</a>
|
||||
{% if article.published_at %}
|
||||
<time class="article-time" datetime="{{ article.published_at|date:"c" }}" data-local-format="short">{{ article.published_at|date:"g:i A" }}</time>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% if new_count %}
|
||||
<button type="button" class="new-articles-banner" onclick="location.reload()">
|
||||
<button type="button" class="new-articles-banner">
|
||||
{{ new_count }} new article{{ new_count|pluralize }} — click to show
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{{ article.title|default:"Article" }} — Evection{% endblock %}
|
||||
{% block content %}
|
||||
<p><a href="{% url 'reader:stream' %}">← Back to stream</a></p>
|
||||
<p><a href="{% url 'reader:stream' %}{% if back_qs %}?{{ back_qs }}{% endif %}">← Back to stream</a></p>
|
||||
<article>
|
||||
{% include "reader/_article_actions.html" %}
|
||||
{% include "reader/_article_content.html" %}
|
||||
|
||||
Reference in new issue
Block a user