Tao Zhou | 737bb53 | 2020-04-17 17:24:05 +0200 | [diff] [blame^] | 1 | /** |
| 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 Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 17 | |
Tao Zhou | 737bb53 | 2020-04-17 17:24:05 +0200 | [diff] [blame^] | 18 | export const htmlTemplate = Polymer.html` |
Dhruv Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 19 | <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 Srivastava | 00ee5ab | 2020-03-25 20:57:32 +0100 | [diff] [blame] | 66 | #listOverlay { |
| 67 | max-width: 90%; |
| 68 | max-height: 90%; |
| 69 | overflow: auto; |
| 70 | } |
Dhruv Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 71 | </style> |
| 72 | |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 73 | <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 Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 78 | type="text" |
Dhruv Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 79 | bind-value="{{_filter}}"> |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 80 | <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 Zhou | f34a9d4 | 2019-11-18 13:24:11 -0800 | [diff] [blame] | 89 | <gr-button primary link id="createNew" on-click="_handleCreateClicked"> |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 90 | Create New |
| 91 | </gr-button> |
| 92 | </div> |
Dhruv Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 93 | </div> |
Dhruv Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 94 | |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 95 | <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 Zhou | f34a9d4 | 2019-11-18 13:24:11 -0800 | [diff] [blame] | 114 | <td on-click="_handleEditIconClicked"> |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 115 | <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 Zhou | f34a9d4 | 2019-11-18 13:24:11 -0800 | [diff] [blame] | 125 | on-click="_handlePrevClicked"> |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 126 | <iron-icon class="nav-iron-icon" icon="gr-icons:chevron-left"></iron-icon> |
| 127 | </a> |
Dhruv Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 128 | </template> |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 129 | <template is="dom-if" if="[[_showNextButton]]"> |
| 130 | <a class="nav-buttons" id="nextArrow" |
Tao Zhou | f34a9d4 | 2019-11-18 13:24:11 -0800 | [diff] [blame] | 131 | on-click="_handleNextClicked"> |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 132 | <iron-icon icon="gr-icons:chevron-right"></iron-icon> |
| 133 | </a> |
| 134 | </template> |
| 135 | </nav> |
Dhruv Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 136 | |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 137 | <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 Srivastava | ce3c7d0 | 2019-08-08 16:35:36 +0200 | [diff] [blame] | 173 | </gr-overlay> |
Dhruv Srivastava | 8d1d2d2 | 2019-09-18 20:27:18 +0200 | [diff] [blame] | 174 | <gr-rest-api-interface id="restAPI"></gr-rest-api-interface> |
Tao Zhou | 737bb53 | 2020-04-17 17:24:05 +0200 | [diff] [blame^] | 175 | `; |