mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
got rid of all templates.prepare; pull blocks using templates.getBlock instead of parsing twice
This commit is contained in:
@@ -59,11 +59,8 @@ define(function() {
|
||||
return;
|
||||
}
|
||||
|
||||
templates.preload_template('users', function() {
|
||||
templates['users'].parse({users:[]});
|
||||
var html = templates.prepare(templates['users'].blocks['users']).parse({
|
||||
users: data.users
|
||||
});
|
||||
ajaxify.loadTemplate('users', function(usersTemplate) {
|
||||
var html = templates.parse(templates.getBlock(usersTemplate, 'topics'), data);
|
||||
|
||||
translator.translate(html, function(translated) {
|
||||
$('#users-container').html(translated);
|
||||
@@ -111,11 +108,8 @@ define(function() {
|
||||
}
|
||||
|
||||
function onUsersLoaded(users, emptyContainer) {
|
||||
templates.preload_template('users', function() {
|
||||
templates['users'].parse({users:[]});
|
||||
var html = templates.prepare(templates['users'].blocks['users']).parse({
|
||||
users: users
|
||||
});
|
||||
ajaxify.loadTemplate('users', function(usersTemplate) {
|
||||
var html = templates.parse(templates.getBlock(usersTemplate, 'users'), {users: users});
|
||||
|
||||
translator.translate(html, function(translated) {
|
||||
if(emptyContainer) {
|
||||
|
||||
Reference in New Issue
Block a user