From 6b7b328c66a460c60e839b13c8111cfb2c0fd139 Mon Sep 17 00:00:00 2001 From: Vikhyat Korrapati Date: Mon, 19 May 2014 10:23:11 +0530 Subject: [PATCH] Badges page ordering and titles. --- .../javascripts/discourse/controllers/badges/index.js.es6 | 4 ++++ .../javascripts/discourse/routes/badges_index_route.js | 5 +++++ app/assets/javascripts/discourse/routes/badges_show_route.js | 1 + 3 files changed, 10 insertions(+) create mode 100644 app/assets/javascripts/discourse/controllers/badges/index.js.es6 diff --git a/app/assets/javascripts/discourse/controllers/badges/index.js.es6 b/app/assets/javascripts/discourse/controllers/badges/index.js.es6 new file mode 100644 index 00000000000..7a52169dd08 --- /dev/null +++ b/app/assets/javascripts/discourse/controllers/badges/index.js.es6 @@ -0,0 +1,4 @@ +export default Ember.ArrayController.extend({ + sortProperties: ['displayName'], + sortAscending: true +}); diff --git a/app/assets/javascripts/discourse/routes/badges_index_route.js b/app/assets/javascripts/discourse/routes/badges_index_route.js index 520677d24ee..f7bf2667471 100644 --- a/app/assets/javascripts/discourse/routes/badges_index_route.js +++ b/app/assets/javascripts/discourse/routes/badges_index_route.js @@ -15,5 +15,10 @@ Discourse.BadgesIndexRoute = Discourse.Route.extend({ } else { return Discourse.Badge.findAll(); } + }, + + setupController: function(controller, model) { + controller.set('model', model); + Discourse.set('title', I18n.t('badges.title')); } }); diff --git a/app/assets/javascripts/discourse/routes/badges_show_route.js b/app/assets/javascripts/discourse/routes/badges_show_route.js index a4c4cc83180..842bf36e324 100644 --- a/app/assets/javascripts/discourse/routes/badges_show_route.js +++ b/app/assets/javascripts/discourse/routes/badges_show_route.js @@ -27,6 +27,7 @@ Discourse.BadgesShowRoute = Ember.Route.extend({ controller.set('userBadgesLoaded', true); }); controller.set('model', model); + Discourse.set('title', model.get('displayName')); }, actions: {