OLD | NEW |
---|---|
(Empty) | |
1 <!-- | |
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 | |
4 found in the LICENSE file. | |
5 --> | |
6 <link href="../bower_components/core-icons/core-icons.html" rel="import"> | |
7 <link href="../bower_components/paper-item/paper-item.html" rel="import"> | |
8 <link href="../bower_components/paper-menu-button/paper-menu-button.html" rel="i mport"> | |
9 <link href="../model/ct-builder-revisions.html" rel="import"> | |
10 <link href="ct-popup-menu.html" rel="import"> | |
11 | |
12 <polymer-element name="ct-revision-details" attributes="builderLatestRevisions r evisionLog tree"> | |
13 <template> | |
14 <style> | |
15 :host { | |
16 padding-left: 2em; | |
17 } | |
18 paper-menu-button { | |
19 padding: 0; | |
20 margin-bottom: -0.5em; | |
21 } | |
22 ct-popup-menu > div { | |
ojan
2014/08/05 02:07:23
Just give the div a class name instead of using a
| |
23 display: flex; | |
24 justify-content: space-between; | |
25 } | |
26 .menuRevision { | |
27 padding-left: 2em; | |
28 } | |
29 </style> | |
30 <!-- FIXME: Stop special casing the blink tree. --> | |
31 <template if="{{ _sortedBuilders.length && tree == 'blink' }}"> | |
32 Latest revision processed by every bot: | |
33 <a id="fullyProcessedRevision" href="{{ _fullyProcessedRevision.url }}">{{ _fullyProcessedRevision.revision }}</a> | |
34 <ct-popup-menu icon="arrow-drop-down"> | |
35 <template repeat="{{builder in _sortedBuilders}}"> | |
36 <div> | |
37 <div> | |
38 {{ builder }} | |
39 </div> | |
40 <div class="menuRevision"> | |
41 <a href="{{ builderLatestRevisions[builder].url }}">{{ builderLate stRevisions[builder].revision }}</a> | |
42 </div> | |
43 </div> | |
44 </template> | |
45 </ct-popup-menu> | |
46 trunk is at <a id="trunkRevision" href="{{ revisionLog.commits.blink[revis ionLog.lastRevision['blink']].url }}">{{ revisionLog.lastRevision['blink'] }}</a > | |
47 </template> | |
48 </template> | |
49 <script> | |
50 Polymer({ | |
51 _sortedBuilders: [], | |
52 _fullyProcessedRevision: null, | |
53 builderLatestRevisions: null, | |
54 | |
55 builderLatestRevisionsChanged: function() { | |
56 // Get the list of builders sorted with the most out-of-date one first. | |
57 var sortedBuilders = Object.keys(this.builderLatestRevisions); | |
58 sortedBuilders.sort(function (a, b) { return this.builderLatestRevisions [a].revision - this.builderLatestRevisions[b].revision;}.bind(this)); | |
ojan
2014/08/05 02:07:24
Nit: a little line-wrapping here would be more rea
| |
59 | |
60 this._sortedBuilders = sortedBuilders; | |
61 this._fullyProcessedRevision = this.builderLatestRevisions[sortedBuilder s[0]]; | |
62 }, | |
63 }); | |
64 </script> | |
65 </polymer-element> | |
OLD | NEW |