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,38 +1,42 @@
<div id="repo" {{bindAttr class="view.class"}}>
{{#if view.repo.isLoaded}}
{{#with view.repo}}
<h3>
<a {{bindAttr href="view.urlGithub"}}>{{slug}}</a>
</h3>
<p class="description">{{description}}</p>
<ul class="github-stats">
<li class="language">
{{lastBuildLanguage}}
</li>
<li>
<a class="watchers" title="Watchers" {{bindAttr href="view.urlGithubWatchers"}}>
{{stats.watchers}}
</a>
</li>
<li>
<a class="forks" title="Forks" {{bindAttr href="view.urlGithubNetwork"}}>
{{stats.forks}}
</a>
</li>
</ul>
{{view Travis.RepoShowTabsView}}
{{view Travis.RepoShowToolsView}}
{{/with}}
{{#if view.isEmpty}}
{{view Travis.ReposEmptyView}}
{{else}}
<span>Loading</span>
{{/if}}
{{#if view.repo.isLoaded}}
{{#with view.repo}}
<h3>
<a {{bindAttr href="view.urlGithub"}}>{{slug}}</a>
</h3>
<div class="tab">
{{outlet pane}}
</div>
<p class="description">{{description}}</p>
<ul class="github-stats">
<li class="language">
{{lastBuildLanguage}}
</li>
<li>
<a class="watchers" title="Watchers" {{bindAttr href="view.urlGithubWatchers"}}>
{{stats.watchers}}
</a>
</li>
<li>
<a class="forks" title="Forks" {{bindAttr href="view.urlGithubNetwork"}}>
{{stats.forks}}
</a>
</li>
</ul>
{{view Travis.RepoShowTabsView}}
{{view Travis.RepoShowToolsView}}
{{/with}}
{{else}}
<span>Loading</span>
{{/if}}
<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