Properly refresh last build link on repos list

value change. Since {{action}} is also not a bound helper, I need some
structure that I can put into {{with}} helper
This commit is contained in:
Piotr Sarnacki 2012-12-12 23:40:51 +01:00
parent d1cb2c7a92
commit 9853826bae
2 changed files with 11 additions and 2 deletions

View File

@ -12,6 +12,14 @@ require 'travis/model'
lastBuild: DS.belongsTo('Travis.Build')
lastBuildHash: (->
{
id: @get('lastBuildId')
number: @get('lastBuildNumber')
repo: this
}
).property('lastBuildId', 'lastBuildNumber')
allBuilds: (->
allBuilds = DS.RecordArray.create
type: Travis.Build

View File

@ -13,8 +13,9 @@
<a {{action showRepo this href=true}} class="slug">{{slug}}</a>
{{/if}}
</div>
{{#if lastBuildId}}
<a {{action showBuild this lastBuildId href=true}} class="last_build">{{lastBuildNumber}}</a>
{{#with lastBuildHash}}
{{#if id}}
<a {{action showBuild repo id href=true}} class="last_build">{{number}}</a>
{{/if}}
<p class="summary">