{{#if loading}}
  {{loading-indicator}}
{{else}}
  <section class="tile tile--pass row {{build.state}}">
    <div class="tile-status">
      <span class="icon icon-status {{build.state}}" title={{build.state}}></span>
      <span class="request-kind {{build.eventType}} icon" title={{build.eventType}}></span>
    </div>

    <div class="tile-main medium-8 columns">
      <h2 class="repo-main-commit">
      {{#if build.pullRequest}}
        <small class="repo-main-branch" title={{build.pullRequestTitle}}>Pull Request #{{build.pullRequestNumber}}</small>
        {{build.pullRequestTitle}}
      {{else}}
        <small class="repo-main-branch" title={{build.commit.branch}}>{{build.commit.branch}}</small>
        {{format-message build.commit.subject repo=build.repo}}
      {{/if}}
      </h2>
      <div class="repo-main-description">
        {{#if build.pullRequest}}
          <p>{{format-message build.commit.subject repo=build.repo}}</p>
        {{/if}}
        <pre class="body">{{format-message build.commit.body repo=build.repo pre=true}}</pre>
      </div>
      <div class="tile-author">
       {{#if commit.authorName}}
         <img src={{urlAuthorGravatarImage}}>{{commit.authorName}} authored{{#if commit.authorIsCommitter}} and committed{{/if}}
       {{/if}}
       {{#unless commit.authorIsCommitter}}
         {{#if commit.committerName}}
           <img src={{urlCommitterGravatarImage}}>{{commit.committerName}} committed
         {{/if}}
       {{/unless}}
      </div>
    </div>

    <div class="tile-additional medium-4 columns end">
      <ul class="repo-main-info">
        <li class="repo-build-status">{{#link-to "build" repo build}}
          <span class="icon icon--hash"></span>
          {{build.number}} {{humanize-state build.state}}{{/link-to}}
        </li>
        <li>
          <a class="commit" href={{urlGithubCommit}}>
            <span class="icon icon--github"></span>
            Commit {{format-sha commit.sha}}
          </a>
        </li>
        <li>
          {{#if build.pullRequest}}
            <a class="compare" href={{build.commit.compareUrl}}><span class="icon icon--github"></span> #{{build.pullRequestNumber}}: {{build.pullRequestTitle}}</a>
          {{else}}
            {{#if build.commit.compareUrl}}
              <a class="compare" href={{build.commit.compareUrl}}>
              <span class="icon icon--github"></span>
              Compare {{short-compare-shas build.commit.compareUrl}}</a>
            {{/if}}
          {{/if}}
        </li>
        <li title="{{format-duration build.duration}}">
          <span class="icon icon--clock"></span>
          {{#if build.isFinished}}ran{{else}}running{{/if}} for {{format-duration build.duration}}
        </li>
        <li title="{{pretty-date build.finishedAt}}">
          <span class="icon icon--cal"></span>
          {{format-time build.finishedAt}}
        </li>
      </ul>

      {{repo-actions build=build repo=build.repo user=auth.currentUser}}
    </div>
  </section>

  {{#unless build.isMatrix}}
    {{view 'annotations' annotations=build.jobs.firstObject.annotations}}
  {{/unless}}

  {{#if build.isMatrix}}
    {{#if jobsLoaded}}
      {{jobs-list jobs=build.requiredJobs repo=repo required="true"}}
      {{jobs-list jobs=build.allowedFailureJobs repo=repo}}
    {{else}}
      {{loading-indicator center=true}}
    {{/if}}
  {{else}}
    {{job-log job=build.jobs.firstObject}}
  {{/if}}

{{/if}}
