Chromium Code Reviews| 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/app-layout/app-layout.html"> | 7 <link rel="import" href="../../bower_components/app-layout/app-layout.html"> |
| 8 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html"> | 8 <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html"> |
| 9 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> | 9 <link rel="import" href="../../bower_components/paper-button/paper-button.html"> |
| 10 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht ml"> | 10 <link rel="import" href="../../bower_components/paper-search/paper-search-bar.ht ml"> |
| 11 <link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html "> | 11 <link rel="import" href="../../bower_components/paper-spinner/paper-spinner.html "> |
| 12 <link rel="import" href="../../bower_components/paper-styles/shadow.html"> | 12 <link rel="import" href="../../bower_components/paper-styles/shadow.html"> |
| 13 <link rel="import" href="../../bower_components/polymer/polymer.html"> | 13 <link rel="import" href="../../bower_components/polymer/polymer.html"> |
| 14 | 14 |
| 15 <link rel="import" href="config-set-card.html"> | 15 <link rel="import" href="config-set-card.html"> |
| 16 | 16 |
| 17 <dom-module id="front-page"> | 17 <dom-module id="front-page"> |
| 18 <template> | 18 <template> |
| 19 <style> | 19 <style> |
| 20 .center { | 20 .center { |
| 21 width: 23%; | 21 width: 550px; |
|
Ryan Tseng
2017/07/19 22:41:17
This breaks on mobile (try narrowing the window).
ayanaadylova
2017/07/19 23:28:08
I will do it in a separate CL like Sergey suggeste
| |
| 22 margin: auto; | 22 margin: auto; |
| 23 } | 23 } |
| 24 | 24 |
| 25 .config-card { | 25 .config-card { |
| 26 padding-bottom: 1%; | 26 padding-bottom: 1%; |
| 27 animation: fadein 1.5s; | 27 animation: fadein 1.5s; |
| 28 } | 28 } |
| 29 | 29 |
| 30 @keyframes fadein { | 30 @keyframes fadein { |
| 31 from {opacity: 0} | 31 from {opacity: 0} |
| 32 to {opacity: 1} | 32 to {opacity: 1} |
| 33 } | 33 } |
| 34 | 34 |
| 35 .loading { text-align: center; } | 35 .loading { text-align: center; } |
| 36 | 36 |
| 37 .search-bar { | 37 .search-bar { |
| 38 padding-top: 7%; | 38 padding-top: 7%; |
| 39 padding-bottom: 2%; | 39 padding-bottom: 2%; |
| 40 } | 40 } |
| 41 | 41 |
| 42 .name { | 42 .name { |
| 43 font-family: sans-serif; | 43 font-family: sans-serif; |
| 44 word-wrap: break-word; | 44 word-wrap: break-word; |
| 45 text-align: center; | 45 text-align: center; |
| 46 } | 46 } |
| 47 | 47 |
| 48 paper-search-bar { | 48 paper-search-bar { |
| 49 @apply --shadow-elevation-4dp; | 49 @apply --shadow-elevation-4dp; |
| 50 width: 40%; | 50 width: 900px; |
| 51 height: 100%; | 51 height: 100%; |
| 52 margin: auto; | 52 margin: auto; |
| 53 } | 53 } |
| 54 </style> | 54 </style> |
| 55 | 55 |
| 56 <iron-ajax | 56 <iron-ajax |
| 57 id="requestConfigs" | 57 id="requestConfigs" |
| 58 url="/_ah/api/config/v1/config-sets?include_last_import_attempt=true" | 58 url="/_ah/api/config/v1/config-sets?include_last_import_attempt=true" |
| 59 handle-as="json" | 59 handle-as="json" |
| 60 on-response="_onGotConfigSets" | 60 on-response="_onGotConfigSets" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 74 </div> | 74 </div> |
| 75 </template> | 75 </template> |
| 76 <template is="dom-if" if="[[_not(isLoading)]]"> | 76 <template is="dom-if" if="[[_not(isLoading)]]"> |
| 77 <template is="dom-if" if="[[_isEmpty(searchResults)]]"> | 77 <template is="dom-if" if="[[_isEmpty(searchResults)]]"> |
| 78 <div class="center name">No config sets found.</div> | 78 <div class="center name">No config sets found.</div> |
| 79 </template> | 79 </template> |
| 80 <template is="dom-if" if="[[_not(_isEmpty(searchResults))]]"> | 80 <template is="dom-if" if="[[_not(_isEmpty(searchResults))]]"> |
| 81 <template is="dom-repeat" items="[[searchResults]]" as="config"> | 81 <template is="dom-repeat" items="[[searchResults]]" as="config"> |
| 82 <div class="center config-card"> | 82 <div class="center config-card"> |
| 83 <config-set-card | 83 <config-set-card |
| 84 name="[[config.config_set]]" | 84 name="[[config.config_set]]" |
| 85 last-import-attempt="[[_getLastImportAttempt(config.last_impor t_attempt)]]"> | 85 last-import-attempt="[[_getLastImportAttempt(config.last_import_ attempt)]]"> |
| 86 </config-set-card> | 86 </config-set-card> |
| 87 </div> | 87 </div> |
| 88 </template> | 88 </template> |
| 89 </template> | 89 </template> |
| 90 </template> | 90 </template> |
| 91 </div> | 91 </div> |
| 92 </template> | 92 </template> |
| 93 <script> | 93 <script> |
| 94 Polymer({ | 94 Polymer({ |
| 95 is: 'front-page', | 95 is: 'front-page', |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 var tempResults = this.configSetList.filter(e => e.config_set.includes(t his.query)); | 158 var tempResults = this.configSetList.filter(e => e.config_set.includes(t his.query)); |
| 159 tempResults.sort(function(a, b) { | 159 tempResults.sort(function(a, b) { |
| 160 return this._formatName(a.config_set).localeCompare(this._formatName(b .config_set)); | 160 return this._formatName(a.config_set).localeCompare(this._formatName(b .config_set)); |
| 161 }.bind(this)); | 161 }.bind(this)); |
| 162 this.searchResults = tempResults; | 162 this.searchResults = tempResults; |
| 163 }, | 163 }, |
| 164 | 164 |
| 165 }); | 165 }); |
| 166 </script> | 166 </script> |
| 167 </dom-module> | 167 </dom-module> |
| OLD | NEW |