Skip to content

Node.js based forum software built for the modern web

post summary change

Baris Soner Usakli976744480f94
diff --git a/public/templates/account.tpl b/public/templates/account.tpl
index 7b660a185d..24fc37573b 100644
--- a/public/templates/account.tpl
+++ b/public/templates/account.tpl
@@ -140,8 +140,8 @@
<span class="pull-right">
<a href="../../topic/{posts.tid}/#{posts.pid}">[[global:posted]]</a>
[[global:in]]
- <a href="../../category/{posts.categorySlug}">
- <i class="fa {posts.categoryIcon}"></i> {posts.categoryName}
+ <a href="../../category/{posts.category.slug}">
+ <i class="fa {posts.category.icon}"></i> {posts.category.name}
</a>
<span class="timeago" title="{posts.relativeTime}"></span>
</span>
diff --git a/public/templates/accountposts.tpl b/public/templates/accountposts.tpl
index 710b693ba6..a407030ea3 100644
--- a/public/templates/accountposts.tpl
+++ b/public/templates/accountposts.tpl
@@ -25,10 +25,10 @@
<div>
<small>
<span class="pull-right">
- <a href="../../topic/{posts.tid}/#{posts.pid}">[[global:posted]]</a>
+ <a href="../../topic/{posts.topic.slug}#{posts.pid}">[[global:posted]]</a>
[[global:in]]
- <a href="../../category/{posts.categorySlug}">
- <i class="fa {posts.categoryIcon}"></i> {posts.categoryName}
+ <a href="../../category/{posts.category.slug}">
+ <i class="fa {posts.category.icon}"></i> {posts.category.name}
</a>
<span class="timeago" title="{posts.relativeTime}"></span>
</span>
diff --git a/public/templates/favourites.tpl b/public/templates/favourites.tpl
index 273b88cfc5..e793d0475b 100644
--- a/public/templates/favourites.tpl
+++ b/public/templates/favourites.tpl
@@ -25,10 +25,10 @@
<div>
<small>
<span class="pull-right">
- <a href="../../topic/{posts.tid}/#{posts.pid}">posted</a>
- in
- <a href="../../category/{posts.categorySlug}">
- <i class="fa {posts.categoryIcon}"></i> {posts.categoryName}
+ <a href="../../topic/{posts.topic.slug}#{posts.pid}">[[global:posted]]</a>
+ [[global:in]]
+ <a href="../../category/{posts.category.slug}">
+ <i class="fa {posts.category.icon}"></i> {posts.category.name}
</a>
<span class="timeago" title="{posts.relativeTime}"></span>
</span>
diff --git a/public/templates/search.tpl b/public/templates/search.tpl
index 393a6d7e04..ceb1082404 100644
--- a/public/templates/search.tpl
+++ b/public/templates/search.tpl
@@ -61,7 +61,7 @@
<!-- BEGIN posts -->
<div class="topic-row panel panel-default clearfix">
<div class="panel-body">
- <a href="../../topic/{posts.topicSlug}#{posts.pid}" class="search-result-text">
+ <a href="../../topic/{posts.topic.slug}#{posts.pid}" class="search-result-text">
{posts.content}
</a>
@@ -71,10 +71,10 @@
<a href="../../user/{posts.userslug}">
<img title="{posts.username}" class="img-rounded user-img" src="{posts.picture}">
</a>
- <a href="../../topic/{posts.topicSlug}#{posts.pid}">posted</a>
- in
- <a href="../../category/{posts.categorySlug}">
- <i class="fa {posts.categoryIcon}"></i> {posts.categoryName}
+ <a href="../../topic/{posts.topic.slug}#{posts.pid}"> [[global:posted]]</a>
+ [[global:in]]
+ <a href="../../category/{posts.category.slug}">
+ <i class="fa {posts.category.icon}"></i> {posts.category.name}
</a>
<span class="timeago" title="{posts.relativeTime}"></span>
</span>
diff --git a/src/posts.js b/src/posts.js
index ac4a3d5e5a..812f60f78e 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -281,11 +281,9 @@ var db = require('./database'),
return callback(null);
}
categories.getCategoryFields(topicData.cid, ['name', 'icon', 'slug'], function(err, categoryData) {
- postData.categoryName = categoryData.name;
- postData.categoryIcon = categoryData.icon;
- postData.categorySlug = categoryData.slug;
- postData.title = validator.escape(topicData.title);
- postData.topicSlug = topicData.slug;
+ postData.category = categoryData;
+ topicData.title = validator.escape(topicData.title);
+ postData.topic = topicData;
next(null, postData);
});
});