Cleanup BuildView

This commit is contained in:
Piotr Sarnacki 2015-01-15 17:02:32 +01:00
parent 67e787596f
commit 345cb6e29e
3 changed files with 11 additions and 13 deletions

View File

@ -10,3 +10,11 @@ Travis.BuildController = Ember.Controller.extend Travis.GithubUrlProperties,
loading: (->
@get('build.isLoading')
).property('build.isLoading')
urlCommitterGravatarImage: (->
Travis.Urls.gravatarImage(@get('commit.committerEmail'), 40)
).property('commit.committerEmail')
urlAuthorGravatarImage: (->
Travis.Urls.gravatarImage(@get('commit.authorEmail'), 40)
).property('commit.authorEmail')

View File

@ -24,7 +24,7 @@
{{/if}}
<div class="commit-changes">
<a class="commit" {{bind-attr href="controller.urlGithubCommit"}}>Commit {{formatSha commit.sha}}</a>
<a class="commit" {{bind-attr href="urlGithubCommit"}}>Commit {{formatSha commit.sha}}</a>
</div>
<div class="commit-changes">
{{#if build.pullRequest}}
@ -52,11 +52,11 @@
<div class="footer">
<div class="author">
{{#if commit.authorName}}
<div class="authored"><img {{bind-attr src="view.urlAuthorGravatarImage"}}/><div class="text">{{commit.authorName}} authored{{#if commit.authorIsCommitter}} and committed{{/if}}</div></div>
<div class="authored"><img {{bind-attr src="urlAuthorGravatarImage"}}/><div class="text">{{commit.authorName}} authored{{#if commit.authorIsCommitter}} and committed{{/if}}</div></div>
{{/if}}
{{#unless commit.authorIsCommitter}}
{{#if commit.committerName}}
<div class="committed"><img {{bind-attr src="view.urlCommitterGravatarImage"}}/><div class="text">{{commit.committerName}} committed</div></div>
<div class="committed"><img {{bind-attr src="urlCommitterGravatarImage"}}/><div class="text">{{commit.committerName}} committed</div></div>
{{/if}}
{{/unless}}
</div>

View File

@ -22,16 +22,6 @@ Travis.reopen
BuildView: Travis.View.extend
classNameBindings: ['color', 'loading']
buildBinding: 'controller.build'
commitBinding: 'build.commit'
urlCommitterGravatarImage: (->
Travis.Urls.gravatarImage(@get('commit.committerEmail'), 40)
).property('commit.committerEmail')
urlAuthorGravatarImage: (->
Travis.Urls.gravatarImage(@get('commit.authorEmail'), 40)
).property('commit.authorEmail')
loadingBinding: 'controller.loading'
color: (->