{{#if loading}}
  <span>Loading</span>
{{else}}
  <dl id="summary">
    <div class="left">
      <dt>{{t builds.name}}</dt>
      <dd class="number">
        <span class="status"></span>
        {{#if build.id}}
          {{#if build.repo.slug}}
            {{#linkTo "build" repo build}}{{build.number}}{{/linkTo}}
          {{/if}}
        {{/if}}
      </dd>
      <dt>{{t builds.state}}</dt>
      <dd class="state">{{capitalize build.state}}</dd>
      <dt class="finished_at_label">{{t builds.finished_at}}</dt>
      <dd class="finished_at timeago" {{bindAttr title="build.formattedFinishedAt"}}>{{formatTime build.finishedAt}}</dd>
      <dt>{{t builds.duration}}</dt>
      <dd class="duration" {{bindAttr title="startedAt"}}>{{formatDuration build.duration}}</dd>
    </div>

    {{#with build}}
      <div class="right">
        <dt>{{t builds.commit}}</dt>
        <dd class="commit"><a {{bindAttr href="controller.urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
        {{#if pullRequest}}
          <dt>{{t builds.pull_request}}</dt>
          <dd class="pull_request"><a {{bindAttr href="commit.compareUrl"}}>#{{pullRequestNumber}} {{pullRequestTitle}}</a></dd>
        {{else}}
          {{#if commit.compareUrl}}
            <dt>{{t builds.compare}}</dt>
            <dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
          {{/if}}
        {{/if}}
        {{#if commit.authorName}}
          <dt>{{t builds.author}}</dt>
          <dd class="author"><a {{bindAttr href="controller.urlAuthor"}}>{{commit.authorName}}</a></dd>
        {{/if}}
        {{#if commit.committerName}}
          <dt>{{t builds.committer}}</dt>
          <dd class="committer"><a {{bindAttr href="controller.urlCommitter"}}>{{commit.committerName}}</a></dd>
        {{/if}}
      </div>
    {{/with}}


    <dt>{{t builds.message}}</dt>
    <dd class="message">{{formatMessage build.commit.message repoBinding=build.repo}}</dd>
  </dl>

  {{#if build.isMatrix}}
    {{view Travis.JobsView jobsBinding="build.requiredJobs" required="true"}}
    {{view Travis.JobsView jobsBinding="build.allowedFailureJobs"}}
  {{else}}
    {{view Travis.LogView jobBinding="build.jobs.firstObject"}}
  {{/if}}
{{/if}}
