|
|
|
@ -36,7 +36,8 @@ define('forum/categories', ['components', 'translator', 'benchpress'], function
|
|
|
|
|
|
|
|
|
|
var recentPosts = category.find('[component="category/posts"]');
|
|
|
|
|
|
|
|
|
|
parseAndTranslate([post], function (html) {
|
|
|
|
|
app.parseAndTranslate('partials/categories/lastpost', 'posts', { posts: [post] }, function (html) {
|
|
|
|
|
html.find('.post-content img:not(.not-responsive)').addClass('img-responsive');
|
|
|
|
|
html.hide();
|
|
|
|
|
if (recentPosts.length === 0) {
|
|
|
|
|
html.appendTo(category);
|
|
|
|
@ -57,16 +58,5 @@ define('forum/categories', ['components', 'translator', 'benchpress'], function
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseAndTranslate(posts, callback) {
|
|
|
|
|
Benchpress.parse('partials/categories/lastpost', 'posts', { posts: posts }, function (html) {
|
|
|
|
|
translator.translate(html, function (translatedHTML) {
|
|
|
|
|
translatedHTML = $(translatedHTML);
|
|
|
|
|
translatedHTML.find('.post-content img:not(.not-responsive)').addClass('img-responsive');
|
|
|
|
|
|
|
|
|
|
callback(translatedHTML);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return categories;
|
|
|
|
|
});
|
|
|
|
|