FIX: Build dynamic category / tag routes
This commit is contained in:
parent
1625b08c86
commit
f9fe9ac3ed
|
@ -1,12 +1,13 @@
|
||||||
import buildCategoryRoute from 'discourse/routes/build-category-route';
|
import buildCategoryRoute from 'discourse/routes/build-category-route';
|
||||||
import buildTopicRoute from 'discourse/routes/build-topic-route';
|
import buildTopicRoute from 'discourse/routes/build-topic-route';
|
||||||
import DiscoverySortableController from 'discourse/controllers/discovery-sortable';
|
import DiscoverySortableController from 'discourse/controllers/discovery-sortable';
|
||||||
|
import TagsShowRoute from 'discourse/routes/tags-show';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
after: 'inject-discourse-objects',
|
after: 'inject-discourse-objects',
|
||||||
name: 'dynamic-route-builders',
|
name: 'dynamic-route-builders',
|
||||||
|
|
||||||
initialize(container, app) {
|
initialize(registry, app) {
|
||||||
app.DiscoveryCategoryController = DiscoverySortableController.extend();
|
app.DiscoveryCategoryController = DiscoverySortableController.extend();
|
||||||
app.DiscoveryParentCategoryController = DiscoverySortableController.extend();
|
app.DiscoveryParentCategoryController = DiscoverySortableController.extend();
|
||||||
app.DiscoveryCategoryNoneController = DiscoverySortableController.extend();
|
app.DiscoveryCategoryNoneController = DiscoverySortableController.extend();
|
||||||
|
@ -58,5 +59,14 @@ export default {
|
||||||
app[`DiscoveryTop${periodCapitalized}ParentCategoryRoute`] = buildCategoryRoute('top/' + period);
|
app[`DiscoveryTop${periodCapitalized}ParentCategoryRoute`] = buildCategoryRoute('top/' + period);
|
||||||
app[`DiscoveryTop${periodCapitalized}CategoryNoneRoute`] = buildCategoryRoute('top/' + period, {no_subcategories: true});
|
app[`DiscoveryTop${periodCapitalized}CategoryNoneRoute`] = buildCategoryRoute('top/' + period, {no_subcategories: true});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app["TagsShowCategoryRoute"] = TagsShowRoute.extend();
|
||||||
|
app["TagsShowParentCategoryRoute"] = TagsShowRoute.extend();
|
||||||
|
|
||||||
|
site.get('filters').forEach(function(filter) {
|
||||||
|
app["TagsShow" + filter.capitalize() + "Route"] = TagsShowRoute.extend({ filterMode: filter });
|
||||||
|
app["TagsShowCategory" + filter.capitalize() + "Route"] = TagsShowRoute.extend({ filterMode: filter });
|
||||||
|
app["TagsShowParentCategory" + filter.capitalize() + "Route"] = TagsShowRoute.extend({ filterMode: filter });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue