From 87b4cd33233577e85829f7e0c3faf5f00a388989 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 29 Apr 2014 16:17:43 -0400 Subject: [PATCH] FIX: Don't show `undefined` query params --- .../discourse/controllers/site_map_controller.js | 9 ++------- .../templates/site_map/_latest_topics_link.js.handlebars | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/site_map_controller.js b/app/assets/javascripts/discourse/controllers/site_map_controller.js index 18f105068e3..a5a5bfeb643 100644 --- a/app/assets/javascripts/discourse/controllers/site_map_controller.js +++ b/app/assets/javascripts/discourse/controllers/site_map_controller.js @@ -1,13 +1,8 @@ Discourse.SiteMapController = Ember.ArrayController.extend(Discourse.HasCurrentUser, { itemController: "siteMapCategory", - showAdminLinks: function() { - return this.get("currentUser.staff"); - }.property("currentUser.staff"), - - flaggedPostsCount: function() { - return this.get("currentUser.site_flagged_posts_count"); - }.property("currentUser.site_flagged_posts_count"), + showAdminLinks: Em.computed.alias('currentUser.staff'), + flaggedPostsCount: Em.computed.alias("currentUser.site_flagged_posts_count"), faqUrl: function() { return Discourse.SiteSettings.faq_url ? Discourse.SiteSettings.faq_url : Discourse.getURL('/faq'); diff --git a/app/assets/javascripts/discourse/templates/site_map/_latest_topics_link.js.handlebars b/app/assets/javascripts/discourse/templates/site_map/_latest_topics_link.js.handlebars index 1989d56f8c5..f83cd32c303 100644 --- a/app/assets/javascripts/discourse/templates/site_map/_latest_topics_link.js.handlebars +++ b/app/assets/javascripts/discourse/templates/site_map/_latest_topics_link.js.handlebars @@ -1 +1 @@ -{{#titledLinkTo "discovery.latest" titleKey="filters.latest.help" class="latest-topics-link"}}{{i18n filters.latest.title}}{{/titledLinkTo}} +{{#titledLinkTo "discovery.latest" (query-params ascending="false" order="default") titleKey="filters.latest.help" class="latest-topics-link"}}{{i18n filters.latest.title}}{{/titledLinkTo}}