Merge "add web portal framework for TestAPI"
[releng.git] / utils / test / testapi / 3rd_party / static / testapi-ui / components / results / results.html
1 <h3>{{ctrl.pageHeader}}</h3>
2 <p>{{ctrl.pageParagraph}}</p>
3
4 <div class="result-filters">
5     <h4>Filters</h4>
6     <div class="row">
7         <div class="col-md-3">
8             <label for="cpid">Start Date</label>
9             <p class="input-group">
10                 <input type="text" class="form-control"
11                     uib-datepicker-popup="{{ctrl.format}}"
12                     ng-model="ctrl.startDate" is-open="ctrl.startOpen"
13                     close-text="Close" />
14                 <span class="input-group-btn">
15                     <button type="button" class="btn btn-default" ng-click="ctrl.open($event, 'startOpen')">
16                         <i class="glyphicon glyphicon-calendar"></i>
17                     </button>
18                 </span>
19             </p>
20         </div>
21         <div class="col-md-3">
22             <label for="cpid">End Date</label>
23             <p class="input-group">
24                 <input type="text" class="form-control"
25                     uib-datepicker-popup="{{ctrl.format}}"
26                     ng-model="ctrl.endDate" is-open="ctrl.endOpen"
27                     close-text="Close" />
28                 <span class="input-group-btn">
29                     <button type="button" class="btn btn-default" ng-click="ctrl.open($event, 'endOpen')">
30                         <i class="glyphicon glyphicon-calendar"></i>
31                     </button>
32                 </span>
33             </p>
34         </div>
35         <div class="col-md-3" style="margin-top:24px;">
36             <button type="submit" class="btn btn-primary" ng-click="ctrl.update()">Filter</button>
37             <button type="submit" class="btn btn-primary btn-danger" ng-click="ctrl.clearFilters()">Clear</button>
38         </div>
39     </div>
40 </div>
41
42 <div cg-busy="{promise:ctrl.authRequest,message:'Loading'}"></div>
43 <div cg-busy="{promise:ctrl.resultsRequest,message:'Loading'}"></div>
44
45 <div ng-show="ctrl.data" class="results-table">
46     <table ng-show="ctrl.data" class="table table-striped table-hover">
47         <thead>
48             <tr>
49                 <th ng-if="ctrl.isUserResults"></th>
50                 <th>Upload Date</th>
51                 <th>Test Run ID</th>
52                 <th ng-if="ctrl.isUserResults">Vendor</th>
53                 <th ng-if="ctrl.isUserResults">Product (version)</th>
54                 <th ng-if="ctrl.isUserResults">Target Program</th>
55                 <th ng-if="ctrl.isUserResults">Guideline</th>
56                 <th ng-if="ctrl.isUserResults">Verified</th>
57                 <th ng-if="ctrl.isUserResults">Shared</th>
58             </tr>
59         </thead>
60
61         <tbody>
62             <tr ng-repeat-start="(index, result) in ctrl.data.results">
63                 <td ng-if="ctrl.isUserResults">
64                     <a ng-if="!result.expanded"
65                        class="glyphicon glyphicon-plus"
66                        ng-click="result.expanded = true">
67                     </a>
68                     <a ng-if="result.expanded"
69                        class="glyphicon glyphicon-minus"
70                        ng-click="result.expanded = false">
71                     </a>
72                 </td>
73                 <td>{{result.created_at}}</td>
74                 <td><a ui-sref="resultsDetail({testID: result.id})">
75                         {{result.id.slice(0, 8)}}...{{result.id.slice(-8)}}
76                     </a>
77                 </td>
78                 <td ng-if="ctrl.isUserResults">
79                     {{ctrl.vendors[result.product_version.product_info.organization_id].name || '-'}}
80                 </td>
81                 <td ng-if="ctrl.isUserResults">{{result.product_version.product_info.name || '-'}}
82                     <span ng-if="result.product_version.version">
83                         ({{result.product_version.version}})
84                     </span>
85                 </td>
86                 <td ng-if="ctrl.isUserResults">{{ctrl.targetMappings[result.meta.target] || '-'}}</td>
87                 <td ng-if="ctrl.isUserResults">{{result.meta.guideline.slice(0, -5) || '-'}}</td>
88                 <td ng-if="ctrl.isUserResults">
89                     <span ng-if="result.verification_status" class="glyphicon glyphicon-ok"></span>
90                     <span ng-if="!result.verification_status">-</span>
91
92                 </td>
93                 <td ng-if="ctrl.isUserResults">
94                     <span ng-show="result.meta.shared" class="glyphicon glyphicon-share"></span>
95                 </td>
96             </tr>
97             <tr ng-if="result.expanded" ng-repeat-end>
98                 <td></td>
99                 <td colspan="3">
100                     <strong>Publicly Shared:</strong>
101                     <span ng-if="result.meta.shared == 'true' && !result.sharedEdit">Yes</span>
102                     <span ng-if="!result.meta.shared && !result.sharedEdit">
103                         <em>No</em>
104                     </span>
105                     <select ng-if="result.sharedEdit"
106                             ng-model="result.meta.shared"
107                             class="form-inline">
108                             <option value="true">Yes</option>
109                             <option value="">No</option>
110                     </select>
111                     <a ng-if="!result.sharedEdit"
112                        ng-click="result.sharedEdit = true"
113                        title="Edit"
114                        class="glyphicon glyphicon-pencil"></a>
115                     <a ng-if="result.sharedEdit"
116                        ng-click="ctrl.associateMeta(index,'shared',result.meta.shared)"
117                        title="Save"
118                        class="glyphicon glyphicon-floppy-disk"></a>
119                     <br />
120
121                     <strong>Associated Guideline:</strong>
122                     <span ng-if="!result.meta.guideline && !result.guidelineEdit">
123                         <em>None</em>
124                     </span>
125                     <span ng-if="result.meta.guideline && !result.guidelineEdit">
126                         {{result.meta.guideline.slice(0, -5)}}
127                     </span>
128                     <select ng-if="result.guidelineEdit"
129                             ng-model="result.meta.guideline"
130                             ng-options="o as o.slice(0, -5) for o in ctrl.versionList"
131                             class="form-inline">
132                         <option value="">None</option>
133                     </select>
134                     <a ng-if="!result.guidelineEdit"
135                        ng-click="ctrl.getVersionList();result.guidelineEdit = true"
136                        title="Edit"
137                        class="glyphicon glyphicon-pencil"></a>
138                     <a ng-if="result.guidelineEdit"
139                        ng-click="ctrl.associateMeta(index, 'guideline', result.meta.guideline)"
140                        title="Save"
141                        class="glyphicon glyphicon-floppy-disk">
142                     </a>
143                     <br />
144
145                     <strong>Associated Target Program:</strong>
146                     <span ng-if="!result.meta.target && !result.targetEdit">
147                         <em>None</em>
148                     </span>
149                     <span ng-if="result.meta.target && !result.targetEdit">
150                         {{ctrl.targetMappings[result.meta.target]}}</span>
151                     <select ng-if="result.targetEdit"
152                             ng-model="result.meta.target"
153                             class="form-inline">
154                         <option value="">None</option>
155                         <option value="platform">OpenStack Powered Platform</option>
156                         <option value="compute">OpenStack Powered Compute</option>
157                         <option value="object">OpenStack Powered Object Storage</option>
158                     </select>
159                     <a ng-if="!result.targetEdit"
160                        ng-click="result.targetEdit = true;"
161                        title="Edit"
162                        class="glyphicon glyphicon-pencil">
163                     </a>
164                     <a ng-if="result.targetEdit"
165                        ng-click="ctrl.associateMeta(index, 'target', result.meta.target)"
166                        title="Save"
167                        class="glyphicon glyphicon-floppy-disk">
168                     </a>
169                     <br />
170
171                     <strong>Associated Product:</strong>
172                     <span ng-if="!result.product_version && !result.productEdit">
173                         <em>None</em>
174                     </span>
175                     <span ng-if="result.product_version && !result.productEdit">
176                         <span ng-if="ctrl.products[result.product_version.product_info.id].product_type == 0">
177                             <a ui-sref="distro({id: result.product_version.product_info.id})">
178                                 {{ctrl.products[result.product_version.product_info.id].name}}
179                                 <small ng-if="result.product_version.version">
180                                     ({{result.product_version.version}})
181                                 </small>
182                             </a>
183                         </span>
184                         <span ng-if="ctrl.products[result.product_version.product_info.id].product_type != 0">
185                             <a ui-sref="cloud({id: result.product_version.product_info.id})">
186                                 {{ctrl.products[result.product_version.product_info.id].name}}
187                                 <small ng-if="result.product_version.version">
188                                     ({{result.product_version.version}})
189                                 </small>
190                             </a>
191                         </span>
192                     </span>
193
194                     <select ng-if="result.productEdit"
195                             ng-options="product as product.name for product in ctrl.products | arrayConverter | orderBy: 'name' track by product.id"
196                             ng-model="result.selectedProduct"
197                             ng-change="ctrl.getProductVersions(result)">
198                         <option value="">-- No Product --</option>
199                     </select>
200
201                     <span ng-if="result.productVersions.length && result.productEdit">
202                         <span class="glyphicon glyphicon-arrow-right" style="padding-right:3px;color:#303030;"></span>
203                         Version:
204                         <select ng-options="version as version.version for version in result.productVersions | orderBy: 'version' track by version.id"
205                                 ng-model="result.selectedVersion">
206                         </select>
207
208                     </span>
209                     <a ng-if="!result.productEdit"
210                        ng-click="ctrl.prepVersionEdit(result)"
211                        title="Edit"
212                        class="glyphicon glyphicon-pencil">
213                     </a>
214                     <a ng-if="result.productEdit"
215                        ng-click="ctrl.associateProductVersion(result)"
216                        confirm="Once you associate this test to this product, ownership
217                                 will be transferred to the product's vendor admins.
218                                 Continue?"
219                        title="Save"
220                        class="glyphicon glyphicon-floppy-disk">
221                     </a>
222                     <br />
223                 </td>
224             </tr>
225         </tbody>
226     </table>
227
228     <div class="pages">
229         <uib-pagination
230             total-items="ctrl.totalItems"
231             ng-model="ctrl.currentPage"
232             items-per-page="ctrl.itemsPerPage"
233             max-size="ctrl.maxSize"
234             class="pagination-sm"
235             boundary-links="true"
236             rotate="false"
237             num-pages="ctrl.numPages"
238             ng-change="ctrl.update()">
239         </uib-pagination>
240     </div>
241 </div>
242
243 <div ng-show="ctrl.showError" class="alert alert-danger" role="alert">
244     <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
245     <span class="sr-only">Error:</span>
246     {{ctrl.error}}
247 </div>