Show committer in build header only when he's not author.
This commit is contained in:
parent
b8bd3b5fe8
commit
141619c3f5
|
@ -26,3 +26,8 @@ require 'travis/model'
|
||||||
else
|
else
|
||||||
""
|
""
|
||||||
).property('message')
|
).property('message')
|
||||||
|
|
||||||
|
authorIsCommitter: ( ->
|
||||||
|
@get('authorName') == @get('committerName') and
|
||||||
|
@get('authorEmail') == @get('committerEmail')
|
||||||
|
).property('authorName', 'authorEmail', 'committerName', 'committerEmail')
|
||||||
|
|
|
@ -31,11 +31,13 @@
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="author">
|
<div class="author">
|
||||||
{{#if commit.authorName}}
|
{{#if commit.authorName}}
|
||||||
<div class="authored"><img {{bind-attr src="view.urlAuthorGravatarImage"}}/>{{commit.authorName}} authored</div>
|
<div class="authored"><img {{bind-attr src="view.urlAuthorGravatarImage"}}/>{{commit.authorName}} authored{{#if commit.authorIsCommitter}} and committed{{/if}}</div>
|
||||||
{{/if}}
|
|
||||||
{{#if commit.committerName}}
|
|
||||||
<div class="committed"><img {{bind-attr src="view.urlCommitterGravatarImage"}}/>{{commit.committerName}} committed</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#unless commit.authorIsCommitter}}
|
||||||
|
{{#if commit.committerName}}
|
||||||
|
<div class="committed"><img {{bind-attr src="view.urlCommitterGravatarImage"}}/>{{commit.committerName}} committed</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="commit-changes">
|
<div class="commit-changes">
|
||||||
|
|
39
assets/scripts/spec/unit/commit_spec.coffee
Normal file
39
assets/scripts/spec/unit/commit_spec.coffee
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
record = null
|
||||||
|
|
||||||
|
module "Travis.Commit",
|
||||||
|
setup: ->
|
||||||
|
teardown: ->
|
||||||
|
Travis.Commit.resetData()
|
||||||
|
|
||||||
|
test 'it recognizes when author is committer', ->
|
||||||
|
Travis.Commit.load [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
committer_name: 'Jimmy',
|
||||||
|
committer_email: 'jimmy@example.com',
|
||||||
|
author_name: 'Jimmy',
|
||||||
|
author_email: 'jimmy@example.com'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
Ember.run ->
|
||||||
|
record = Travis.Commit.find 1
|
||||||
|
|
||||||
|
console.log(record.get('authorName'))
|
||||||
|
equal(true, record.get('authorIsCommitter'))
|
||||||
|
|
||||||
|
test 'it recognizes when author is not committer', ->
|
||||||
|
Travis.Commit.load [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
committer_name: 'Jimmy',
|
||||||
|
committer_email: 'jimmy@example.com',
|
||||||
|
author_name: 'John',
|
||||||
|
author_email: 'john@example.com'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
Ember.run ->
|
||||||
|
record = Travis.Commit.find 1
|
||||||
|
console.log(record.get('authorName'))
|
||||||
|
equal(false, record.get('authorIsCommitter'))
|
Loading…
Reference in New Issue
Block a user