From 4ae19c6fa773ab1b0fb96a3beecb2778fd52477c Mon Sep 17 00:00:00 2001 From: Stephen Burgess Date: Mon, 11 Jun 2018 18:30:31 -0500 Subject: [PATCH] feat(Posts): Show username if no display name is present --- templates/posts/details.html.tera | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/templates/posts/details.html.tera b/templates/posts/details.html.tera index 5c658d37..e126f223 100644 --- a/templates/posts/details.html.tera +++ b/templates/posts/details.html.tera @@ -9,8 +9,13 @@ {% endblock header %} {% block content %} +{% if author.display_name %} + {% set name = author.display_name %} +{% else %} + {% set name = author.username %} +{% endif %}

- Written by {{ author.display_name }} + Written by {{name }}{{ date | date(format="%B %e, %Y") }}

@@ -49,8 +54,13 @@

Comments

{% for comment in comments %} + {% if comment.author.display_name %} + {% set commentAuthorName = comment.author.display_name %} + {% else %} + {% set commentAuthorName = comment.author.username %} + {% endif %}
- {{ comment.author.display_name }} + {{ name }}
{{ comment.content | safe }}
Respond