diff --git a/ui/core/app/routes/scopes/scope.js b/ui/core/app/routes/scopes/scope.js
index 58c145667..7af8591f0 100644
--- a/ui/core/app/routes/scopes/scope.js
+++ b/ui/core/app/routes/scopes/scope.js
@@ -35,13 +35,14 @@ export default class ScopesScopeRoute extends Route {
}
/**
- * Set scope in application controller
+ * Adds the set of all org scopes to the controller, which is used by the
+ * scope navigation template.
+ * @param {Controller} controller
*/
- afterModel() {
+ setupController(controller) {
+ super.setupController(...arguments);
const orgScopes = this.modelFor('scopes').filterBy('isOrg', true);
- this.controllerFor('application').set('orgScopes', orgScopes);
- const scope = this.modelFor('scopes.scope');
- this.controllerFor('application').set('scope', scope);
+ controller.setProperties({ orgScopes });
}
/**
@@ -53,6 +54,12 @@ export default class ScopesScopeRoute extends Route {
renderTemplate(controller, model) {
super.renderTemplate(...arguments);
+ this.render('scopes/scope/-header-nav', {
+ into: 'application',
+ outlet: 'header-nav',
+ model: model,
+ });
+
this.render('scopes/scope/-sidebar', {
into: 'scopes/scope',
outlet: 'sidebar',
diff --git a/ui/core/app/templates/application.hbs b/ui/core/app/templates/application.hbs
index e8c486787..50a823972 100644
--- a/ui/core/app/templates/application.hbs
+++ b/ui/core/app/templates/application.hbs
@@ -8,28 +8,10 @@
{{#if this.session.isAuthenticated}}
-
-
- {{#if this.session.data.authenticated.isGlobal}}
-
- {{t "titles.global"}}
-
- {{#each this.orgScopes as |scope|}}
-
- {{scope.displayName}}
-
- {{/each}}
- {{else}}
- {{#if this.scope}}
-
- {{this.scope.displayName}}
-
- {{/if}}
- {{/if}}
-
+
+
+ {{outlet "header-nav"}}
+
diff --git a/ui/core/app/templates/scopes/scope/-header-nav.hbs b/ui/core/app/templates/scopes/scope/-header-nav.hbs
new file mode 100644
index 000000000..00484b51a
--- /dev/null
+++ b/ui/core/app/templates/scopes/scope/-header-nav.hbs
@@ -0,0 +1,20 @@
+
+ {{#if this.session.data.authenticated.isGlobal}}
+
+ {{t "titles.global"}}
+
+
+ {{#each this.orgScopes as |scope|}}
+
+ {{scope.displayName}}
+
+ {{/each}}
+ {{else}}
+
+ {{this.model.displayName}}
+
+ {{/if}}
+