set the build request type class from build.eventType

This commit is contained in:
Sven Fuchs 2014-12-10 15:13:30 +01:00 committed by Justine Arreche
parent 541273a33b
commit 776e3e9c3b
2 changed files with 8 additions and 1 deletions

View File

@ -15,6 +15,8 @@ require 'travis/model'
pullRequest: Ember.attr('boolean')
pullRequestTitle: Ember.attr('string')
pullRequestNumber: Ember.attr(Number)
# TODO add eventType to the api for api build requests
# eventType: Ember.attr('string')
repo: Ember.belongsTo('Travis.Repo', key: 'repository_id')
commit: Ember.belongsTo('Travis.Commit')
@ -24,6 +26,11 @@ require 'travis/model'
Travis.Helpers.compact(@get('_config'))
).property('_config')
# TODO add eventType to the api for api build requests
eventType: (->
if @get('pullRequest') then 'pull_request' else 'push'
).property('pull_request')
isPullRequest: (->
@get('eventType') == 'pull_request' || @get('pullRequest')
).property('eventType')

View File

@ -3,7 +3,7 @@
{{else}}
<div id="new-summary">
<div class="request-kind">
<div class="kind-icon">
<div {{bind-attr class=":kind-icon build.eventType"}}>
<img src="/images/icons/pull-request.svg" width="21" height="21"/>
</div>
</div>