diff --git a/.discourse-compatibility b/.discourse-compatibility new file mode 100644 index 0000000..9d40fd3 --- /dev/null +++ b/.discourse-compatibility @@ -0,0 +1 @@ +2.8.0.beta1: d9ed154f9887dcf48e648d7fa8af76c65caa5006 \ No newline at end of file diff --git a/javascripts/discourse/initializers/user-card-directory.js.es6 b/javascripts/discourse/initializers/user-card-directory.js.es6 index 409efca..6100e42 100644 --- a/javascripts/discourse/initializers/user-card-directory.js.es6 +++ b/javascripts/discourse/initializers/user-card-directory.js.es6 @@ -29,34 +29,12 @@ export default { this._super(...arguments); }, - stats: [ - { name: "likes_received", icon: "heart" }, - { name: "likes_given", icon: "heart" }, - { name: "topic_count" }, - { name: "post_count" }, - { name: "topics_entered" }, - { name: "posts_read" }, - { name: "days_visited" } - ], - - @discourseComputed("site.groups") - availableGroups(groups) { - return groups - .map(g => { - // prevents group "everyone" to be listed - if (g.id !== 0) { - return { name: g.name, value: g.name }; - } - }) - .filter(Boolean); - }, - @discourseComputed("model.content.@each") userCards(allUsers) { if (!allUsers) return []; const toLoad = []; if (settings.hide_current_user && this.currentUser) { - allUsers = allUsers.filter((u) => u.id !== this.currentUser.id) + allUsers = allUsers.filter((u) => u.id !== this.currentUser.id); } const userCardInfos = allUsers.map(u => { if (this.cachedUserCardInfo[u.id]) { diff --git a/javascripts/discourse/templates/users.hbs b/javascripts/discourse/templates/users.hbs index 271f9df..3ba2129 100644 --- a/javascripts/discourse/templates/users.hbs +++ b/javascripts/discourse/templates/users.hbs @@ -2,8 +2,7 @@ {{#load-more selector=".user-card-directory .user-card-container" action=(action "loadMore")}}
{{i18n "directory.no_results"}}
{{/if}} {{/conditional-loading-spinner}} diff --git a/locales/en.yml b/locales/en.yml index f10a209..2bdb2ee 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -3,4 +3,5 @@ en: description: Replaces the user directory with a grid of user cards settings: hide_current_user: Always hide the current user from the grid + show_stats: Show statistics under each user card filter_by_group: filter by group diff --git a/settings.yml b/settings.yml index 2ad2763..7fb3489 100644 --- a/settings.yml +++ b/settings.yml @@ -1 +1,2 @@ hide_current_user: false +show_stats: true