blob: 19f224f12fe5b053b26b7463ec479a9c565fa9bd [file] [log] [blame]
Tao Zhou737bb532020-04-17 17:24:05 +02001/**
2 * @license
3 * Copyright (C) 2020 The Android Open Source Project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +020017
Tao Zhou737bb532020-04-17 17:24:05 +020018export const htmlTemplate = Polymer.html`
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +020019 <style include="shared-styles"></style>
20 <style include="gr-table-styles"></style>
21 <style>
22 iron-icon {
23 cursor: pointer;
24 }
25 #filter {
26 font-size: var(--font-size-normal);
27 max-width: 25em;
28 }
29 #filter:focus {
30 outline: none;
31 }
32 #topContainer {
33 align-items: center;
34 display: flex;
35 height: 3rem;
36 justify-content: space-between;
37 margin: 0 1em;
38 }
39 #createNewContainer:not(.show) {
40 display: none;
41 }
42 a {
43 color: var(--primary-text-color);
44 text-decoration: none;
45 }
46 nav {
47 align-items: center;
48 display: flex;
49 height: 3rem;
50 justify-content: flex-end;
51 margin-right: 20px;
52 }
53 nav,
54 iron-icon {
55 color: var(--deemphasized-text-color);
56 }
57 .nav-iron-icon {
58 height: 1.85rem;
59 margin-left: 16px;
60 width: 1.85rem;
61 }
62 .nav-buttons:hover {
63 text-decoration: underline;
64 cursor: pointer;
65 }
Dhruv Srivastava00ee5ab2020-03-25 20:57:32 +010066 #listOverlay {
67 max-width: 90%;
68 max-height: 90%;
69 overflow: auto;
70 }
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +020071 </style>
72
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +020073 <gr-overlay on-fullscreen-overlay-closed="_handleOverlayClosed" id="listOverlay" with-backdrop>
74 <div id="topContainer">
75 <div>
76 <label>Filter:</label>
77 <iron-input
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +020078 type="text"
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +020079 bind-value="{{_filter}}">
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +020080 <input
81 is="iron-input"
82 type="text"
83 id="filter"
84 bind-value="{{_filter}}">
85 </iron-input>
86 </div>
87 <div id="createNewContainer"
88 class$="[[_computeCreateClass(_createNewCapability)]]">
Tao Zhouf34a9d42019-11-18 13:24:11 -080089 <gr-button primary link id="createNew" on-click="_handleCreateClicked">
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +020090 Create New
91 </gr-button>
92 </div>
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +020093 </div>
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +020094
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +020095 <table id="list" class="genericList">
96 <tr class="headerRow">
97 <th class="name topHeader">Checker Name</th>
98 <th class="name topHeader">Repository</th>
99 <th class="name topHeader">Status</th>
100 <th class="name topHeader">Required</th>
101 <th class="topHeader description">Checker Description</th>
102 <th class="name topHeader"> Edit </th>
103 </tr>
104 <tbody id="listBody" class$="[[computeLoadingClass(_loading)]]">
105 <template is="dom-repeat" items="[[_visibleCheckers]]">
106 <tr class="table">
107 <td class="name">
108 <a>[[item.name]]</a>
109 </td>
110 <td class="name">[[item.repository]]</td>
111 <td class="name">[[item.status]]</td>
112 <td class="name">[[_computeBlocking(item)]]</td>
113 <td class="description">[[item.description]]</td>
Tao Zhouf34a9d42019-11-18 13:24:11 -0800114 <td on-click="_handleEditIconClicked">
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +0200115 <iron-icon icon="gr-icons:edit"></iron-icon>
116 </td>
117 </tr>
118 </template>
119 </tbody>
120 </table>
121
122 <nav>
123 <template is="dom-if" if="[[_showPrevButton]]">
124 <a class="nav-buttons" id="prevArrow"
Tao Zhouf34a9d42019-11-18 13:24:11 -0800125 on-click="_handlePrevClicked">
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +0200126 <iron-icon class="nav-iron-icon" icon="gr-icons:chevron-left"></iron-icon>
127 </a>
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +0200128 </template>
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +0200129 <template is="dom-if" if="[[_showNextButton]]">
130 <a class="nav-buttons" id="nextArrow"
Tao Zhouf34a9d42019-11-18 13:24:11 -0800131 on-click="_handleNextClicked">
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +0200132 <iron-icon icon="gr-icons:chevron-right"></iron-icon>
133 </a>
134 </template>
135 </nav>
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +0200136
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +0200137 <gr-overlay id="createOverlay">
138 <gr-dialog
139 id="createDialog"
140 confirm-label="Create"
141 on-confirm="_handleCreateConfirm"
142 on-cancel="_handleCreateCancel">
143 <div class="header" slot="header">
144 Create Checkers
145 </div>
146 <div slot="main">
147 <gr-create-checkers-dialog
148 id="createNewModal"
149 plugin-rest-api="[[pluginRestApi]]">
150 </gr-create-checkers-dialog>
151 </div>
152 </gr-dialog>
153 </gr-overlay>
154 <gr-overlay id="editOverlay">
155 <gr-dialog
156 id="editDialog"
157 confirm-label="Save"
158 on-confirm="_handleEditConfirm"
159 on-cancel="_handleEditCancel">
160 <div class="header" slot="header">
161 Edit Checker
162 </div>
163 <div slot="main">
164 <gr-create-checkers-dialog
165 checker="[[checker]]"
166 plugin-rest-api="[[pluginRestApi]]"
167 on-cancel="_handleEditCancel"
168 id="editModal">
169 </gr-create-checkers-dialog>
170 </div>
171 </gr-dialog>
172 </gr-overlay>
Dhruv Srivastavace3c7d02019-08-08 16:35:36 +0200173 </gr-overlay>
Dhruv Srivastava8d1d2d22019-09-18 20:27:18 +0200174 <gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
Tao Zhou737bb532020-04-17 17:24:05 +0200175`;