<ol class="breadcrumb">
  <li><a href="#/championships/">Kampioenschappen</a></li>
  <li class="active">Overzicht van kampioenschap {{currentChampionship}}</li>
</ol>

<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">Gereden tijden in alle poules</h3>
  </div>
	<div class="panel-body">

    <div class="row tierrow" ng-repeat="tier in overviewdata.tiers">
      <div class="col-xs-1">
        <a href="#/championship/{{currentChampionship}}/poules" class="btn btn-default btn-xs" role="button">Tier {{tier.tier}}</a>
      </div>
      <div class="col-xs-11">
        <div class="row" ng-repeat="poule in tier.poules">
          <div class="col-xs-2">
            <!-- <span class="label label-primary">Poule {{poule.poule}}</span> -->
            <!-- <a href="" type="button" class="btn btn-default btn-xs">Poule {{poule.poule}}</button> -->
            <a href="#/championship/{{currentChampionship}}/poules" class="btn btn-default btn-xs" role="button">Poule {{poule.poule}}</a>
            <a href="#/viewer/championship/{{currentChampionship}}/poule/{{tier.tier}}/{{poule.poule}}/overview" class="btn btn-default btn-xs" role="button"><span class="glyphicon glyphicon-eye-open text-muted"> </span></a>
          </div>
          <div class="col-xs-10" ng-show="poule.teams.length>0">
            <div class="row" ng-repeat="team in poule.teams">
              <div class="col-xs-2">
                <a href="#/championship/{{currentChampionship}}/poule/{{tier.tier}}/{{poule.poule}}/races" class="btn btn-default btn-xs" role="button">{{team.name}}</a>
              </div>
              <div class="col-xs-10">
                <div class="row" ng-show="team.races.length>0">
                  <div class="col-xs-2" ng-repeat ="race in team.races">
                   <!-- <span class="label label-default">{{race.idrace}}</span>
                   <span class="label" ng-class="{'label-success':race.totaltime == race.bestpouletotaltime && race.everythingmeasured,
                      'label-default':race.totaltime!=race.bestpouletotaltime}">{{race.totaltime}}</span>
                   <span class="label label-danger" ng-show="race.totalpenaltyseconds!=null">{{race.totalpenaltyseconds}}<small>s</small></span> -->

                    <div class="btn-group" role="group" aria-label="..." ng-show="race.totaltime != null">
                      <a href="#/championship/{{currentChampionship}}/poule/{{tier.tier}}/{{poule.poule}}/race/{{race.idrace}}/measurements"
                        type="button" class="btn btn-xs" title="Totale racetijd ({{race.totaltime|secondsToString}} + {{race.totalpenaltyseconds}}s penalty)" ng-class="{'btn-success':race.totaltime == race.bestpouletotaltime && race.everythingmeasured,
                         'btn-default':race.totaltime!=race.bestpouletotaltime}">
                        {{sumOfSeconds(race.totaltime, race.totalpenaltyseconds) | secondsToString}}
                      </a>
                      <a href="#/championship/{{currentChampionship}}/poule/{{tier.tier}}/{{poule.poule}}/race/{{race.idrace}}/drives"
                        type="button" class="btn btn-danger btn-xs" ng-show="race.totalpenaltyseconds!=null" title="Penalty seconden">{{race.totalpenaltyseconds}}<small>s</small>
                      </a>
                    </div>
                    <div ng-show="race.totaltime == null">
                        <a href="#/championship/{{currentChampionship}}/poule/{{tier.tier}}/{{poule.poule}}/race/{{race.idrace}}/measurements"
                          <i class="fa fa-hourglass-start"></i>
                        </a>
                    </div>
                  </div>
                </div>
                <div class="row" ng-show="team.races.length==0">
                  <div class="col-xs-2">
                    <a href="#/championship/{{currentChampionship}}/poule/{{tier.tier}}/{{poule.poule}}/races"
                      <i class="fa fa-car"></i>
                    </a>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-xs-10" ng-show="poule.teams.length==0">
            <a href="#/championship/{{currentChampionship}}/poule/{{tier.tier}}/{{poule.poule}}/teams"
              type="button" class="btn btn-warning btn-xs" title="Geen teams in deze poule, voeg er toe..."><span class="glyphicon glyphicon-import"> </span></a>
          </div>
        </div>
      </div>
    </div>

	</div>
</div>
