user status: Show status in user info popovers.

This commit is contained in:
Steve Howell 2019-02-01 01:33:01 +00:00 committed by Tim Abbott
parent 150d9c9d3e
commit ab8b50453b
3 changed files with 14 additions and 0 deletions

View File

@ -6,6 +6,7 @@ zrequire('narrow');
zrequire('narrow_state'); zrequire('narrow_state');
zrequire('people'); zrequire('people');
zrequire('presence'); zrequire('presence');
zrequire('user_status');
var noop = function () {}; var noop = function () {};
$.fn.popover = noop; // this will get wrapped by our code $.fn.popover = noop; // this will get wrapped by our code
@ -102,6 +103,11 @@ run_test('sender_hover', () => {
sender_id: alice.user_id, sender_id: alice.user_id,
}; };
user_status.set_status_text({
user_id: alice.user_id,
status_text: 'on the beach',
});
var target = $.create('click target'); var target = $.create('click target');
target.offset = () => { target.offset = () => {
@ -160,6 +166,7 @@ run_test('sender_hover', () => {
is_active: true, is_active: true,
is_bot: undefined, is_bot: undefined,
is_sender_popover: true, is_sender_popover: true,
status_text: 'on the beach',
}); });
return 'content-html'; return 'content-html';

View File

@ -147,6 +147,7 @@ function render_user_info_popover(user, popover_element, is_sender_popover, priv
user_last_seen_time_status: user_last_seen_time_status(user.user_id), user_last_seen_time_status: user_last_seen_time_status(user.user_id),
user_time: people.get_user_time(user.user_id), user_time: people.get_user_time(user.user_id),
user_type: people.get_user_type(user.user_id), user_type: people.get_user_type(user.user_id),
status_text: user_status.get_status_text(user.user_id),
}; };
popover_element.popover({ popover_element.popover({

View File

@ -24,6 +24,12 @@
<li class="user_popover_email half-opacity italic">{{#tr this}}(This user has been deactivated){{/tr}}</li> <li class="user_popover_email half-opacity italic">{{#tr this}}(This user has been deactivated){{/tr}}</li>
{{/if}} {{/if}}
{{#if status_text}}
<li class="user_info_status_text">
{{status_text}}
</li>
{{/if}}
{{#if user_time}} {{#if user_time}}
<li>{{ user_time }} {{#tr this}}Local time{{/tr}}</li> <li>{{ user_time }} {{#tr this}}Local time{{/tr}}</li>
{{/if}} {{/if}}