| <!-- |
| Copyright (C) 2017 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <link rel="import" href="../../../behaviors/base-url-behavior/base-url-behavior.html"> |
| <link rel="import" href="../../../behaviors/gr-url-encoding-behavior.html"> |
| <link rel="import" href="../../../bower_components/polymer/polymer.html"> |
| <link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html"> |
| |
| <link rel="import" href="../../../styles/gr-form-styles.html"> |
| |
| <dom-module id="gr-admin-project-list"> |
| <template> |
| <style> |
| :host { |
| display: flex; |
| flex-direction: column; |
| } |
| tr.project-table { |
| border-bottom: 1px solid #eee; |
| } |
| #projectList { |
| border-collapse: collapse; |
| width: 100%; |
| } |
| td { |
| flex-shrink: 0; |
| padding: .3em .5em; |
| } |
| th { |
| background-color: #ddd; |
| border-bottom: 1px solid #eee; |
| font-weight: bold; |
| padding: .3em .5em; |
| text-align: left; |
| } |
| a { |
| color: var(--default-text-color); |
| text-decoration: none; |
| } |
| a:hover { |
| text-decoration: underline; |
| } |
| nav { |
| padding: .5em 0; |
| text-align: center; |
| } |
| nav a { |
| display: inline-block; |
| } |
| nav a:first-of-type { |
| margin-right: .5em; |
| } |
| .description { |
| width: 70%; |
| } |
| </style> |
| <table id="projectList"> |
| <tr class="headerRow"> |
| <th class="name topHeader">Project Name</th> |
| <th class="description topHeader">Project Description</th> |
| <th class="repositoryBrowser topHeader">Repository Browser</th> |
| <th class="readOnly topHeader">Read only</th> |
| </tr> |
| <template is="dom-repeat" items="[[_shownProjects]]"> |
| <tr class="project-table"> |
| <td class="name"> |
| <a href$="[[_getUrl(item.id)]]">[[item.name]]</a> |
| </td> |
| <td class="description">[[item.description]]</td> |
| <td class="repositoryBrowser"> |
| <template is="dom-repeat" |
| items="[[_computeWeblink(item)]]" as="link"> |
| <a href$="[[link.url]]" class="webLink" rel="noopener" target="_blank"> |
| ([[link.name]]) |
| </a> |
| </template> |
| </td> |
| <td class="readOnly">[[_readOnly(item)]]</td> |
| </tr> |
| </template> |
| </table> |
| <nav> |
| <a id="prevArrow" |
| href$="[[_computeNavLink(_offset, -1, _projectsPerPage)]]" |
| hidden$="[[_hidePrevArrow(_offset)]]" hidden>← Prev</a> |
| <a id="nextArrow" |
| href$="[[_computeNavLink(_offset, 1, _projectsPerPage)]]" |
| hidden$="[[_hideNextArrow(_loading, _projects)]]" hidden> |
| Next →</a> |
| </nav> |
| <gr-rest-api-interface id="restAPI"></gr-rest-api-interface> |
| </template> |
| <script src="gr-admin-project-list.js"></script> |
| </dom-module> |