From c2e3c868838e367015bf82c4111c73ee6d8a0492 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Sun, 19 Apr 2015 13:52:10 -0400 Subject: [PATCH] FIX: broken header links when using relative_url_root --- .../discourse/controllers/notification.js.es6 | 4 ++-- .../discourse/controllers/notifications.js.es6 | 4 +++- .../discourse/controllers/site-map.js.es6 | 2 +- .../discourse/templates/notifications.hbs | 2 +- .../javascripts/discourse/templates/site-map.hbs | 12 ++++++++---- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/notification.js.es6 b/app/assets/javascripts/discourse/controllers/notification.js.es6 index 256eccf9c21..ceb4816b149 100644 --- a/app/assets/javascripts/discourse/controllers/notification.js.es6 +++ b/app/assets/javascripts/discourse/controllers/notification.js.es6 @@ -20,7 +20,7 @@ export default ObjectController.extend({ var badgeId = this.safe("data.badge_id"); if (badgeId) { var badgeName = this.safe("data.badge_name"); - return '/badges/' + badgeId + '/' + badgeName.replace(/[^A-Za-z0-9_]+/g, '-').toLowerCase(); + return Discourse.getURL('/badges/' + badgeId + '/' + badgeName.replace(/[^A-Za-z0-9_]+/g, '-').toLowerCase()); } var topicId = this.safe('topic_id'); @@ -29,7 +29,7 @@ export default ObjectController.extend({ } if (this.get('notification_type') === INVITED_TYPE) { - return '/my/invited'; + return Discourse.getURL('/my/invited'); } }.property("data.{badge_id,badge_name}", "slug", "topic_id", "post_number"), diff --git a/app/assets/javascripts/discourse/controllers/notifications.js.es6 b/app/assets/javascripts/discourse/controllers/notifications.js.es6 index 1b2c71574c9..78a80ed0eec 100644 --- a/app/assets/javascripts/discourse/controllers/notifications.js.es6 +++ b/app/assets/javascripts/discourse/controllers/notifications.js.es6 @@ -1,4 +1,6 @@ export default Ember.ArrayController.extend({ needs: ['header'], - loadingNotifications: Em.computed.alias('controllers.header.loadingNotifications') + loadingNotifications: Em.computed.alias('controllers.header.loadingNotifications'), + + myNotificationsUrl: Discourse.computed.url('/my/notifications') }); diff --git a/app/assets/javascripts/discourse/controllers/site-map.js.es6 b/app/assets/javascripts/discourse/controllers/site-map.js.es6 index 6ae95cda30e..af9ccd08c45 100644 --- a/app/assets/javascripts/discourse/controllers/site-map.js.es6 +++ b/app/assets/javascripts/discourse/controllers/site-map.js.es6 @@ -8,7 +8,7 @@ export default Ember.ArrayController.extend({ return Discourse.SiteSettings.faq_url ? Discourse.SiteSettings.faq_url : Discourse.getURL('/faq'); }.property(), - badgesUrl: Discourse.getURL('/badges'), + badgesUrl: Discourse.computed.url('/badges'), showKeyboardShortcuts: function(){ return !Discourse.Mobile.mobileView && !this.capabilities.touch; diff --git a/app/assets/javascripts/discourse/templates/notifications.hbs b/app/assets/javascripts/discourse/templates/notifications.hbs index 75df3d8e30f..916612b9b80 100644 --- a/app/assets/javascripts/discourse/templates/notifications.hbs +++ b/app/assets/javascripts/discourse/templates/notifications.hbs @@ -6,7 +6,7 @@ {{notification-item notification=n scope=n.scope}} {{/each}}
  • - {{i18n 'notifications.more'}}… + {{i18n 'notifications.more'}}…
  • {{else}} diff --git a/app/assets/javascripts/discourse/templates/site-map.hbs b/app/assets/javascripts/discourse/templates/site-map.hbs index 46e9080dfd9..5efeea4c9a7 100644 --- a/app/assets/javascripts/discourse/templates/site-map.hbs +++ b/app/assets/javascripts/discourse/templates/site-map.hbs @@ -2,19 +2,23 @@