<div class="build-view">
  <div class="resource-view" resources="[buildResource, repoResource]"
       error-message="'Build not found'">

    <div class="page-content">
      <div class="cor-title">
        <span class="cor-title-link">
          <a class="back-link" href="/repository/{{ namespace }}/{{ name }}?tab=builds">
            <i class="fa fa-hdd-o" style="margin-right: 4px"></i>
            {{ namespace }}/{{ name }}
          </a>
        </span>
        <span class="cor-title-content">
          <i class="fa fa-tasks fa-lg" style="margin-right: 10px"></i> {{ build.display_name }}
        </span>
      </div>

      <div class="co-main-content-panel">
        <!-- Build Information -->
        <div class="build-info-bar" build="build" show-time="false"></div>

        <!-- Current Status -->
        <div class="build-status-header">
          <span class="build-icon-message" ng-class="build.phase">
            <span class="cor-loader-inline" ng-if="isBuilding(build)"></span>
            <span ng-if="!isBuilding(build)">
              <i class="fa fa-check-circle" ng-if="build.phase == 'complete'"></i>
              <i class="fa fa-times-circle" ng-if="build.phase == 'error'"></i>
              <i class="fa fa-exclamation-circle" ng-if="build.phase == 'internalerror'"></i>
            </span>
            <span class="build-message" phase="build.phase"></span>
          </span>

          <span class="cor-options-menu">
            <span class="cor-option" option-click="toggleTimestamps()">
              <span ng-if="showLogTimestamps">
                <i class="fa fa-clock-o"></i> Hide Timestamps
              </span>
              <span ng-if="!showLogTimestamps">
                <i class="fa fa-clock-o"></i> Show Timestamps
              </span>
            </span>
            <span class="cor-option" option-click="askCancelBuild(build)"
                  ng-if="build.phase == 'waiting'">
              <i class="fa fa-times"></i> Cancel Build
            </span>
          </span>

          <div class="timing">
            <i class="fa fa-clock-o"></i>
            Build started
            <span am-time-ago="build.started || 0"></span>
          </div>
        </div>

        <!-- Build Logs -->
        <div class="build-logs-view"
             build="originalBuild"
             use-timestamps="showLogTimestamps"
             build-updated="setUpdatedBuild(build)"></div>
      </div>
    </div>
  </div>
</div>
