<div class="builds-block">
  <div class="builds" ng-repeat="trigger in triggers">
    <div ng-if="trigger.type === 'ImageChange'">
      <div ng-repeat="build in buildsByOutputImage[(trigger.imageChangeParams.from | imageObjectRef : namespace)] | orderObjectsByDate track by (build | uid)"
          ng-if="!isBuildHidden(build)"
          class="build animate-repeat osc-object"
          kind="Build"
          resource="build">
        <!-- Icon -->
        <status-icon status="build.status.phase" style="margin-right: 5px;"></status-icon>
        <!-- Message -->
        Build
        <span ng-if="build | annotation : 'buildNumber'">
          <a ng-href="{{build | navigateResourceURL}}">
            <span ng-if="build.metadata.labels.buildconfig">{{build.metadata.labels.buildconfig}}</span>
            #{{build | annotation : 'buildNumber'}}
          </a>
        </span>
        <span ng-if="!(build | annotation : 'buildNumber')">
          {{build.metadata.name}}
        </span>
        <span ng-switch="build.status.phase" class="hide-ng-leave" style="margin-right: 5px;">
          <span ng-switch-when="Complete">completed.</span>
          <span ng-switch-when="Failed">failed.</span>
          <span ng-switch-when="Error">encountered an error.</span>
          <span ng-switch-when="Cancelled">was cancelled.</span>
          <span ng-switch-default>is {{build.status.phase | lowercase}}.
            <span ng-if="trigger.imageChangeParams.automatic">
              A new deployment will be created automatically once the build completes.
            </span>
          </span>
        </span>
        <a
          ng-if="!!['New', 'Pending'].indexOf(build.status.phase)"
          ng-href="{{build | navigateResourceURL}}?tab=logs">
          View Log
        </a>
        <span class="action-divider" ng-show="!!['New', 'Pending'].indexOf(build.status.phase) && !(build | isIncompleteBuild)">|</span>
        <a ng-hide="build | isIncompleteBuild" href="" ng-click="hideBuild(build)">Dismiss</a>
      </div>
    </div>
  </div>
</div>



