refactor: Align non-JS comments page structure and style

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2025-12-04 18:29:41 +00:00
parent 274b4065e2
commit b185ecfe81

View File

@@ -52,9 +52,17 @@
<div class="article-container"> <div class="article-container">
<div class="article"> <div class="article">
<h1>{{ story.title }}</h1> <h1>{{ story.title }}</h1>
{% if show_comments %}
<div class="info">
<a href="/{{ story.id }}">View article</a>
</div>
{% else %}
<div class="info"> <div class="info">
Source: <a class="source" href="{{ story.url or story.link }}">{{ url }}</a> Source: <a class="source" href="{{ story.url or story.link }}">{{ url }}</a>
</div> </div>
{% endif %}
<div class="info"> <div class="info">
{{ story.score }} points {{ story.score }} points
by <a href="{{ story.author_link }}">{{ story.author }}</a> by <a href="{{ story.author_link }}">{{ story.author }}</a>
@@ -68,9 +76,13 @@
<div class="story-text">{{ story.text | safe }}</div> <div class="story-text">{{ story.text | safe }}</div>
{% elif show_comments %} {% elif show_comments %}
{% macro render_comment(comment, level) %} {% macro render_comment(comment, level) %}
<div class="comment" style="margin-left: {{ level * 20 }}px"> <div class="comment{% if level > 0 %} lined{% endif %}">
<div class="c-info"><a href="{{ comment.author_link }}">{{ comment.author }}</a></div> <div class="info">
<div class="c-text">{{ comment.text | safe }}</div> <p>
{% if comment.author == story.author %}[OP] {% endif %}{{ comment.author or '[Deleted]' }}
</p>
</div>
<div class="text">{{ (comment.text | safe) if comment.text else '<p>[Empty / deleted comment]</p>' }}</div>
{% for reply in comment.comments %} {% for reply in comment.comments %}
{{ render_comment(reply, level + 1) }} {{ render_comment(reply, level + 1) }}
{% endfor %} {% endfor %}