| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2017 The LUCI Authors. All rights reserved. | 2 Copyright 2017 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="../../bower_components/paper-item/paper-item.html"> | 7 <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"> |
| 8 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> |
| 9 <link rel="import" href="../../bower_components/paper-card/paper-card.html"> |
| 8 <link rel="import" href="../../bower_components/polymer/polymer.html"> | 10 <link rel="import" href="../../bower_components/polymer/polymer.html"> |
| 9 <link rel="import" href="../../bower_components/iron-icons/maps-icons.html"> | 11 <link rel="import" href="../../bower_components/iron-icons/maps-icons.html"> |
| 10 <link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layou
t.html"> | 12 <link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layou
t.html"> |
| 11 | 13 |
| 12 <dom-module id="config-file-card"> | 14 <dom-module id="config-file-card"> |
| 13 <template> | 15 <template> |
| 14 <style include="iron-flex iron-flex-alignment"> | 16 <style> |
| 15 .center { | 17 a { text-decoration: none; } |
| 16 margin: auto; | 18 |
| 17 width: 25%; | 19 paper-card { |
| 18 border-style: solid; | 20 max-width: 500px; |
| 19 border-width: 2px; | 21 width: 100%; |
| 20 } | 22 } |
| 21 | 23 |
| 22 iron-icon { | 24 .config-title { @apply --paper-font-headline; } |
| 23 float: right; | |
| 24 } | |
| 25 | 25 |
| 26 .light { color: var(--paper-grey-600); } |
| 27 |
| 28 .config-open { color: var(--google-blue-500); } |
| 26 </style> | 29 </style> |
| 27 | 30 |
| 28 <paper-item class="center"> | 31 <paper-card elevation="2"> |
| 29 <!-- TODO(cwpayton): Currently, each card contains a link to the | 32 <div class="card-content"> |
| 30 corresponding file in gitiles. We would like to pretty print the | 33 <div class="config-title">[[name]]</div> |
| 31 contents of the file in the UI instead of externally linking. --> | |
| 32 <div class="horizontal layout wrap" style="width: 100%"> | |
| 33 [[name]] | |
| 34 <iron-icon icon="icons:link" on-tap="_handleClick"></iron-icon> | |
| 35 </div> | 34 </div> |
| 36 | 35 <div class="card-actions"> |
| 37 </paper-item> | 36 <div class="horizontal justified"> |
| 37 <a href="[[link]]" target="_blank"> |
| 38 <paper-button class="config-open">Open</paper-button> |
| 39 </a> |
| 40 </div> |
| 41 </div> |
| 42 </paper-card> |
| 38 </template> | 43 </template> |
| 39 <script> | 44 <script> |
| 40 Polymer({ | 45 Polymer({ |
| 41 is: "config-file-card", | 46 is: "config-file-card", |
| 42 | 47 |
| 43 properties: { | 48 properties: { |
| 44 name: { | 49 name: { |
| 45 type: String | 50 type: String |
| 46 }, | 51 }, |
| 47 | 52 |
| 48 link: { | 53 link: { |
| 49 type: String | 54 type: String |
| 50 } | 55 }, |
| 51 }, | 56 } |
| 52 | |
| 53 _handleClick: function(event) { | |
| 54 window.location = this.link; | |
| 55 }, | |
| 56 | |
| 57 }); | 57 }); |
| 58 </script> | 58 </script> |
| 59 </dom-module> | 59 </dom-module> |
| OLD | NEW |