mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 05:32:44 +08:00
FIX: shows parent category name in title anchor (#7576)
This commit is contained in:
parent
8360415453
commit
236adc9ccb
|
@ -110,14 +110,22 @@ export default (filterArg, params) => {
|
|||
},
|
||||
|
||||
titleToken() {
|
||||
const category = this.currentModel.category,
|
||||
filterText = I18n.t(
|
||||
"filters." + this.filter(category).replace("/", ".") + ".title"
|
||||
);
|
||||
const category = this.currentModel.category;
|
||||
|
||||
const filterText = I18n.t(
|
||||
"filters." + this.filter(category).replace("/", ".") + ".title"
|
||||
);
|
||||
|
||||
let categoryName = category.name;
|
||||
if (category.parent_category_id) {
|
||||
const list = Category.list();
|
||||
const parentCategory = list.findBy("id", category.parent_category_id);
|
||||
categoryName = `${parentCategory.name}/${categoryName}`;
|
||||
}
|
||||
|
||||
return I18n.t("filters.with_category", {
|
||||
filter: filterText,
|
||||
category: category.get("name")
|
||||
category: categoryName
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user