Mercurial > libervia-templates
changeset 233:1215a6e2385f
components/avatar: fixed avatar if `identity.avatar_basename` is None
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 19 May 2020 18:40:53 +0200 (2020-05-19) |
parents | 741dae9b0612 |
children | b54526baef6b |
files | sat_templates/templates/bulma/components/avatar.html sat_templates/templates/default/components/avatar.html |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/sat_templates/templates/bulma/components/avatar.html Tue May 19 18:40:02 2020 +0200 +++ b/sat_templates/templates/bulma/components/avatar.html Tue May 19 18:40:53 2020 +0200 @@ -1,7 +1,7 @@ {% macro avatar(jid, class="is-48x48") %} {%- if identities is defined -%} {% set identity = identities[jid] %} - {%- if identity.avatar_basename is defined %} + {%- if identity.avatar_basename %} <div class="is-avatar image {{class}}"> <img src="/cache/common/{{identities[jid].avatar_basename}}"> </div>
--- a/sat_templates/templates/default/components/avatar.html Tue May 19 18:40:02 2020 +0200 +++ b/sat_templates/templates/default/components/avatar.html Tue May 19 18:40:53 2020 +0200 @@ -1,6 +1,6 @@ {% macro avatar(jid, class) %} {%- if identities is defined -%} - {%- if identities[jid].avatar_basename is defined %} + {%- if identities[jid].avatar_basename %} <img class="avatar {{class}}" src="/cache/common/{{identities[jid].avatar_basename}}"> {% else %} <span class="avatar avatar--generated {{class}}"><span class="avatar__content">{{identities[jid].nicknames[0]|first|upper}}</span></span>