Move user presence sidebar to a handlebars template.

(imported from commit 1f505bbda4ed67da94db8d97e8e58cb2c462d056)
This commit is contained in:
Tim Abbott 2013-05-22 15:24:34 -04:00 committed by Steve Howell
parent 74cfadfb74
commit 7d20a697d6
2 changed files with 11 additions and 6 deletions

View File

@ -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);
} }

View File

@ -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>