add an empty repos view

This commit is contained in:
Sven Fuchs 2012-10-13 17:31:12 +02:00
parent d84b5dfd0a
commit 28346ce233
6 changed files with 51 additions and 37 deletions

View File

@ -34,5 +34,7 @@
</div>
{{/if}}
{{/with}}
{{else}}
<p class="empty"></p>
{{/collection}}
</div>

View File

@ -1,4 +1,7 @@
<div id="repo" {{bindAttr class="view.class"}}>
{{#if view.isEmpty}}
{{view Travis.ReposEmptyView}}
{{else}}
{{#if view.repo.isLoaded}}
{{#with view.repo}}
<h3>
@ -34,5 +37,6 @@
<div class="tab">
{{outlet pane}}
</div>
{{/if}}
</div>

View File

@ -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'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
5fb464fb
102985b4