style: Match non-JS article page styling and layout to JS version

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

View File

@@ -49,13 +49,12 @@
</div>
<div id="root">
{% if story %}
<div class="container article">
<div class="header">
{% if show_comments %}
<h1>{{ story.title }}</h1>
{% else %}
<h1><a href="{{ story.url or story.link }}">{{ story.title }}</a></h1>
{% endif %}
<div class="article-container">
<div class="article">
<h1>{{ story.title }}</h1>
<div class="info">
Source: <a class="source" href="{{ story.url or story.link }}">{{ url }}</a>
</div>
<div class="info">
{{ story.score }} points
by <a href="{{ story.author_link }}">{{ story.author }}</a>
@@ -64,30 +63,31 @@
{{ story.num_comments }} comment{{ 's' if story.num_comments != 1 }}
</a>
</div>
<div class='dot toggleDot'>
<div class='button'>
<a href="/{{ story.id }}{{ '/c' if not show_comments else '' }}">
{{ '' if not show_comments else '' }}
</a>
{% if not show_comments and story.text %}
<div class="story-text">{{ story.text | safe }}</div>
{% elif show_comments %}
{% macro render_comment(comment, level) %}
<div class="comment" style="margin-left: {{ level * 20 }}px">
<div class="c-info"><a href="{{ comment.author_link }}">{{ comment.author }}</a></div>
<div class="c-text">{{ comment.text | safe }}</div>
{% for reply in comment.comments %}
{{ render_comment(reply, level + 1) }}
{% endfor %}
</div>
{% endmacro %}
<div class="comments">
{% for comment in story.comments %}{{ render_comment(comment, 0) }}{% endfor %}
</div>
{% endif %}
</div>
<div class='dot toggleDot'>
<div class='button'>
<a href="/{{ story.id }}{{ '/c' if not show_comments else '' }}">
{{ '' if not show_comments else '' }}
</a>
</div>
</div>
{% if not show_comments %}
<div class="text">{{ story.text | safe }}</div>
{% else %}
{% macro render_comment(comment, level) %}
<div class="comment" style="margin-left: {{ level * 20 }}px">
<div class="c-info"><a href="{{ comment.author_link }}">{{ comment.author }}</a></div>
<div class="c-text">{{ comment.text | safe }}</div>
{% for reply in comment.comments %}
{{ render_comment(reply, level + 1) }}
{% endfor %}
</div>
{% endmacro %}
<div class="comments">
{% for comment in story.comments %}{{ render_comment(comment, 0) }}{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
</div>