From c3ef9ac5d9c647004c3de32f1328fb88854a2262 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 12 Jan 2016 14:06:19 +0100 Subject: [PATCH] [deprecations] Remove all of the views we use just for layouts --- app/components/travis-layout.js | 3 +++ app/controllers/error.js | 14 +++++++++++++- app/controllers/loading.js | 14 +++++++++++++- app/templates/auth/signin.hbs | 2 ++ app/templates/dashboard.hbs | 4 +++- app/templates/error404.hbs | 2 ++ app/templates/first-sync.hbs | 2 ++ app/templates/home-pro.hbs | 2 ++ app/templates/home.hbs | 2 ++ app/templates/insufficient-oauth-permissions.hbs | 2 ++ app/templates/loading.hbs | 4 +++- app/templates/logo.hbs | 4 +++- app/templates/main.hbs | 4 +++- app/templates/not-found.hbs | 4 +++- app/templates/owner.hbs | 2 ++ app/templates/plans.hbs | 2 ++ app/templates/profile.hbs | 4 +++- app/templates/team.hbs | 4 +++- app/views/auth/signin.js | 5 ----- app/views/dashboard.js | 6 ------ app/views/error.js | 10 ---------- app/views/error404.js | 6 ------ app/views/first-sync.js | 5 ----- app/views/home-pro.js | 6 ------ app/views/home.js | 5 ----- app/views/insufficient-oauth-permissions.js | 5 ----- app/views/loading.js | 10 ---------- app/views/logo.js | 6 ------ app/views/main.js | 6 ------ app/views/not-found.js | 5 ----- app/views/owner.js | 6 ------ app/views/plans.js | 6 ------ app/views/profile.js | 12 ------------ app/views/team.js | 6 ------ 34 files changed, 66 insertions(+), 114 deletions(-) create mode 100644 app/components/travis-layout.js delete mode 100644 app/views/auth/signin.js delete mode 100644 app/views/dashboard.js delete mode 100644 app/views/error.js delete mode 100644 app/views/error404.js delete mode 100644 app/views/first-sync.js delete mode 100644 app/views/home-pro.js delete mode 100644 app/views/home.js delete mode 100644 app/views/insufficient-oauth-permissions.js delete mode 100644 app/views/loading.js delete mode 100644 app/views/logo.js delete mode 100644 app/views/main.js delete mode 100644 app/views/not-found.js delete mode 100644 app/views/owner.js delete mode 100644 app/views/plans.js delete mode 100644 app/views/profile.js delete mode 100644 app/views/team.js diff --git a/app/components/travis-layout.js b/app/components/travis-layout.js new file mode 100644 index 00000000..6e705e67 --- /dev/null +++ b/app/components/travis-layout.js @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({}); diff --git a/app/controllers/error.js b/app/controllers/error.js index 38e5364f..344c515b 100644 --- a/app/controllers/error.js +++ b/app/controllers/error.js @@ -1,3 +1,15 @@ import Ember from 'ember'; -export default Ember.Controller.extend(); +export default Ember.Controller.extend({ + layoutName: Ember.computed({ + get(key) { + if(this._layoutName) { + return 'layouts/' + this._layoutName; + } + }, + + set(key, value) { + return this._layoutName = value; + } + }) +}); diff --git a/app/controllers/loading.js b/app/controllers/loading.js index 38e5364f..344c515b 100644 --- a/app/controllers/loading.js +++ b/app/controllers/loading.js @@ -1,3 +1,15 @@ import Ember from 'ember'; -export default Ember.Controller.extend(); +export default Ember.Controller.extend({ + layoutName: Ember.computed({ + get(key) { + if(this._layoutName) { + return 'layouts/' + this._layoutName; + } + }, + + set(key, value) { + return this._layoutName = value; + } + }) +}); diff --git a/app/templates/auth/signin.hbs b/app/templates/auth/signin.hbs index c5af9b3d..fda0bb4e 100644 --- a/app/templates/auth/signin.hbs +++ b/app/templates/auth/signin.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/simple"}} {{#if redirected}} {{/if}} @@ -14,3 +15,4 @@ {{/if}}

+{{/travis-layout}} diff --git a/app/templates/dashboard.hbs b/app/templates/dashboard.hbs index c24cd689..70454b53 100644 --- a/app/templates/dashboard.hbs +++ b/app/templates/dashboard.hbs @@ -1 +1,3 @@ -{{outlet}} +{{#travis-layout layoutName="layouts/dashboard" class="dashboard"}} + {{outlet}} +{{/travis-layout}} diff --git a/app/templates/error404.hbs b/app/templates/error404.hbs index cc397661..fb95f1fe 100644 --- a/app/templates/error404.hbs +++ b/app/templates/error404.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/error" class="error error404"}}
@@ -8,3 +9,4 @@

404: Something's Missing

We're sorry! It seems like this page cannot be found.

+{{/travis-layout}} diff --git a/app/templates/first-sync.hbs b/app/templates/first-sync.hbs index d72e62d3..3cff22a1 100644 --- a/app/templates/first-sync.hbs +++ b/app/templates/first-sync.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/simple"}}
{{#if isSyncing}} @@ -23,3 +24,4 @@ {{/unless}}
+{{/travis-layout}} diff --git a/app/templates/home-pro.hbs b/app/templates/home-pro.hbs index 45319ab5..c3cdc5bb 100644 --- a/app/templates/home-pro.hbs +++ b/app/templates/home-pro.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
@@ -89,3 +90,4 @@
+{{/travis-layout}} diff --git a/app/templates/home.hbs b/app/templates/home.hbs index cc41929d..89ba15ce 100644 --- a/app/templates/home.hbs +++ b/app/templates/home.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page"}}
@@ -248,3 +249,4 @@
+{{/travis-layout}} diff --git a/app/templates/insufficient-oauth-permissions.hbs b/app/templates/insufficient-oauth-permissions.hbs index 5403a743..78073a0b 100644 --- a/app/templates/insufficient-oauth-permissions.hbs +++ b/app/templates/insufficient-oauth-permissions.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/simple"}}
@@ -23,3 +24,4 @@ {{/if}}
+{{/travis-layout}} diff --git a/app/templates/loading.hbs b/app/templates/loading.hbs index 18503769..6350bd7a 100644 --- a/app/templates/loading.hbs +++ b/app/templates/loading.hbs @@ -1 +1,3 @@ -{{loading-indicator}} \ No newline at end of file +{{#travis-layout layoutName=layoutName}} + {{loading-indicator}} +{{/travis-layout}} diff --git a/app/templates/logo.hbs b/app/templates/logo.hbs index f37a6e5e..10b99210 100644 --- a/app/templates/logo.hbs +++ b/app/templates/logo.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
@@ -142,4 +143,5 @@
- \ No newline at end of file + +{{/travis-layout}} diff --git a/app/templates/main.hbs b/app/templates/main.hbs index c24cd689..25a79202 100644 --- a/app/templates/main.hbs +++ b/app/templates/main.hbs @@ -1 +1,3 @@ -{{outlet}} +{{#travis-layout layoutName="layouts/home" class="main"}} + {{outlet}} +{{/travis-layout}} diff --git a/app/templates/not-found.hbs b/app/templates/not-found.hbs index 2f69fa59..a233a312 100644 --- a/app/templates/not-found.hbs +++ b/app/templates/not-found.hbs @@ -1 +1,3 @@ -The requested page was not found. +{{#travis-layout layoutName="layouts/simple"}} + The requested page was not found. +{{/travis-layout}} diff --git a/app/templates/owner.hbs b/app/templates/owner.hbs index 8cebd903..8a2ae6ed 100644 --- a/app/templates/owner.hbs +++ b/app/templates/owner.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/profile" class="owner"}}
@@ -36,3 +37,4 @@ --}}
+{{/travis-layout}} diff --git a/app/templates/plans.hbs b/app/templates/plans.hbs index 54bf849c..7c9ba25b 100644 --- a/app/templates/plans.hbs +++ b/app/templates/plans.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
@@ -133,3 +134,4 @@
+{{/layout-name}} diff --git a/app/templates/profile.hbs b/app/templates/profile.hbs index f5977610..6fcedf7e 100644 --- a/app/templates/profile.hbs +++ b/app/templates/profile.hbs @@ -1,3 +1,5 @@ +{{#travis-layout layoutName="layouts/profile" class="profile-view"}}
{{outlet}} -
\ No newline at end of file + +{{/travis-layout}} diff --git a/app/templates/team.hbs b/app/templates/team.hbs index e80237ab..76af68ff 100644 --- a/app/templates/team.hbs +++ b/app/templates/team.hbs @@ -1,3 +1,4 @@ +{{#travis-layout layoutName="layouts/landing-page" class="landing-pro"}}
@@ -13,4 +14,5 @@
-
\ No newline at end of file + +{{/travis-layout}} diff --git a/app/views/auth/signin.js b/app/views/auth/signin.js deleted file mode 100644 index 09f8180b..00000000 --- a/app/views/auth/signin.js +++ /dev/null @@ -1,5 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/dashboard.js b/app/views/dashboard.js deleted file mode 100644 index a76fc0df..00000000 --- a/app/views/dashboard.js +++ /dev/null @@ -1,6 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/dashboard', - classNames: ['dashboard'] -}); diff --git a/app/views/error.js b/app/views/error.js deleted file mode 100644 index a742a7ce..00000000 --- a/app/views/error.js +++ /dev/null @@ -1,10 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: function() { - var name; - if (name = this.get('controller.layoutName')) { - return 'layouts/' + name; - } - }.property('controller.layoutName') -}); diff --git a/app/views/error404.js b/app/views/error404.js deleted file mode 100644 index 27e2da03..00000000 --- a/app/views/error404.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/error', - classNames: ['error error404'] -}); diff --git a/app/views/first-sync.js b/app/views/first-sync.js deleted file mode 100644 index 9f2f62c1..00000000 --- a/app/views/first-sync.js +++ /dev/null @@ -1,5 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/home-pro.js b/app/views/home-pro.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/home-pro.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/home.js b/app/views/home.js deleted file mode 100644 index 9c3fb90a..00000000 --- a/app/views/home.js +++ /dev/null @@ -1,5 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/insufficient-oauth-permissions.js b/app/views/insufficient-oauth-permissions.js deleted file mode 100644 index 9f2f62c1..00000000 --- a/app/views/insufficient-oauth-permissions.js +++ /dev/null @@ -1,5 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/loading.js b/app/views/loading.js deleted file mode 100644 index 44f7ec9b..00000000 --- a/app/views/loading.js +++ /dev/null @@ -1,10 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: (function() { - var name; - if (name = this.get('controller.layoutName')) { - return 'layouts/' + name; - } - }).property('controller.layoutName') -}); diff --git a/app/views/logo.js b/app/views/logo.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/logo.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/main.js b/app/views/main.js deleted file mode 100644 index 7d576766..00000000 --- a/app/views/main.js +++ /dev/null @@ -1,6 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/home', - classNames: ['main'] -}); diff --git a/app/views/not-found.js b/app/views/not-found.js deleted file mode 100644 index 09f8180b..00000000 --- a/app/views/not-found.js +++ /dev/null @@ -1,5 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/simple' -}); diff --git a/app/views/owner.js b/app/views/owner.js deleted file mode 100644 index 93d95f46..00000000 --- a/app/views/owner.js +++ /dev/null @@ -1,6 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - layoutName: 'layouts/profile', - classNames: ['owner'] -}); diff --git a/app/views/plans.js b/app/views/plans.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/plans.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -}); diff --git a/app/views/profile.js b/app/views/profile.js deleted file mode 100644 index 8e701730..00000000 --- a/app/views/profile.js +++ /dev/null @@ -1,12 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - templateName: 'profile/show', - layoutName: 'layouts/profile', - classNames: ['profile-view'], - accountBinding: 'controller.account', - - name: function() { - return this.get('account.name') || this.get('account.login'); - }.property('account.name', 'account.login') -}); diff --git a/app/views/team.js b/app/views/team.js deleted file mode 100644 index 3a0039ff..00000000 --- a/app/views/team.js +++ /dev/null @@ -1,6 +0,0 @@ -import BasicView from 'travis/views/basic'; - -export default BasicView.extend({ - classNames: ['landing-pro'], - layoutName: 'layouts/landing-page' -});