mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
Merge pull request #538 from draco2003/add_fav_context
add breadcrumb like context to favorites
This commit is contained in:
@@ -13,7 +13,8 @@
|
|||||||
<!-- BEGIN posts -->
|
<!-- BEGIN posts -->
|
||||||
<div class="topic-row img-thumbnail clearfix" topic-url="topic/{posts.tid}/#{posts.pid}">
|
<div class="topic-row img-thumbnail clearfix" topic-url="topic/{posts.tid}/#{posts.pid}">
|
||||||
<span><strong>{posts.username}</strong> : </span>
|
<span><strong>{posts.username}</strong> : </span>
|
||||||
<span>{posts.content}</span>
|
<span>{posts.category_name} >> {posts.title}</span>
|
||||||
|
<div>{posts.content}</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="pull-right timeago" title="{posts.relativeTime}"></span>
|
<span class="pull-right timeago" title="{posts.relativeTime}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
13
src/posts.js
13
src/posts.js
@@ -2,6 +2,7 @@ var RDB = require('./redis.js'),
|
|||||||
utils = require('./../public/src/utils.js'),
|
utils = require('./../public/src/utils.js'),
|
||||||
user = require('./user.js'),
|
user = require('./user.js'),
|
||||||
topics = require('./topics.js'),
|
topics = require('./topics.js'),
|
||||||
|
categories = require('./categories.js'),
|
||||||
favourites = require('./favourites.js'),
|
favourites = require('./favourites.js'),
|
||||||
threadTools = require('./threadTools.js'),
|
threadTools = require('./threadTools.js'),
|
||||||
postTools = require('./postTools'),
|
postTools = require('./postTools'),
|
||||||
@@ -13,6 +14,7 @@ var RDB = require('./redis.js'),
|
|||||||
postSearch = reds.createSearch('nodebbpostsearch'),
|
postSearch = reds.createSearch('nodebbpostsearch'),
|
||||||
nconf = require('nconf'),
|
nconf = require('nconf'),
|
||||||
meta = require('./meta.js'),
|
meta = require('./meta.js'),
|
||||||
|
validator = require('validator'),
|
||||||
winston = require('winston');
|
winston = require('winston');
|
||||||
|
|
||||||
(function(Posts) {
|
(function(Posts) {
|
||||||
@@ -271,12 +273,15 @@ var RDB = require('./redis.js'),
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(postData, next) {
|
function(postData, next) {
|
||||||
topics.getTopicFields(postData.tid, ['slug', 'deleted'], function(err, topicData) {
|
topics.getTopicFields(postData.tid, ['title', 'cid', 'slug', 'deleted'], function(err, topicData) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
else if (topicData.deleted === '1') return callback(null);
|
else if (topicData.deleted === '1') return callback(null);
|
||||||
|
categories.getCategoryField(topicData.cid, 'name', function(err, categoryData) {
|
||||||
postData.topicSlug = topicData.slug;
|
postData.category_name = categoryData;
|
||||||
next(null, postData);
|
postData.title = validator.sanitize(topicData.title).escape();
|
||||||
|
postData.topicSlug = topicData.slug;
|
||||||
|
next(null, postData);
|
||||||
|
})
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(postData, next) {
|
function(postData, next) {
|
||||||
|
|||||||
Reference in New Issue
Block a user