<div class="row" ng-controller="Kubernetes.BuildConfigsController">
  <script type="text/ng-template" id="buildConfigLinkTemplate.html">
    <div class="ngCellText">
      <a title="View details for this build configuration"
         href="{{baseUri}}/kubernetes/buildConfigs/{{row.entity.metadata.name}}">
<!--
        <img class="app-icon-small" ng-src="{{row.entity.$iconUrl}}">
-->
        {{row.entity.metadata.name}}</a>
    </div>
  </script>
  <script type="text/ng-template" id="buildConfigViewsTemplate.html">
    <div class="ngCellText">
      <span ng-repeat="view in row.entity.$fabric8Views track by $index">
        <a title="{{view.description}}" ng-show="view.url" ng-href="{{view.url}}" class="btn btn-default">
          <i class="{{view.iconClass}}" ng-show="view.iconClass"></i>
          {{view.label}}
        </a>
      </span>
    </div>
  </script>
  <script type="text/ng-template" id="buildConfigCodeViewsTemplate.html">
    <div class="ngCellText">
      <span ng-repeat="view in row.entity.$fabric8CodeViews track by $index">
        <a title="{{view.description}}" ng-show="view.url" ng-href="{{view.url}}" class="btn btn-default">
          <i class="{{view.iconClass}}" ng-show="view.iconClass"></i>
          {{view.label}}
        </a>
      </span>
    </div>
  </script>
  <script type="text/ng-template" id="buildConfigBuildViewsTemplate.html">
    <div class="ngCellText">
      <span ng-repeat="view in row.entity.$fabric8BuildViews track by $index">
        <a title="{{view.description}}" ng-show="view.url" ng-href="{{view.url}}" class="btn btn-default">
          <i class="{{view.iconClass}}" ng-show="view.iconClass"></i>
          {{view.label}}
        </a>
      </span>
    </div>
  </script>
  <script type="text/ng-template" id="buildConfigEnvironmentViewsTemplate.html">
    <div class="ngCellText">
      <span ng-repeat="view in row.entity.$fabric8EnvironmentViews track by $index">
        <a title="{{view.description}}" ng-show="view.url" ng-href="{{view.url}}" class="btn btn-default">
          <i class="{{view.iconClass}}" ng-show="view.iconClass"></i>
          {{view.label}}
        </a>
      </span>
    </div>
  </script>
  <script type="text/ng-template" id="buildConfigTeamViewsTemplate.html">
    <div class="ngCellText">
      <span ng-repeat="view in row.entity.$fabric8TeamViews track by $index">
        <a title="{{view.description}}" ng-show="view.url" ng-href="{{view.url}}" class="btn btn-default">
          <i class="{{view.iconClass}}" ng-show="view.iconClass"></i>
          {{view.label}}
        </a>
      </span>
    </div>
  </script>
  <div class="row filter-header">
    <div class="col-md-12">
      <span>
        <hawtio-filter ng-show="buildConfigs.length"
                       ng-model="tableConfig.filterOptions.filterText"
                       css-class="input-xxlarge"
                       placeholder="Filter build configurations..."></hawtio-filter>
      </span>
      <button ng-show="fetched"
              title="Delete the selected build configuration"
              class="btn btn-danger pull-right"
              ng-disabled="tableConfig.selectedItems.length == 0"
              ng-click="deletePrompt(tableConfig.selectedItems)">
        <i class="fa fa-remove"></i> Delete
      </button>
      <span class="pull-right">&nbsp;</span>
      <a class="btn btn-default pull-right"
         title="Add a build configuration for an existing project"
         href="{{baseUri}}/kubernetes/buildConfigCreate"><i class="fa fa-wrench"></i> Add Build</a>
      <span class="pull-right">&nbsp;</span>

      <a class="btn btn-primary pull-right" href="/workspaces/{{namespace}}/forge/createProject"
         ng-show="isLoggedIntoGogs()"
         title="Create a new app and repository">
        <i class="fa fa-plus"></i> Create Project</a>
      </a>
      <span class="pull-right" ng-show="isLoggedIntoGogs()">&nbsp;</span>

      <a class="btn btn-primary pull-right" href="/workspaces/{{namespace}}/forge/repos"
         ng-hide="isLoggedIntoGogs()"
         title="Sign in to gogs so that you can create a new app">
        <i class="fa fa-sign-in"></i> Sign In</a>
      </a>
      <span class="pull-right" ng-hide="isLoggedIntoGogs()">&nbsp;</span>

      <button class="btn btn-default pull-right"
         title="Trigger the given build"
         ng-disabled="tableConfig.selectedItems.length != 1 || !tableConfig.selectedItems[0].$triggerUrl"
         ng-click="triggerBuild(tableConfig.selectedItems[0])"><i class="fa fa-play-circle-o"></i> Trigger</button>
    </div>
  </div>
  <div class="row">
    <div class="col-md-12">
      <div ng-hide="model.fetched">
        <div class="align-center">
          <i class="fa fa-spinner fa-spin"></i>
        </div>
      </div>
      <div ng-show="model.fetched">
        <div ng-hide="model.buildconfigs.length" class="align-center">
          <p class="alert alert-info">There are no build configurations available.</p>
          <a class="btn btn-primary" href="{{baseUri}}/kubernetes/buildConfigCreate"><i class="fa fa-wrench"></i> Add Build Configuration</a>
        </div>
        <div ng-show="model.buildconfigs.length">
          <table class="table table-bordered table-striped" ui-if="kubernetes.selectedNamespace"
                 hawtio-simple-table="tableConfig"></table>
        </div>
      </div>
    </div>
  </div>
</div>
