Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.discourse-site
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You can control some features for the provided blocks via parameters.
| id | leaderboard id | | number | minimal-gamification-leaderboard |
| tag | which tag to display | | tag id | tag-topics |
| period | time period of top topics | weekly | all, yearly, quarterly, monthly, weekly, daily | top-topics |
| title | title of the block | varies | string | tag-topics, category-list |
| title | title of the block | varies | string | tag-topics, category-list, top-contributors |
| excludedGroupNames | Excludes specified groups | | Group names | top-contributors |
| order | Orders the contributors | likes_received | String (likes_received or likes_given) | top-contributors |
| period | Time period for top contributors | yearly | all, yearly, quarterly, monthly, weekly, daily | top-contributors |
Expand Down
2 changes: 1 addition & 1 deletion javascripts/discourse/components/top-contributors.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3 class="top-contributors-heading">
{{theme-i18n "top_contributors.heading"}}
{{this.blockTitle}}
</h3>

<div class="top-contributors--container">
Expand Down
3 changes: 3 additions & 0 deletions javascripts/discourse/components/top-contributors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { ajax } from "discourse/lib/ajax";
import { i18n } from "discourse-i18n";

export default class TopContributors extends Component {
@tracked topContributors = null;
Expand All @@ -11,6 +12,8 @@ export default class TopContributors extends Component {

constructor() {
super(...arguments);
this.blockTitle =
this.args?.params?.title || i18n(themePrefix("top_contributors.heading"));

ajax(this.requestURL).then((data) => {
this.topContributors = data.directory_items?.slice(0, this.count);
Expand Down