From 67cae2c8f5bdbb3f4b6f3c4b8798d3aecf9fb2a1 Mon Sep 17 00:00:00 2001
From: Piotr Sarnacki <drogus@gmail.com>
Date: Wed, 4 Feb 2015 18:34:25 +0100
Subject: [PATCH] Remove Travis global usage from templates

---
 app/initializers/services.coffee   | 4 +++-
 app/templates/events/list.hbs      | 2 +-
 app/templates/layouts/flash.hbs    | 2 +-
 app/templates/layouts/profile.hbs  | 2 +-
 app/templates/profile/accounts.hbs | 2 +-
 app/templates/profile/show.hbs     | 2 +-
 app/templates/repo.hbs             | 2 +-
 app/templates/sidebar.hbs          | 2 +-
 app/templates/status-images.hbs    | 2 +-
 9 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/app/initializers/services.coffee b/app/initializers/services.coffee
index 308853a0..4da8e040 100644
--- a/app/initializers/services.coffee
+++ b/app/initializers/services.coffee
@@ -5,10 +5,12 @@
 
 initialize = (container, application) ->
   application.slider = new Slider(application.storage)
-
   application.tailing = new Tailing($(window), '#tail', '#log')
   application.toTop   = new ToTop($(window), '.to-top', '#log-container')
 
+  application.register 'slider:main', application.slider, { instantiate: false }
+  application.inject('view', 'slider', 'slider:main')
+
 Initializer =
   name: 'services'
   initialize: initialize
diff --git a/app/templates/events/list.hbs b/app/templates/events/list.hbs
index 9e13db94..eaf24b0a 100644
--- a/app/templates/events/list.hbs
+++ b/app/templates/events/list.hbs
@@ -11,7 +11,7 @@
 
     <tbody>
       {{#each event in view.events}}
-        {{#view Travis.EventsItemView contextBinding="event"}}
+        {{#view "events-item" contextBinding="event"}}
           <td class="created_at">
             {{format-time createdAt}}
           </td>
diff --git a/app/templates/layouts/flash.hbs b/app/templates/layouts/flash.hbs
index 193d0d8c..635ad6a1 100644
--- a/app/templates/layouts/flash.hbs
+++ b/app/templates/layouts/flash.hbs
@@ -1,5 +1,5 @@
 {{#each flash in controller}}
-  {{#view Travis.FlashItemView flashBinding="flash"}}
+  {{#view "flash-item" flashBinding="flash"}}
     <p>{{{flash.message}}}</p>
     <a class="close" {{action "close" target=view}}></a>
   {{/view}}
diff --git a/app/templates/layouts/profile.hbs b/app/templates/layouts/profile.hbs
index 736b3899..01331545 100644
--- a/app/templates/layouts/profile.hbs
+++ b/app/templates/layouts/profile.hbs
@@ -12,7 +12,7 @@
 </div>
 
 <div id="right">
-  <div id="slider" {{action "toggle" target=Travis.slider}}>
+  <div id="slider" {{action "toggle" target=slider}}>
     <div class='icon'></div>&nbsp;
   </div>
 
diff --git a/app/templates/profile/accounts.hbs b/app/templates/profile/accounts.hbs
index 3a02f44f..89b547b5 100644
--- a/app/templates/profile/accounts.hbs
+++ b/app/templates/profile/accounts.hbs
@@ -8,7 +8,7 @@
 </ul>
 
 <div class="tab">
-  {{#collection Travis.AccountsListView contentBinding="controller"}}
+  {{#collection "accounts-list" contentBinding="controller"}}
     {{#link-to "account" view.account class="name"}}{{view.name}}{{/link-to}}
     <p class="summary">
       <span class="repos_label">Repositories:</span>
diff --git a/app/templates/profile/show.hbs b/app/templates/profile/show.hbs
index e90482ad..119c8e60 100644
--- a/app/templates/profile/show.hbs
+++ b/app/templates/profile/show.hbs
@@ -18,7 +18,7 @@
   {{/if}}
 {{/if}}
 
-{{view Travis.ProfileTabsView}}
+{{view 'profile-tabs'}}
 
 <div class="tab">
   {{outlet}}
diff --git a/app/templates/repo.hbs b/app/templates/repo.hbs
index 0be0cf77..410252fc 100644
--- a/app/templates/repo.hbs
+++ b/app/templates/repo.hbs
@@ -1,6 +1,6 @@
 <div id="repo" {{bind-attr class="view.className"}}>
   {{#if view.isEmpty}}
-    {{view Travis.ReposEmptyView}}
+    {{view 'repos-empty'}}
   {{else}}
     {{#if repo.isLoaded}}
       <div id="repo-header">
diff --git a/app/templates/sidebar.hbs b/app/templates/sidebar.hbs
index 1ea87744..1eafabb1 100644
--- a/app/templates/sidebar.hbs
+++ b/app/templates/sidebar.hbs
@@ -1,4 +1,4 @@
-<div id="slider" {{action toggle target="Travis.slider"}}>
+<div id="slider" {{action toggle target=slider}}>
   <div class='icon'></div>&nbsp;
 </div>
 
diff --git a/app/templates/status-images.hbs b/app/templates/status-images.hbs
index 677e2ca3..d88a105c 100644
--- a/app/templates/status-images.hbs
+++ b/app/templates/status-images.hbs
@@ -10,5 +10,5 @@
 
 <p>
   <label>{{view Ember.Select contentBinding="view.formats" selectionBinding="view.statusImageFormat"}}</label>
-  {{view Travis.StatusImageInput valueBinding="view.statusString" class="url" rows=3}}
+  {{view 'status-image' valueBinding="view.statusString" class="url" rows=3}}
 </p>