From aa856e2f5c2519d9f84776711fe922a5297e764f Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Fri, 31 Jan 2014 12:22:59 -0500 Subject: [PATCH] closes #847 --- public/src/forum/category.js | 27 ++------------------------- public/templates/recentreplies.tpl | 2 +- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/public/src/forum/category.js b/public/src/forum/category.js index a720f8b715..0621b68019 100644 --- a/public/src/forum/category.js +++ b/public/src/forum/category.js @@ -166,11 +166,10 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { var recentReplies = $('#category_recent_replies'); - - // doesnt work see https://github.com/designcreateplay/NodeBB/issues/893 - /* templates.preload_template('recentreplies', function() { + templates['recentreplies'].parse({posts:[]}); + var html = templates.prepare(templates['recentreplies'].blocks['posts']).parse({ posts: posts }); @@ -182,28 +181,6 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { app.createUserTooltips(); }); }); - */ - - var replies = ''; - for (var i = 0, numPosts = posts.length; i < numPosts; ++i) { - - replies += '
  • ' + - '' + - ''+ posts[i].username + '' + - '

    ' + posts[i].content + '

    ' + - ''+ - '[[category:posted]] '+ - '' + - ''+ - '
  • '; - } - - translator.translate(replies, function(translatedHTML) { - recentReplies.html(translatedHTML); - - $('#category_recent_replies span.timeago').timeago(); - app.createUserTooltips(); - }); }; return Category; diff --git a/public/templates/recentreplies.tpl b/public/templates/recentreplies.tpl index b1e7951e50..121211c3d6 100644 --- a/public/templates/recentreplies.tpl +++ b/public/templates/recentreplies.tpl @@ -5,7 +5,7 @@ {posts.username} -

    posts.content

    +

    {posts.content}

    [[category:posted]]