Paul Van Eck d23adad7f6 Update eslint and update angular style to match
With an updated eslint version and the addition of eslint-config-openstack
and eslint-plugin-angular, there are several more stylistic guidelines to
follow. However, this is what other OpenStack angular projects follow such
as Horizon. Some notable changes are:

* Wrapped javascript content in anonymous functions. This is a safeguard to
  keep the code from conflicting with other variables with the same name in
  other scripts on the same page.

* Explicitly inject dependencies and have controllers, factories, etc as
  explicitly declared functions.

* Use angular "controller as" syntax instead of assigning variables to $scope.

* Added eslint rule that requires JSDoc for every function declaration.

Note these are mainly stylistic changes and all the functionality of RefStack
should remain the same.

Change-Id: I044b1f473d589681a2ae9d2704700dd85687cbb6
2015-09-30 13:47:20 -07:00

83 lines
3.2 KiB
HTML

<h3>{{ctrl.pageHeader}}</h3>
<p>The most recently uploaded community test results are listed here.</p>
<div class="result-filters">
<h4>Filters</h4>
<div class="row">
<div class="col-md-3">
<label for="cpid">Start Date</label>
<p class="input-group">
<input type="text" class="form-control"
datepicker-popup="{{ctrl.format}}"
ng-model="ctrl.startDate" is-open="ctrl.startOpen"
close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="ctrl.open($event, 'startOpen')">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
</div>
<div class="col-md-3">
<label for="cpid">End Date</label>
<p class="input-group">
<input type="text" class="form-control"
datepicker-popup="{{ctrl.format}}"
ng-model="ctrl.endDate" is-open="ctrl.endOpen"
close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="ctrl.open($event, 'endOpen')">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
</div>
<div class="col-md-3"style="margin-top:24px;">
<button type="submit" class="btn btn-primary" ng-click="ctrl.update()">Filter</button>
<button type="submit" class="btn btn-primary btn-danger" ng-click="ctrl.clearFilters()">Clear</button>
</div>
</div>
</div>
<div cg-busy="{promise:ctrl.authRequest,message:'Loading'}"></div>
<div cg-busy="{promise:ctrl.resultsRequest,message:'Loading'}"></div>
<div ng-show="ctrl.data" class="results-table">
<table ng-show="ctrl.data" class="table table-striped table-hover">
<thead>
<tr>
<th>Upload Date</th>
<th>Test Run ID</th>
<th ng-if="ctrl.isUserResults">Shared</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="result in ctrl.data.results">
<td>{{result.created_at}}</td>
<td><a ui-sref="resultsDetail({testID: result.id})">{{result.id}}</a></td>
<td ng-if="ctrl.isUserResults"><span ng-show="result.meta.shared" class="glyphicon glyphicon-share"></span></td>
</tr>
</tbody>
</table>
<div class="pages">
<pagination
total-items="ctrl.totalItems"
ng-model="ctrl.currentPage"
items-per-page="ctrl.itemsPerPage"
max-size="ctrl.maxSize"
class="pagination-sm"
boundary-links="true"
rotate="false"
num-pages="ctrl.numPages"
ng-change="ctrl.update()">
</pagination>
</div>
</div>
<div ng-show="ctrl.showError" class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
{{ctrl.error}}
</div>