diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index de66493..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index 14735c6..cf61e4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules .discourse-site +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 860cc5f..4c36f48 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/javascripts/discourse/components/top-contributors.hbs b/javascripts/discourse/components/top-contributors.hbs index b819846..17ade1f 100644 --- a/javascripts/discourse/components/top-contributors.hbs +++ b/javascripts/discourse/components/top-contributors.hbs @@ -1,5 +1,5 @@

- {{theme-i18n "top_contributors.heading"}} + {{this.blockTitle}}

diff --git a/javascripts/discourse/components/top-contributors.js b/javascripts/discourse/components/top-contributors.js index a686962..0f4d7dc 100644 --- a/javascripts/discourse/components/top-contributors.js +++ b/javascripts/discourse/components/top-contributors.js @@ -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; @@ -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);