Mercurial > libervia-templates
comparison default/chat/message.html @ 117:5992b774a6a4
chat/message, input/avatar: moved avatar template in a dedicated macro.
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 30 Jan 2018 07:47:26 +0100 |
parents | 05b500bd6235 |
children |
comparison
equal
deleted
inserted
replaced
116:da8f1ba9034d | 117:5992b774a6a4 |
---|---|
1 {% import 'components/avatar.html' as avatar with context %} | |
2 | |
1 <p id="{{msg.id}}" class="msg_{{msg.type}} {{'own_msg' if msg.from_ == own_jid.full()}}"> | 3 <p id="{{msg.id}}" class="msg_{{msg.type}} {{'own_msg' if msg.from_ == own_jid.full()}}"> |
2 {%- if msg.type != C.MESS_TYPE_INFO %} | 4 {%- if msg.type != C.MESS_TYPE_INFO %} |
3 {%- set author = identities[msg.from_].nick | default(msg.from_) -%} | 5 {%- set author = identities[msg.from_].nick | default(msg.from_) -%} |
4 {%- if identities[msg.from_].avatar_basename is defined %} | 6 {{ avatar.avatar(msg.from_) }} |
5 <img class="avatar" src="{{cache_path}}{{identities[msg.from_].avatar_basename}}"> | |
6 {% else %} | |
7 <span class="avatar generated">{{author|first|upper}}</span> | |
8 {%- endif -%} | |
9 <span class="msg_header"> | 7 <span class="msg_header"> |
10 <span class="author">{{author}}</span> | 8 <span class="author">{{author}}</span> |
11 <span class="date">{{msg.timestamp|date_fmt('auto_day')}}</span> | 9 <span class="date">{{msg.timestamp|date_fmt('auto_day')}}</span> |
12 </span> | 10 </span> |
13 {% endif -%} | 11 {% endif -%} |