Mercurial > libervia-templates
annotate default/components/common.html @ 85:05b500bd6235
chat: chat implementation, first draft:
this chat use the new dynamic pages feature. Updates are pushed directly by server.
Identities are used to retrieve avatar, and first letter of nickname is used to generate an avatar is none is found (temporary, a more elaborate avatar generation should follow in the future).
Scroll is done automatically when new messages arrive, except if scroll is not at the end, as it probably means that user is checking history.
User can resize text area and use [shift] + [enter] to enter multi-line messages. History will then scroll to bottom after message has been sent.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 03 Jan 2018 01:12:16 +0100 |
parents | ead4db120515 |
children | 92ca411ee635 |
rev | line source |
---|---|
66 | 1 {# menu labels, map from menu names to labels #} |
2 {% set ml = { | |
76
ead4db120515
components/common: profile is now always set, so we just test if it evaluate to True to know if a user is logged
Goffi <goffi@goffi.org>
parents:
66
diff
changeset
|
3 'login': _('Session') if profile else _('Log in'), |
66 | 4 'blog_view': _('Blog'), |
5 'merge-requests_list': _('Merge requests'), | |
6 'merge-request_new': _('Create new merge request'), | |
7 'tickets_list': _('Tickets'), | |
8 'ticket_new': _('Create new ticket'), | |
85
05b500bd6235
chat: chat implementation, first draft:
Goffi <goffi@goffi.org>
parents:
76
diff
changeset
|
9 'chat': _('Chat'), |
66 | 10 } %} |
11 | |
12 {% macro menu(menus, class='') %} | |
13 <nav class="menu {{class}}"> | |
14 <ul> | |
15 {% for name,url in menus %} | |
16 <li><a class="menu_item button {{name}}" {{ {'href': url}|xmlattr }}>{{ml[name]}}</a></li> | |
17 {% endfor %} | |
18 </ul> | |
19 </nav> | |
20 {% endmacro %} |