Skip to content

Node.js based forum software built for the modern web

if a thread is unreplied, don't show the OP as the last person to reply

psychobunny46bad118de4e
diff --git a/public/src/templates.js b/public/src/templates.js
index d36941bf72..a5750c0a04 100644
--- a/public/src/templates.js
+++ b/public/src/templates.js
@@ -305,7 +305,7 @@
template = setBlock(regex, block, template);
} else {
var conditional = makeConditionalRegex(namespace + d);
-
+
var conditionalBlock = conditional.exec(template);
if (conditionalBlock !== null) {
diff --git a/public/templates/category.tpl b/public/templates/category.tpl
index d9cc68626d..370f934514 100644
--- a/public/templates/category.tpl
+++ b/public/templates/category.tpl
@@ -62,6 +62,9 @@
</span>
<span class="pull-right hidden-xs">
+ <!-- IF topics.unreplied -->
+ No one has replied
+ <!-- ELSE -->
<a href="/user/{topics.teaser_userslug}">
<img class="teaser-pic" src="{topics.teaser_userpicture}" title="{topics.teaser_username}"/>
</a>
@@ -69,7 +72,7 @@
replied
</a>
<span class="timeago" title="{topics.teaser_timestamp}"></span>
-
+ <!-- ENDIF topics.unreplied -->
</span>
</small>
</div>
diff --git a/src/topics.js b/src/topics.js
index 6f210b25dd..89eb940c6d 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -442,6 +442,7 @@ var RDB = require('./redis.js'),
topicData['lock-icon'] = topicData.locked === '1' ? 'icon-lock' : 'none';
topicData['deleted-class'] = topicData.deleted === '1' ? 'deleted' : '';
+ topicData.unreplied = topicData.postcount === '1';
topicData.username = topicInfo.username;
topicData.userslug = topicInfo.userslug;
topicData.picture = topicInfo.picture;
@@ -524,6 +525,7 @@ var RDB = require('./redis.js'),
'slug': topicData.slug,
'postcount': topicData.postcount,
'viewcount': topicData.viewcount,
+ 'unreplied': topicData.postcount > 1,
'topic_id': tid,
'expose_tools': privileges.editable ? 1 : 0,
'posts': topicPosts,