1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +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:
Toby Zerner
2015-01-16 17:10:54 +10:30
parent 67afcbf641
commit 1f54876705
7 changed files with 17 additions and 17 deletions

View File

@@ -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 {

View File

@@ -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() {