travis-web/app/templates/components/repos-list-item.hbs
Piotr Sarnacki 47439657a1 Use lastBuild from defaultBranch on repository
One thing that is not standard here is a serializer for branch, which
uses @href as id. At this point branches don't have ids and ember-data
needs one, so using @href is the easiest way.
2015-12-08 10:18:02 +01:00

38 lines
1.2 KiB
Handlebars

<div class="tile {{repo.defaultBranch.lastBuild.state}}">
<h2 class="tile-title {{repo.defaultBranch.lastBuild.state}}">
{{#if repo.slug}}
{{#link-to "repo" repo}}
{{status-icon status=repo.defaultBranch.lastBuild.state}}
<span class="label-align">{{repo.slug}}</span>
{{/link-to}}
{{/if}}
</h2>
{{#if repo.slug}}
{{#if repo.defaultBranch.lastBuild.id}}
<p class="tile-title float-right {{repo.defaultBranch.lastBuild.state}}">
{{#link-to "build" repo repo.defaultBranch.lastBuild.id}}
<span class="icon-hash"></span>
<span class="label-align">{{repo.defaultBranch.lastBuild.number}}</span>
{{/link-to}}
</p>
{{/if}}
{{/if}}
<p>
<span class="icon-clock"></span>
<span class="label-align">Duration:
<abbr class="duration" title={{repo.defaultBranch.lastBuild.startedAt}}>
{{format-duration repo.defaultBranch.lastBuild.duration}}
</abbr></span>
</p>
<p>
<span class="icon-calendar"></span>
<span class="label-align">Finished:
<abbr class="finished_at timeago" title={{repo.defaultBranch.lastBuild.finishedAt}}>
{{format-time repo.defaultBranch.lastBuild.finishedAt}}
</abbr></span>
</p>
</div>