mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
template changes to recent and unread
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
<div class="{topic_row_size}">
|
||||
<ul id="topics-container">
|
||||
<!-- BEGIN topics -->
|
||||
<a href="../../topic/{topics.slug}" id="tid-{topics.tid}">
|
||||
<li class="category-item {topics.deleted-class}">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xs-12 topic-row img-thumbnail">
|
||||
@@ -39,6 +38,12 @@
|
||||
<span class="topic-stats">
|
||||
<span class="badge {topics.badgeclass}">{topics.viewcount}</span> views
|
||||
</span>
|
||||
|
|
||||
<span> posted in
|
||||
<a href="../../category/{topics.categorySlug}">
|
||||
<i class="{topics.categoryIcon}"></i> {topics.categoryName}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<span class="pull-right hidden-xs">
|
||||
<a href="/user/{topics.userslug}">
|
||||
@@ -61,12 +66,9 @@
|
||||
</a>
|
||||
</span>
|
||||
</small>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
<!-- END topics -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<div class="{topic_row_size}">
|
||||
<ul id="topics-container" data-next-start="{nextStart}">
|
||||
<!-- BEGIN topics -->
|
||||
<a href="../../topic/{topics.slug}" id="tid-{topics.tid}">
|
||||
<li class="category-item {topics.deleted-class}">
|
||||
<div class="row">
|
||||
<div class="col-md-12 topic-row">
|
||||
@@ -33,6 +32,12 @@
|
||||
<span class="topic-stats">
|
||||
<span class="badge {topics.badgeclass}">{topics.viewcount}</span> views
|
||||
</span>
|
||||
|
|
||||
<span> posted in
|
||||
<a href="../../category/{topics.categorySlug}">
|
||||
<i class="{topics.categoryIcon}"></i> {topics.categoryName}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<span class="pull-right hidden-xs">
|
||||
<a href="/user/{topics.userslug}">
|
||||
@@ -58,7 +63,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
<!-- END topics -->
|
||||
</ul>
|
||||
<button id="load-more-btn" class="btn btn-primary hide">[[unread:load_more]]</button>
|
||||
|
||||
@@ -310,13 +310,7 @@ var RDB = require('./redis.js'),
|
||||
};
|
||||
|
||||
Categories.getCategoryFields = function(cid, fields, callback) {
|
||||
RDB.hmgetObject('category:' + cid, fields, function(err, data) {
|
||||
if (err === null) {
|
||||
callback(data);
|
||||
} else {
|
||||
winston.err(err);
|
||||
}
|
||||
});
|
||||
RDB.hmgetObject('category:' + cid, fields, callback);
|
||||
};
|
||||
|
||||
Categories.setCategoryField = function(cid, field, value) {
|
||||
|
||||
@@ -306,7 +306,14 @@ var RDB = require('./redis.js'),
|
||||
});
|
||||
}
|
||||
|
||||
async.parallel([getUserInfo, hasReadTopic, getTeaserInfo, getPrivileges], function(err, results) {
|
||||
function getCategoryInfo(next) {
|
||||
categories.getCategoryFields(topicData.cid, ['name', 'slug', 'icon'], function(err, categoryData) {
|
||||
console.log(categoryData);
|
||||
next(err, categoryData);
|
||||
});
|
||||
}
|
||||
|
||||
async.parallel([getUserInfo, hasReadTopic, getTeaserInfo, getPrivileges, getCategoryInfo], function(err, results) {
|
||||
callback({
|
||||
username: results[0].username,
|
||||
userslug: results[0].userslug,
|
||||
@@ -314,7 +321,8 @@ var RDB = require('./redis.js'),
|
||||
userbanned: results[0].banned,
|
||||
hasread: results[1],
|
||||
teaserInfo: results[2],
|
||||
privileges: results[3]
|
||||
privileges: results[3],
|
||||
categoryData: results[4]
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -339,13 +347,15 @@ var RDB = require('./redis.js'),
|
||||
topicData.username = topicInfo.username;
|
||||
topicData.userslug = topicInfo.userslug;
|
||||
topicData.picture = topicInfo.picture;
|
||||
topicData.categoryIcon = topicInfo.categoryData.icon;
|
||||
topicData.categoryName = topicInfo.categoryData.name;
|
||||
topicData.categorySlug = topicInfo.categoryData.slug;
|
||||
topicData.badgeclass = (topicInfo.hasread && current_user != 0) ? '' : 'badge-important';
|
||||
topicData.teaser_text = topicInfo.teaserInfo.text || '',
|
||||
topicData.teaser_username = topicInfo.teaserInfo.username || '';
|
||||
topicData.teaser_userslug = topicInfo.teaserInfo.userslug || '';
|
||||
topicData.teaser_userpicture = topicInfo.teaserInfo.picture || require('gravatar').url('', {}, https = nconf.get('https'));
|
||||
topicData.teaser_pid = topicInfo.teaserInfo.pid;
|
||||
|
||||
topicData.teaser_timestamp = topicInfo.teaserInfo.timestamp ? (new Date(parseInt(topicInfo.teaserInfo.timestamp, 10)).toISOString()) : '';
|
||||
|
||||
if (isTopicVisible(topicData, topicInfo))
|
||||
|
||||
Reference in New Issue
Block a user