From 28346ce2334c436a31a7f02406d1387372759e96 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Sat, 13 Oct 2012 17:31:12 +0200 Subject: [PATCH] add an empty repos view --- assets/scripts/app/templates/repos/list.hbs | 2 + assets/scripts/app/templates/repos/show.hbs | 70 +++++++++++---------- assets/scripts/app/views/repo/show.coffee | 10 ++- public/scripts/app.js | 2 +- public/scripts/min/app.js | 2 +- public/version | 2 +- 6 files changed, 51 insertions(+), 37 deletions(-) diff --git a/assets/scripts/app/templates/repos/list.hbs b/assets/scripts/app/templates/repos/list.hbs index df40ab18..0f28b0d3 100644 --- a/assets/scripts/app/templates/repos/list.hbs +++ b/assets/scripts/app/templates/repos/list.hbs @@ -34,5 +34,7 @@ {{/if}} {{/with}} + {{else}} +

{{/collection}} diff --git a/assets/scripts/app/templates/repos/show.hbs b/assets/scripts/app/templates/repos/show.hbs index 438d9f3f..b01e0dec 100644 --- a/assets/scripts/app/templates/repos/show.hbs +++ b/assets/scripts/app/templates/repos/show.hbs @@ -1,38 +1,42 @@
- {{#if view.repo.isLoaded}} - {{#with view.repo}} -

- {{slug}} -

- -

{{description}}

- - - - {{view Travis.RepoShowTabsView}} - {{view Travis.RepoShowToolsView}} - {{/with}} - + {{#if view.isEmpty}} + {{view Travis.ReposEmptyView}} {{else}} - Loading - {{/if}} + {{#if view.repo.isLoaded}} + {{#with view.repo}} +

+ {{slug}} +

-
- {{outlet pane}} -
+

{{description}}

+ + + + {{view Travis.RepoShowTabsView}} + {{view Travis.RepoShowToolsView}} + {{/with}} + + {{else}} + Loading + {{/if}} + +
+ {{outlet pane}} +
+ {{/if}}
diff --git a/assets/scripts/app/views/repo/show.coffee b/assets/scripts/app/views/repo/show.coffee index a5a72352..a84ad758 100644 --- a/assets/scripts/app/views/repo/show.coffee +++ b/assets/scripts/app/views/repo/show.coffee @@ -2,12 +2,17 @@ RepoView: Travis.View.extend templateName: 'repos/show' + reposBinding: 'Travis.app.router.reposController' # TODO ugh :/ repoBinding: 'controller.repo' class: (-> - 'loading' unless @get('repo.isLoaded') + 'loading' if !@get('repo.isLoaded') && !@get('isEmpty') ).property('repo.isLoaded') + isEmpty: (-> + @get('repos.length') == 0 + ).property('repos.length') + urlGithub: (-> Travis.Urls.githubRepo(@get('repo.slug')) ).property('repo.slug'), @@ -20,6 +25,9 @@ Travis.Urls.githubNetwork(@get('repo.slug')) ).property('repo.slug'), + ReposEmptyView: Travis.View.extend + template: '' + RepoShowTabsView: Travis.View.extend templateName: 'repos/show/tabs' diff --git a/public/scripts/app.js b/public/scripts/app.js index 615d8013..0ace7cde 100644 --- a/public/scripts/app.js +++ b/public/scripts/app.js @@ -29619,4 +29619,4 @@ var _require=function(){function c(a,c){document.addEventListener?a.addEventList ++g&&setTimeout(c,0)})}}(); (function(){!window.WebSocket&&window.MozWebSocket&&(window.WebSocket=window.MozWebSocket);if(window.WebSocket)Pusher.Transport=window.WebSocket,Pusher.TransportType="native";var c=(document.location.protocol=="http:"?Pusher.cdn_http:Pusher.cdn_https)+Pusher.VERSION,a=[];window.JSON||a.push(c+"/json2"+Pusher.dependency_suffix+".js");if(!window.WebSocket)window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0,a.push(c+"/flashfallback"+Pusher.dependency_suffix+".js");var b=function(){return window.WebSocket?function(){Pusher.ready()}: function(){window.WebSocket?(Pusher.Transport=window.WebSocket,Pusher.TransportType="flash",window.WEB_SOCKET_SWF_LOCATION=c+"/WebSocketMain.swf",WebSocket.__addTask(function(){Pusher.ready()}),WebSocket.__initialize()):(Pusher.Transport=null,Pusher.TransportType="none",Pusher.ready())}}(),e=function(a){var b=function(){document.body?a():setTimeout(b,0)};b()},g=function(){e(b)};a.length>0?_require(a,g):g()})(); -;minispade.register('app', "(function() {(function() {\nminispade.require('auth');\nminispade.require('controllers');\nminispade.require('helpers');\nminispade.require('models');\nminispade.require('pusher');\nminispade.require('routes');\nminispade.require('slider');\nminispade.require('store');\nminispade.require('tailing');\nminispade.require('templates');\nminispade.require('views');\nminispade.require('config/locales');\nminispade.require('data/sponsors');\n\n Travis.reopen({\n App: Em.Application.extend({\n autoinit: false,\n currentUserBinding: 'auth.user',\n authStateBinding: 'auth.state',\n init: function() {\n this._super.apply(this, arguments);\n this.store = Travis.Store.create();\n this.store.loadMany(Travis.Sponsor, Travis.SPONSORS);\n this.set('auth', Travis.Auth.create({\n app: this,\n endpoint: Travis.config.api_endpoint\n }));\n this.slider = new Travis.Slider();\n this.pusher = new Travis.Pusher(Travis.config.pusher_key);\n return this.tailing = new Travis.Tailing();\n },\n signIn: function() {\n return this.get('auth').signIn();\n },\n autoSignIn: function() {\n return this.get('auth').autoSignIn();\n },\n signOut: function() {\n this.get('auth').signOut();\n return this.get('router').send('afterSignOut');\n },\n receive: function() {\n return this.store.receive.apply(this.store, arguments);\n },\n toggleSidebar: function() {\n var element;\n $('body').toggleClass('maximized');\n element = $('');\n $('#top .profile').append(element);\n Em.run.later((function() {\n return element.remove();\n }), 10);\n element = $('');\n $('#repo').append(element);\n return Em.run.later((function() {\n return element.remove();\n }), 10);\n }\n })\n });\n\n}).call(this);\n\n})();\n//@ sourceURL=app");minispade.register('auth', "(function() {(function() {\n\n this.Travis.Auth = Ember.Object.extend({\n iframe: $('