| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 <link rel="import" href="../model/patch-summary.html"> | 6 <link rel="import" href="../model/patch-summary.html"> |
| 7 <link rel="import" href="../model/patch-summary-list.html"> | 7 <link rel="import" href="../model/patch-summary-list.html"> |
| 8 <link rel="import" href="./tom-patch-summary.html"> | 8 <link rel="import" href="./tom-patch-summary.html"> |
| 9 <link rel="import" href="./paper-multi-menu.html"> | 9 <link rel="import" href="./paper-multi-menu.html"> |
| 10 <link rel="import" href="/bower_components/paper-button/paper-button.html"> | 10 <link rel="import" href="/bower_components/paper-button/paper-button.html"> |
| 11 <link rel="import" href="/bower_components/paper-shadow/paper-shadow.html"> | 11 <link rel="import" href="/bower_components/paper-shadow/paper-shadow.html"> |
| 12 | 12 |
| 13 <polymer-element name="tom-patch-summary-list" attributes="model"> | 13 <polymer-element name="tom-patch-summary-list" attributes="model"> |
| 14 <template> | 14 <template> |
| 15 <link rel="stylesheet" href="./tom-patch-summary-list.css"> | 15 <link rel="stylesheet" href="./tom-patch-summary-list.css"> |
| 16 <link rel="stylesheet" href="./tom-patch-summary.css"> | 16 <link rel="stylesheet" href="./tom-patch-summary.css"> |
| 17 <paper-shadow z="2" class="shadow-box"> | 17 <paper-shadow z="2" class="shadow-box"> |
| 18 <div class="list-box"> | 18 <div class="list-box"> |
| 19 <div class="list-header"> | 19 <div class="list-header"> |
| 20 <span class="header-title">Worst {{ model.unit }}</span><br> | 20 <span class="header-title">Worst {{ model.unit }}</span><br> |
| 21 From: {{ model.begin }}<br> | 21 From: {{ model.graphInterval.begin | timestampToDateString }}<br> |
| 22 Until: {{ model.end }} | 22 Until: {{ model.graphInterval.end | timestampToDateString }} |
| 23 <paper-button class="close" on-tap="{{ close }}">X</paper-button> | 23 <paper-button class="close" on-tap="{{ close }}">X</paper-button> |
| 24 </div> | 24 </div> |
| 25 | 25 |
| 26 <div class="view-menu"> | 26 <div class="view-menu"> |
| 27 View: | 27 View: |
| 28 <paper-multi-menu id="viewMenu" model="{{ _viewMenu }}"></paper-multi-
menu> | 28 <paper-multi-menu id="viewMenu" model="{{ _viewMenu }}"></paper-multi-
menu> |
| 29 </div> | 29 </div> |
| 30 | 30 |
| 31 <div class="row"> | 31 <div class="row"> |
| 32 <div class="metric-cell column header">Graph metric</div> | 32 <div class="metric-cell column header">Graph metric</div> |
| 33 <div class="patch-cell column header">Patch</div> | 33 <div class="patch-cell column header">Patch</div> |
| 34 <div class="column-container"> | 34 <div class="column-container"> |
| 35 |
| 36 <template if="{{ $.viewMenu.value == 'jobs' }}"> |
| 37 <div class="column grow header">{{ $.viewMenu.subMenu.text }} jobs
</div> |
| 38 </template> |
| 39 |
| 40 <template if="{{ $.viewMenu.value == 'timeline' }}"> |
| 41 <template bind="{{ model[$.viewMenu.subMenu.value] as interval }}"
> |
| 42 <div class="column grow header"> |
| 43 Timeline Interval<br> |
| 44 {{ interval.begin | timestampToLocaleString }}<br> |
| 45 {{ interval.end | timestampToLocaleString }} |
| 46 </div> |
| 47 </template> |
| 48 </template> |
| 49 |
| 35 <template if="{{ $.viewMenu.value == 'summary' }}"> | 50 <template if="{{ $.viewMenu.value == 'summary' }}"> |
| 36 <template repeat="{{ column in _summaryColumns }}"> | 51 <template repeat="{{ column in _summaryColumns }}"> |
| 37 <div class="column header">{{ column.header }}</div> | 52 <div class="column header">{{ column.header }}</div> |
| 38 </template> | 53 </template> |
| 39 </template> | 54 </template> |
| 40 <template if="{{ $.viewMenu.value == 'jobs' }}"> | 55 |
| 41 <div class="column grow header">{{ $.viewMenu.subMenu.text }} jobs
</div> | |
| 42 </template> | |
| 43 </div> | 56 </div> |
| 44 </div> | 57 </div> |
| 45 | 58 |
| 46 <div class="item-rows"> | 59 <div class="item-rows"> |
| 47 <template repeat="{{ patchSummary in model.list }}"> | 60 <template repeat="{{ patchSummary in model._list }}"> |
| 48 <tom-patch-summary model="{{ patchSummary }}" viewMenu="{{ $.viewMen
u }}"></tom-patch-summary> | 61 <tom-patch-summary model="{{ patchSummary }}" viewMenu="{{ $.viewMen
u }}"></tom-patch-summary> |
| 49 </template> | 62 </template> |
| 50 </div> | 63 </div> |
| 51 </div> | 64 </div> |
| 52 </paper-shadow> | 65 </paper-shadow> |
| 53 </template> | 66 </template> |
| 54 <script> | 67 <script> |
| 55 Polymer({ | 68 Polymer({ |
| 56 ready: function() { | 69 ready: function() { |
| 57 this._viewMenu = PatchSummaryList.viewMenu; | 70 this._viewMenu = PatchSummaryList.viewMenu; |
| 58 this._summaryColumns = PatchSummary.summaryColumns; | 71 this._summaryColumns = PatchSummary.summaryColumns; |
| 59 }, | 72 }, |
| 60 close: function() { | 73 close: function() { |
| 61 this.model.list = []; | 74 this.model.clear(); |
| 75 }, |
| 76 timestampToDateString: function(timestamp) { |
| 77 return new Date(timestamp * 1000).toString(); |
| 78 }, |
| 79 timestampToLocaleString: function(timestamp) { |
| 80 return new Date(timestamp * 1000).toLocaleString(); |
| 62 }, | 81 }, |
| 63 }); | 82 }); |
| 64 </script> | 83 </script> |
| 65 </polymer-element> | 84 </polymer-element> |
| OLD | NEW |