mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
Change the way post count metadata is stored
We care about the number of “comment” posts, not the number of posts in total.
This commit is contained in:
@@ -15,11 +15,11 @@ export default Ember.Handlebars.makeBoundHelper(function(time) {
|
||||
var diff = Math.abs(m.diff(moment()));
|
||||
|
||||
if (diff < 60 * minute) {
|
||||
ago = moment.duration(diff).minutes()+'m';
|
||||
ago = moment.duration(diff).minutes()+'m ago';
|
||||
} else if (diff < 24 * hour) {
|
||||
ago = moment.duration(diff).hours()+'h';
|
||||
ago = moment.duration(diff).hours()+'h ago';
|
||||
} else if (diff < 30 * day) {
|
||||
ago = moment.duration(diff).days()+'d';
|
||||
ago = moment.duration(diff).days()+'d ago';
|
||||
} else if (m.year() == moment().year()) {
|
||||
ago = m.format('D MMM');
|
||||
} else {
|
@@ -24,10 +24,10 @@ var Discussion = DS.Model.extend({
|
||||
|
||||
relevantPosts: DS.hasMany('post'),
|
||||
|
||||
postsCount: DS.attr('number'),
|
||||
commentsCount: DS.attr('number'),
|
||||
repliesCount: function() {
|
||||
return Math.max(0, this.get('postsCount') - 1);
|
||||
}.property('postsCount'),
|
||||
return Math.max(0, this.get('commentsCount') - 1);
|
||||
}.property('commentsCount'),
|
||||
|
||||
posts: DS.attr('string'),
|
||||
postIds: function() {
|
||||
|
Reference in New Issue
Block a user