mirror of
https://github.com/discourse/discourse.git
synced 2025-02-14 20:22:45 +08:00
15 lines
754 B
JavaScript
15 lines
754 B
JavaScript
export function categoryLinkHTML(category, options) {
|
|
var categoryOptions = {};
|
|
if (options.hash) {
|
|
if (options.hash.allowUncategorized) { categoryOptions.allowUncategorized = true; }
|
|
if (options.hash.showParent) { categoryOptions.showParent = true; }
|
|
if (options.hash.onlyStripe) { categoryOptions.onlyStripe = true; }
|
|
if (options.hash.link !== undefined) { categoryOptions.link = options.hash.link; }
|
|
if (options.hash.extraClasses) { categoryOptions.extraClasses = options.hash.extraClasses; }
|
|
if (options.hash.categories) {
|
|
categoryOptions.categories = Em.Handlebars.get(this, options.hash.categories, options);
|
|
}
|
|
}
|
|
return new Handlebars.SafeString(Discourse.HTML.categoryBadge(category, categoryOptions));
|
|
}
|