Skip to content

Commit 29d3ea2

Browse files
committed
fix: Improve author display formatting and refactor issue link rendering in magazine article summary
1 parent c9c2482 commit 29d3ea2

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

magazine/templates/magazine/magazine_article_summary.html

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ <h3 class="card-title">
1414
<span class="font-medium">Author(s):</span>
1515
{% for author in author_links %}
1616
{% if author.author.live %}
17-
<a href="{% pageurl author.author %}">{{ author.author }}</a>{% if not forloop.last %},{% endif %}
17+
<a href="{% pageurl author.author %}">{{ author.author }}</a>{% if not forloop.last %}, {% endif %}
1818
{% else %}
19-
{{ author.author }}{% if not forloop.last %},{% endif %}
19+
{{ author.author }}{% if not forloop.last %}, {% endif %}
2020
{% endif %}
2121
{% endfor %}
2222
</div>
@@ -27,12 +27,19 @@ <h3 class="card-title">
2727
{{ article.teaser|richtext }}
2828
</div>
2929

30-
<div class="card-actions">
31-
<span>
32-
Issue: <a href="{% pageurl article.get_parent %}" class="link">
33-
{{ article.get_parent }} ({{ article.get_parent.specific.publication_date|date:"F Y" }})
34-
</a>
35-
</span>
36-
</div>
30+
{% with issue=article.get_parent %}
31+
<div class="card-actions">
32+
<span>
33+
Issue: <a href="{% pageurl issue %}" class="link">
34+
{{ issue }}
35+
{% if issue.specific.publication_date %}
36+
(<time datetime="{{ issue.specific.publication_date|date:'Y-m-d' }}">
37+
{{ issue.specific.publication_date|date:"F Y" }}
38+
</time>)
39+
{% endif %}
40+
</a>
41+
</span>
42+
</div>
43+
{% endwith %}
3744
</div>
3845
</article>

0 commit comments

Comments
 (0)