recent replies link to user and topic

v1.18.x
Baris Usakli 12 years ago
parent 2f20831d25
commit 68c011ce63

@ -77,11 +77,15 @@
for (var i=0,numPosts=posts.length; i<numPosts; i++) {
var dateString = utils.relativeTime(posts[i].timestamp);
li.setAttribute('data-pid', posts[i].pid);
li.innerHTML = '<img title="' + posts[i].username + '" style="width: 48px; height: 48px; /*temporary*/" class="img-polaroid" src="' + posts[i].picture + '" class="" />' +
'<p>' +
'<strong>' + posts[i].username + '</strong>: ' + posts[i].content +
'</p>' +
'<span>posted ' + utils.relativeTime(posts[i].timestamp) + ' ago</span>';
li.innerHTML = '<a href="/users/' + posts[i].userslug + '"><img title="' + posts[i].username + '" style="width: 48px; height: 48px; /*temporary*/" class="img-polaroid" src="' + posts[i].picture + '" class="" /></a>' +
'<a href="/topic/'+ posts[i].tid + '">' +
'<p>' +
'<strong>' + posts[i].username + '</strong>: ' + posts[i].content +
'</p>' +
'<span>posted ' + utils.relativeTime(posts[i].timestamp) + ' ago</span>' +
'</a>';
frag.appendChild(li.cloneNode(true));
recent_replies.appendChild(frag);

@ -61,7 +61,7 @@ marked.setOptions({
var returnData = [];
function getPostSummary(pid, callback) {
Posts.getPostFields(pid, ['pid', 'content', 'uid', 'timestamp', 'deleted'], function(postData) {
Posts.getPostFields(pid, ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted'], function(postData) {
Posts.addUserInfoToPost(postData, function() {
if(postData.deleted !== '1') {

@ -227,7 +227,9 @@ var user = require('./../user.js'),
user.isFollowing(callerUID, userData.theirid, function(isFollowing) {
posts.getPostsByUid(userData.theirid, 0, 9, function(posts) {
userData.posts = posts.filter(function(p) {return p.deleted !== "1";});
userData.posts = posts.filter(function(p) {
console.log(typeof p.deleted);
return p.deleted !== "1";});
userData.isFollowing = isFollowing;
userData.signature = marked(userData.signature || '');
res.json(userData);

Loading…
Cancel
Save