mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 07:50:37 +01:00
feat: do not show the replies container in a post's footer if the only reply present is the next post
This commit is contained in:
@@ -27,8 +27,10 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
increment,
|
||||
generateRepliedTo,
|
||||
generateWrote,
|
||||
register,
|
||||
isoTimeToLocaleString,
|
||||
shouldHideReplyContainer,
|
||||
|
||||
register,
|
||||
__escape: identity,
|
||||
};
|
||||
|
||||
@@ -342,6 +344,14 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
return new Date(isoTime).toLocaleString().replace(/,/g, ',');
|
||||
}
|
||||
|
||||
function shouldHideReplyContainer(post) {
|
||||
if (post.replies.count <= 0 || post.replies.hasSingleImmediateReply) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function register() {
|
||||
Object.keys(helpers).forEach(function (helperName) {
|
||||
Benchpress.registerHelper(helperName, helpers[helperName]);
|
||||
|
||||
Reference in New Issue
Block a user