mirror of https://github.com/zulip/zulip.git
Move user presence sidebar to a handlebars template.
(imported from commit 1f505bbda4ed67da94db8d97e8e58cb2c462d056)
This commit is contained in:
parent
74cfadfb74
commit
7d20a697d6
|
@ -1523,14 +1523,14 @@ exports.set_presence_list = function (users, presence_info) {
|
||||||
$('#user_presences').empty();
|
$('#user_presences').empty();
|
||||||
|
|
||||||
function add_entry(name, email, type) {
|
function add_entry(name, email, type) {
|
||||||
var entry = $('<li>')
|
var args = {name: name,
|
||||||
.append($('<a>').attr({href: '#', 'data-email': email})
|
type: type,
|
||||||
.text(name))
|
type_desc: presence_descriptions[type],
|
||||||
.addClass('user_' + type)
|
email: email};
|
||||||
.attr('title', name + presence_descriptions[type]);
|
|
||||||
if (email === this.email) {
|
if (email === this.email) {
|
||||||
entry.addClass('my_fullname');
|
args.my_fullname = true;
|
||||||
}
|
}
|
||||||
|
var entry = templates.render('user_presence_row', args);
|
||||||
$('#user_presences').append(entry);
|
$('#user_presences').append(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{{! User Presence rows }}
|
||||||
|
<li class="user_sidebar_entry user_{{type}}">
|
||||||
|
<a href="#" data-email="{{email}}" title="{{name}} {{type_desc}}"
|
||||||
|
class="{{#if my_fullname}} my_fullname{{/if}}">{{name}}</a>
|
||||||
|
</li>
|
Loading…
Reference in New Issue