added tag input box to composer when creating a topic
added new routes for viewing tags 'tags' and 'tags/:tagname'
respectively
post_bar.tpl shows the tags of the topic
can edit the main post to remove or add new tags
added a new menu item to header to go to the tags page
This commit is contained in:
barisusakli
2014-05-21 16:13:46 -04:00
parent 1d7c293197
commit df73ceaeb7
20 changed files with 400 additions and 19 deletions

View File

@@ -49,7 +49,7 @@ var stopTracking = function(replyObj) {
};
SocketModules.composer.push = function(socket, pid, callback) {
posts.getPostFields(pid, ['content'], function(err, postData) {
posts.getPostFields(pid, ['content', 'tid'], function(err, postData) {
if(err || (!postData && !postData.content)) {
return callback(err || new Error('[[error:invalid-pid]]'));
}
@@ -58,6 +58,9 @@ SocketModules.composer.push = function(socket, pid, callback) {
topic: function(next) {
topics.getTopicDataByPid(pid, next);
},
tags: function(next) {
topics.getTopicTags(postData.tid, next);
},
index: function(next) {
posts.getPidIndex(pid, next);
}
@@ -71,6 +74,7 @@ SocketModules.composer.push = function(socket, pid, callback) {
body: postData.content,
title: results.topic.title,
topic_thumb: results.topic.thumb,
tags: results.tags,
index: results.index
});
});