From 7d20a697d6873f870af325ba71c06b00c9100fea Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 22 May 2013 15:24:34 -0400 Subject: [PATCH] Move user presence sidebar to a handlebars template. (imported from commit 1f505bbda4ed67da94db8d97e8e58cb2c462d056) --- zephyr/static/js/ui.js | 12 ++++++------ zephyr/static/templates/user_presence_row.handlebars | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 zephyr/static/templates/user_presence_row.handlebars diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index 7624864126..248cbde1a1 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -1523,14 +1523,14 @@ exports.set_presence_list = function (users, presence_info) { $('#user_presences').empty(); function add_entry(name, email, type) { - var entry = $('
  • ') - .append($('').attr({href: '#', 'data-email': email}) - .text(name)) - .addClass('user_' + type) - .attr('title', name + presence_descriptions[type]); + var args = {name: name, + type: type, + type_desc: presence_descriptions[type], + email: 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); } diff --git a/zephyr/static/templates/user_presence_row.handlebars b/zephyr/static/templates/user_presence_row.handlebars new file mode 100644 index 0000000000..d2f0e98973 --- /dev/null +++ b/zephyr/static/templates/user_presence_row.handlebars @@ -0,0 +1,5 @@ +{{! User Presence rows }} +
  • +{{name}} +