mirror of https://github.com/zulip/zulip.git
Use handlebars for bot rows.
(imported from commit 0dfdb5dd49ec9e553bee0ef837b1010288cb1ea4)
This commit is contained in:
parent
433f5daef5
commit
9f95f3f07b
|
@ -3,16 +3,14 @@ var settings = (function () {
|
|||
var exports = {};
|
||||
|
||||
function add_bot_row(name, email, avatar_url, api_key) {
|
||||
var avatar_cell;
|
||||
var info = {
|
||||
name: name,
|
||||
email: email,
|
||||
avatar_url: avatar_url,
|
||||
api_key: api_key
|
||||
};
|
||||
|
||||
avatar_cell = $('<img>').attr('src', avatar_url).attr('class', 'avatar');
|
||||
|
||||
var row = $('<li>').append(
|
||||
$('<span>').html(avatar_cell),
|
||||
$('<span>').text(name),
|
||||
$('<span>').text(email),
|
||||
$('<span class="api_key">').text(api_key)
|
||||
);
|
||||
var row = $(templates.render('bot_avatar_row', info));
|
||||
$('#bots_list').append(row);
|
||||
$('#bots_list').show();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<li>
|
||||
<span><img src="{{avatar_url}}" class=avatar></span>
|
||||
<span>{{name}}</span>
|
||||
<span>{{email}}</span>
|
||||
<span class="api_key">{{api_key}}</span>
|
||||
</li>
|
Loading…
Reference in New Issue