mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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() {
|
titleToken() {
|
||||||
const category = this.currentModel.category,
|
const category = this.currentModel.category;
|
||||||
filterText = I18n.t(
|
|
||||||
"filters." + this.filter(category).replace("/", ".") + ".title"
|
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", {
|
return I18n.t("filters.with_category", {
|
||||||
filter: filterText,
|
filter: filterText,
|
||||||
category: category.get("name")
|
category: categoryName
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user