This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/routes/users.js.es6
Régis Hanol 35e6e5ff67 FIX: footer was missing in some pages
- error pages
- search results pages
- list of all tags
- topics list of a specific tag
- user leaderboard
2015-08-05 16:14:26 +02:00

44 lines
986 B
JavaScript

export default Discourse.Route.extend({
queryParams: {
period: { refreshModel: true },
order: { refreshModel: true },
asc: { refreshModel: true },
name: { refreshModel: true, replace: true }
},
refreshQueryWithoutTransition: true,
titleToken() {
return I18n.t("directory.title");
},
resetController(controller, isExiting) {
if (isExiting) {
controller.setProperties({
period: "weekly",
order: "likes_received",
asc: null,
name: ""
});
}
},
model(params) {
// If we refresh via `refreshModel` set the old model to loading
this._params = params;
return this.store.find("directoryItem", params);
},
setupController(controller, model) {
const params = this._params;
controller.setProperties({ model, period: params.period, nameInput: params.name });
},
actions: {
didTransition() {
this.controllerFor("users")._showFooter();
return true;
}
}
});