<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
  <div class="uk-width-1-1@m uk-first-column">

    <h1 class="uk-h2">Aggregation history for {{ repoName }}</h1>

    <!-- TOP HELP CONTENT -->
    <help-content #topHelperContent [position]="'top'"
                  [ngClass]="topHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'">
    </help-content>

    <div class="uk-container uk-container-large uk-margin-medium-top uk-margin-medium-bottom">
      <div class="uk-grid">

        <!-- LEFT HELP CONTENT -->
        <aside-help-content #leftHelperContent [position]="'left'"
                            [ngClass]="leftHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'">
        </aside-help-content>

        <!-- MIDDLE -->
        <div class=" uk-width-expand@m">

          <div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div>
          <div *ngIf="loadingMessage" class="loading-big">
            <div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
              {{ loadingMessage }}
            </div>
            <div class="whiteFilm"></div>
          </div>
          <div *ngIf="noAggregations">{{ noAggregations }}</div>
          <div *ngIf="aggregationsMap && years && (years.length > 0) && !noAggregations">
            <div *ngFor="let year of years" class="uk-width-1-1@m">
              <ul class="uk-list uk-list-striped">
                <h4>{{ year }}</h4>
                <li *ngFor="let aggr of aggregationsMap[year]">
                  <div class="uk-grid uk-child-width-1-4">
                    <div><span *ngIf="aggr.date">{{ aggr.date | date : "yyyy-MM-dd" }}</span></div>
                    <div><span *ngIf="aggr.aggregationStage">Aggregation stage: {{ aggr.aggregationStage }}</span></div>
                    <div><span *ngIf="aggr.collectionMode">CollectionMode: {{ aggr.collectionMode }}</span></div>
                    <div><span *ngIf="aggr.numberOfRecords">Number of records: {{ aggr.numberOfRecords }}</span></div>
                    <div><span *ngIf="aggr.indexedVersion !== null">Is the indexed version: {{ (aggr.indexedVersion === true) ? 'Yes': 'No' }}</span></div>
                  </div>
                </li>
              </ul>
              <hr>
            </div>
          </div>

          <div *ngIf="repo" class="uk-inline">
            <div class="uk-float-right" style="z-index: 100; bottom: 30px; position: fixed; right: 30px;">
              <button [routerLink]="['/compatibility/monitor', repo.id]"
                      style="box-shadow: 0 1px 10px #444444"
                      class="uk-button uk-button-primary">
                Go back
              </button>
            </div>
          </div>

        </div>

        <!-- RIGHT HELP CONTENT -->
        <aside-help-content #rightHelperContent [position]="'right'"
                            [ngClass]="rightHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'">
        </aside-help-content>

      </div>
    </div>


    <!-- BOTTOM HELP CONTENT -->
    <help-content #bottomHelperContent [position]="'bottom'"
                  [ngClass]="bottomHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'">
    </help-content>


  </div>
</div>
