{{#if loading}}
  <span>Loading</span>
{{else}}
  <div id="new-summary">
    <div class="right">
      <div class="build-status">
        {{#link-to "build" repo build}}#{{build.number}} {{build.state}}{{/link-to}}
      </div>

      <div class="runtime">
           {{#if build.isFinished}}ran{{else}}running{{/if}} for {{formatDuration build.duration}} 
      </div>

      <div class="finished">
        {{formatTime build.finishedAt}}
      </div>
    </div>
 
    <div class="branch" {{bind-attr title="build.commit.branch"}}>
      {{build.commit.branch}}
    </div>

    <div class="subject">
    - {{formatMessage build.commit.subject repoBinding=build.repo}}
    </div>

    <pre class="body">
{{formatMessage build.commit.body repoBinding=build.repo pre=true}}
    </pre>

    <div class="footer">
      <div class="author">
        {{#if commit.authorName}}
          <div class="authored"><img {{bind-attr src="view.urlAuthorGravatarImage"}}/><div class="text">{{commit.authorName}} authored{{#if commit.authorIsCommitter}} and committed{{/if}}</div></div>
        {{/if}}
        {{#unless commit.authorIsCommitter}}
          {{#if commit.committerName}}
            <div class="committed"><img {{bind-attr src="view.urlCommitterGravatarImage"}}/><div class="text">{{commit.committerName}} committed</div></div>
          {{/if}}
        {{/unless}}
      </div>

      <div class="commit-changes">
        <div class="text"><a class="commit" {{bind-attr href="controller.urlGithubCommit"}}>Commit {{formatSha commit.sha}}</a></div><img src="/images/icons/github.png"/>
        {{#if build.pullRequest}}
          <div class="text"><a class="compare" {{bind-attr href="build.commit.compareUrl"}}>#{{build.pullRequestNumber}}: {{build.pullRequestTitle}}</a></div><img src="/images/icons/github.png"/>
        {{else}}
          {{#if build.commit.compareUrl}}
            <div class="text"><a class="compare" {{bind-attr href="build.commit.compareUrl"}}>Compare {{shortCompareShas build.commit.compareUrl}}</a></div><img src="/images/icons/github.png"/>
          {{/if}}
        {{/if}}
      </div>
    </div>
  </div>

  {{#unless build.isMatrix}}
    {{view Travis.AnnotationsView annotationsBinding="build.jobs.firstObject.annotations"}}
  {{/unless}}

  {{#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}}
