removed graph/picture, closes #72

v1.18.x
Baris Soner Usakli 12 years ago
parent 9f892c2e80
commit 62ef925fd3

@ -39,7 +39,7 @@ define(['taskbar'], function(taskbar) {
composer.taskbar.push('composer', uuid, {
title: (!threadData.cid ? (threadData.title || '') : 'New Topic'),
icon: '/graph/users/' + threadData.username + '/picture'
icon: threadData.picture
});
composer.posts[uuid] = {

@ -29,7 +29,7 @@
<div class="span12 topic-row img-polaroid">
<div class="latest-post visible-desktop">
<div class="pull-right">
<img style="width: 48px; height: 48px; /*temporary*/" src="../../graph/users/{topics.teaser_username}/picture" />
<img style="width: 48px; height: 48px; /*temporary*/" src="{topics.teaser_userpicture}" />
<p><strong>{topics.teaser_username}</strong>: {topics.teaser_text}</p>
<span>posted {topics.teaser_timestamp} ago</span>
</div>
@ -73,7 +73,7 @@
</div>
<div class="block-content">
<!-- BEGIN active_users -->
<a href="/users/{active_users.userslug}"><img title="{active_users.username}" src="../../graph/users/{active_users.username}/picture" class="img-polaroid" /></a>
<a href="/users/{active_users.userslug}"><img title="{active_users.username}" src="{active_users.picture}" class="img-polaroid" /></a>
<!-- END active_users -->
</div>
</div>
@ -83,7 +83,7 @@
</div>
<div class="block-content">
<!-- BEGIN moderators -->
<a href="/users/{moderators.userslug}"><img title="{moderators.username}" src="../../graph/users/{active_users.username}/picture" class="img-polaroid" /></a>
<a href="/users/{moderators.userslug}"><img title="{moderators.username}" src="{moderators.picture}" class="img-polaroid" /></a>
<!-- END moderators -->
</div>
</div>

@ -27,7 +27,7 @@
<div class="span12 topic-row img-polaroid">
<div class="latest-post visible-desktop">
<div class="pull-right">
<img style="width: 48px; height: 48px; /*temporary*/" src="graph/users/{topics.teaser_username}/picture" />
<img style="width: 48px; height: 48px; /*temporary*/" src="{topics.teaser_userpicture}" />
<p><strong>{topics.teaser_username}</strong>: {topics.teaser_text}</p>
<span>posted {topics.teaser_timestamp} ago</span>
</div>

@ -58,7 +58,7 @@ var RDB = require('./redis.js'),
}
function getActiveUsers(next) {
user.getMultipleUserFields(active_users, ['username', 'userslug'], function(users) {
user.getMultipleUserFields(active_users, ['username', 'userslug', 'picture'], function(users) {
next(null, users);
});
}
@ -180,6 +180,7 @@ var RDB = require('./redis.js'),
topicData.badgeclass = (topicInfo.hasread && current_user != 0) ? '' : 'badge-important';
topicData.teaser_text = topicInfo.teaserInfo.text,
topicData.teaser_username = topicInfo.teaserInfo.username;
topicData.teaser_userpicture = topicInfo.teaserInfo.picture;
topicData.teaser_timestamp = utils.relativeTime(topicInfo.teaserInfo.timestamp);
if (isTopicVisible(topicData, topicInfo))

@ -305,7 +305,7 @@ marked.setOptions({
posts.getPostFields(pid, ['content', 'uid', 'timestamp'], function(postData) {
user.getUserField(postData.uid, 'username', function(username) {
user.getUserFields(postData.uid, ['username', 'picture'], function(userData) {
var stripped = postData.content,
timestamp = postData.timestamp;
@ -314,7 +314,8 @@ marked.setOptions({
callback({
"text": stripped,
"username": username,
"username": userData.username,
"picture": userData.picture,
"timestamp" : timestamp
});
});

@ -258,27 +258,6 @@ var express = require('express'),
});
});
//START TODO: MOVE TO GRAPH.JS
app.get('/graph/users/:username/picture', function(req, res) {
user.get_uid_by_username(req.params.username, function(uid) {
if (uid == null) {
res.json({
status: 0
});
return;
}
user.getUserField(uid, 'picture', function(picture) {
if (picture == null) res.redirect('http://www.gravatar.com/avatar/a938b82215dfc96c4cabeb6906e5f953&default=identicon');
res.redirect(picture);
});
});
});
//END TODO: MOVE TO GRAPH.JS
app.get('/test', function(req, res) {
console.log('derp');
@ -381,6 +360,7 @@ var express = require('express'),
break;
case 'category' :
categories.getCategoryById(req.params.id, uid, function(data) {
console.log(data);
res.json(data);
}, req.params.id, uid);
break;

@ -417,11 +417,12 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
});
});
} else if (parseInt(data.cid) > 0) {
user.getUserField(uid, 'username', function(username) {
user.getUserFields(uid, ['username', 'picture'], function(userData) {
socket.emit('api:composer.push', {
tid: 0,
cid: data.cid,
username: username,
username: userData.username,
picture: userData.picture,
title: undefined
});
});

Loading…
Cancel
Save