| 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-set-card"> | 14 <dom-module id="config-set-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; } |
| 25 |
| 26 .light { color: var(--paper-grey-600); } |
| 27 |
| 28 .validation { |
| 23 float: right; | 29 float: right; |
| 30 font-size: 15px; |
| 31 vertical-align: middle; |
| 24 } | 32 } |
| 25 | 33 |
| 34 .config-open { color: var(--google-blue-500); } |
| 26 </style> | 35 </style> |
| 27 | 36 |
| 28 <paper-item class="center" id="paper-box"> | 37 <paper-card elevation="2"> |
| 29 <!-- TODO(cwpayton): Add launch icon next to the name of the config | 38 <div class="card-content"> |
| 30 so that upon clicking the icon, the user will be taken to the config | 39 <div class="config-title">[[_formatName(name)]] |
| 31 set page. --> | 40 <div class="validation light"> |
| 32 <div class="horizontal layout wrap" style="width: 100%"> | 41 <template is="dom-if" if="[[lastImportAttempt]]" restamp="true"> |
| 33 [[name]] | 42 <template is="dom-if" if="[[lastImportAttempt.success]]" restamp="
true"> |
| 34 <template is="dom-if" if="[[lastImportAttempt]]" restamp="true"> | 43 <iron-icon icon="icons:check-circle"></iron-icon> |
| 35 <template is="dom-if" if="[[lastImportAttempt.success]]" restamp="true
"> | 44 </template> |
| 36 <iron-icon icon="icons:check-circle"></iron-icon> | 45 <template is="dom-if" if="[[_not(lastImportAttempt.success)]]" res
tamp="true"> |
| 37 </template> | 46 <iron-icon icon="icons:warning"></iron-icon> |
| 38 <template is="dom-if" if="[[_not(lastImportAttempt.success)]]" restamp
="true"> | 47 </template> |
| 39 <iron-icon icon="icons:warning"></iron-icon> | 48 </template> |
| 40 </template> | 49 <template is="dom-if" if="[[_not(lastImportAttempt)]]" restamp="true
"> |
| 41 </template> | 50 <iron-icon icon="icons:help"></iron-icon> |
| 42 <template is="dom-if" if="[[_not(lastImportAttempt)]]" restamp="true"> | 51 </template> |
| 43 <iron-icon icon="icons:help"></iron-icon> | 52 </div> |
| 44 </template> | 53 </div> |
| 54 <p class="light">Path: [[name]]</p> |
| 45 </div> | 55 </div> |
| 46 </paper-item> | 56 <div class="card-actions"> |
| 57 <div class="horizontal justified"> |
| 58 <a href="#/[[name]]"> |
| 59 <paper-button class="config-open">Open</paper-button> |
| 60 </a> |
| 61 </div> |
| 62 </div> |
| 63 </paper-card> |
| 47 </template> | 64 </template> |
| 48 <script> | 65 <script> |
| 49 Polymer({ | 66 Polymer({ |
| 50 is: "config-set-card", | 67 is: "config-set-card", |
| 51 | 68 |
| 52 properties: { | 69 properties: { |
| 53 | |
| 54 name: { | 70 name: { |
| 55 type: String | 71 type: String |
| 56 }, | 72 }, |
| 57 | 73 |
| 58 lastImportAttempt: { | 74 lastImportAttempt: { |
| 59 type: Object | 75 type: Object |
| 60 }, | 76 }, |
| 61 | |
| 62 }, | 77 }, |
| 63 | 78 |
| 64 _not: function(b) { | 79 _not: function(b) { |
| 65 return !b; | 80 return !b; |
| 66 }, | 81 }, |
| 67 | 82 |
| 83 _formatName: function(name) { |
| 84 var tempName = name.substring(name.indexOf("/") + 1); |
| 85 return tempName.includes("/") ? |
| 86 tempName.substring(0, tempName.indexOf("/")) : tempName; |
| 87 }, |
| 88 |
| 68 }); | 89 }); |
| 69 </script> | 90 </script> |
| 70 </dom-module> | 91 </dom-module> |
| 71 | 92 |
| OLD | NEW |