Mercurial > libervia-templates
changeset 228:3195484abd82
updated identities/avatar use, following backend changes
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 19 Apr 2020 22:48:57 +0200 |
parents | f8f9019425c3 |
children | 739c3e6999fa |
files | sat_templates/templates/default/blog/discover.html sat_templates/templates/default/blog/item.html sat_templates/templates/default/chat/message.html sat_templates/templates/default/components/avatar.html |
diffstat | 4 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/sat_templates/templates/default/blog/discover.html Wed Jan 08 14:31:46 2020 +0100 +++ b/sat_templates/templates/default/blog/discover.html Sun Apr 19 22:48:57 2020 +0200 @@ -18,7 +18,7 @@ <li class='grid__item grid__item--small grid__item--selectable'> <a href="{{entities_url[entity]}}" class="items_vert--centered"> {{ avatar.avatar(entity, class="avatar--medium") }} - <span>{{ identities[entity].nick|default(entity, true) }}</span> + <span>{{ identities[entity].nicknames[0]|default(entity, true) }}</span> </a> </li> {% endfor %}
--- a/sat_templates/templates/default/blog/item.html Wed Jan 08 14:31:46 2020 +0100 +++ b/sat_templates/templates/default/blog/item.html Sun Apr 19 22:48:57 2020 +0200 @@ -42,7 +42,7 @@ {% if avatar is defined %} {{ avatar.avatar(item.author_jid, "avatar--float-left") }} {% endif %} - <span class="blog__author">{{identities[item.author_jid].nick | default(item.author)}}</span> + <span class="blog__author">{{identities[item.author_jid].nicknames[0] | default(item.author)}}</span> {% else %} <span class="blog__author">{{item.author}}</span> {% endif %}
--- a/sat_templates/templates/default/chat/message.html Wed Jan 08 14:31:46 2020 +0100 +++ b/sat_templates/templates/default/chat/message.html Sun Apr 19 22:48:57 2020 +0200 @@ -2,7 +2,7 @@ <p id="{{msg.id}}" class="msg_{{msg.type}} {{'own_msg' if msg.from_ == own_jid.full()}}"> {%- if msg.type != C.MESS_TYPE_INFO %} - {%- set author = identities[msg.from_].nick | default(msg.from_) -%} + {%- set author = identities[msg.from_].nicknames[0] | default(msg.from_) -%} {{ avatar.avatar(msg.from_, "avatar--float-left") }} <span class="msg_header"> <span class="author">{{author}}</span>
--- a/sat_templates/templates/default/components/avatar.html Wed Jan 08 14:31:46 2020 +0100 +++ b/sat_templates/templates/default/components/avatar.html Sun Apr 19 22:48:57 2020 +0200 @@ -1,9 +1,9 @@ {% macro avatar(jid, class) %} {%- if identities is defined -%} {%- if identities[jid].avatar_basename is defined %} - <img class="avatar {{class}}" src="{{cache_path}}{{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].nick|first|upper}}</span></span> + <span class="avatar avatar--generated {{class}}"><span class="avatar__content">{{identities[jid].nicknames[0]|first|upper}}</span></span> {%- endif -%} {%- endif -%} {% endmacro %}