Resolve PR review gaps across comments, security, feeds, and UX
This commit is contained in:
@@ -11,9 +11,25 @@
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
<section>
|
||||
<h2>Filter by tag</h2>
|
||||
<a href="/articles/" {% if not active_tag %}aria-current="page"{% endif %}>All</a>
|
||||
{% for tag in available_tags %}
|
||||
<a href="/articles/?tag={{ tag.slug }}" {% if active_tag == tag.slug %}aria-current="page"{% endif %}>{{ tag.name }}</a>
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% for article in articles %}
|
||||
{% include 'components/article_card.html' with article=article %}
|
||||
{% empty %}
|
||||
<p>No articles found.</p>
|
||||
{% endfor %}
|
||||
<nav aria-label="Pagination">
|
||||
{% if articles.has_previous %}
|
||||
<a href="?page={{ articles.previous_page_number }}{% if active_tag %}&tag={{ active_tag }}{% endif %}">Previous</a>
|
||||
{% endif %}
|
||||
<span>Page {{ articles.number }} of {{ paginator.num_pages }}</span>
|
||||
{% if articles.has_next %}
|
||||
<a href="?page={{ articles.next_page_number }}{% if active_tag %}&tag={{ active_tag }}{% endif %}">Next</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
@@ -44,6 +44,31 @@
|
||||
</aside>
|
||||
{% if page.comments_enabled %}
|
||||
<section>
|
||||
<h2>Comments</h2>
|
||||
{% for comment in approved_comments %}
|
||||
<article id="comment-{{ comment.id }}">
|
||||
<p><strong>{{ comment.author_name }}</strong></p>
|
||||
<p>{{ comment.body }}</p>
|
||||
{% for reply in comment.replies.all %}
|
||||
<article id="comment-{{ reply.id }}">
|
||||
<p><strong>{{ reply.author_name }}</strong></p>
|
||||
<p>{{ reply.body }}</p>
|
||||
</article>
|
||||
{% endfor %}
|
||||
<form method="post" action="{% url 'comment_post' %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="article_id" value="{{ page.id }}" />
|
||||
<input type="hidden" name="parent_id" value="{{ comment.id }}" />
|
||||
<input type="text" name="author_name" required />
|
||||
<input type="email" name="author_email" required />
|
||||
<textarea name="body" required></textarea>
|
||||
<input type="text" name="honeypot" style="display:none" />
|
||||
<button type="submit">Reply</button>
|
||||
</form>
|
||||
</article>
|
||||
{% empty %}
|
||||
<p>No comments yet.</p>
|
||||
{% endfor %}
|
||||
<form method="post" action="{% url 'comment_post' %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="article_id" value="{{ page.id }}" />
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
<a href="/">Home</a>
|
||||
<a href="/articles/">Articles</a>
|
||||
<a href="/about/">About</a>
|
||||
<button type="button" onclick="toggleTheme()">Toggle theme</button>
|
||||
{% include 'components/newsletter_form.html' with source='nav' label='Get updates' %}
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user