This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/user-summary.js.es6
Régis Hanol e808f7f41e User Summary improvements
Added "Top Links" list
Added "Most Liked By" list

Added "Bookmark count" stat

UX: Use fa heart icon instead of "like" text in stats

Change the order of the user stats
2016-04-13 23:02:51 +02:00

21 lines
692 B
JavaScript

import computed from 'ember-addons/ember-computed-decorators';
// should be kept in sync with 'UserSummary::MAX_SUMMARY_RESULTS'
const MAX_SUMMARY_RESULTS = 6;
// should be kept in sync with 'UserSummary::MAX_BADGES'
const MAX_BADGES = 6;
export default Ember.Controller.extend({
needs: ['user'],
user: Ember.computed.alias('controllers.user.model'),
@computed("model.topics.length")
moreTopics(topicsLength) { return topicsLength >= MAX_SUMMARY_RESULTS; },
@computed("model.replies.length")
moreReplies(repliesLength) { return repliesLength >= MAX_SUMMARY_RESULTS; },
@computed("model.badges.length")
moreBadges(badgesLength) { return badgesLength >= MAX_BADGES; },
});