Paul Van Eck 3c82bc3443 Add vendor UI
This adds the initial UI functionality for the UI in relations
to vendors.

Change-Id: I58a3b00a421d2d65d59014e586bacc974aa8637b
Co-Authored-By: Andrey Pavlov <andrey-mp@yandex.ru>
2016-06-13 15:08:05 -07:00

70 lines
2.9 KiB
HTML

<h3>{{ctrl.pageHeader}}</h3>
<p>{{ctrl.pageParagraph}}</p>
<div cg-busy="{promise:ctrl.authRequest,message:'Loading'}"></div>
<div cg-busy="{promise:ctrl.vendorsRequest,message:'Loading'}"></div>
<div ng-show="ctrl.data" class="vendors-table">
<label ng-if="ctrl.isAdminView && ctrl.isUserVendors">
<input type="checkbox" ng-model="ctrl.withPrivate" ng-change="ctrl.updateData();">&nbsp;Show private vendors
</label>
<br />
<table ng-show="ctrl.data" class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="vendor in ctrl.data.vendors">
<td ng-if="ctrl.isUserVendors"><a ui-sref="vendor({vendorID: vendor.id})">{{vendor.name}}</a></td>
<td ng-if="!ctrl.isUserVendors">{{vendor.name}}</td>
<td>{{vendor.description || '-'}}</td>
<td>
<span ng-show="vendor.type == 0" class="glyphicon glyphicon-exclamation-sign">&nbsp;OpenStack</span>
<span ng-show="vendor.type == 1" class="glyphicon glyphicon-eye-close">&nbsp;Private</span>
<span ng-show="vendor.type == 2" class="glyphicon glyphicon-transfer">&nbsp;Pending Approval</span>
<span ng-show="vendor.type == 3" class="glyphicon glyphicon-check">&nbsp;Official</span>
</td>
</tr>
</tbody>
</table>
</div>
<div ng-if="ctrl.isUserVendors">
<hr />
<h4>Add new vendor</h4>
<p>Creating a vendor allows you to associate test results to specific vendors/products.
Created vendors are private, but vendors can be registered with the Foundation to become public and official.
This will require approval by a Foundation administrator.</p>
<div class="row">
<div class="col-md-3">
<label>Name</label>
<p class="input-group">
<input type="text" class="form-control"
ng-model="ctrl.name" close-text="Close" />
</p>
</div>
<div class="col-md-6">
<label>Description</label>
<p class="input-group">
<input type="text" class="form-control" size="80"
ng-model="ctrl.description" close-text="Close" />
</p>
</div>
<div class="col-md-3" style="margin-top:24px;">
<button type="submit" class="btn btn-primary" ng-click="ctrl.addVendor()">Add Vendor</button>
</div>
</div>
</div>
<div cg-busy="{promise:ctrl.vendorsRequest,message:'Loading'}"></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>