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 | 6 |
7 <link rel="import" href="../model/ct-builder-list.html"> | 7 <link rel="import" href="../model/ct-builder-list.html"> |
8 <link rel="import" href="ct-button.html"> | 8 <link rel="import" href="ct-button.html"> |
9 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> | 9 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html"> |
10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio
n.html"> | 10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transitio
n.html"> |
11 <link rel="import" href="../bower_components/paper-input/paper-input.html"> | 11 <link rel="import" href="../bower_components/paper-input/paper-input.html"> |
12 | 12 |
13 <polymer-element name="ct-failure-card-buttons" attributes="group bug"> | 13 <polymer-element name="ct-failure-card-buttons" attributes="group bug"> |
14 <template> | 14 <template> |
15 <style> | 15 <style> |
16 :host { | 16 :host { |
17 display: flex; | 17 display: flex; |
18 } | 18 } |
19 :host > * { | 19 :host > * { |
20 margin-right: 5px; | 20 margin-right: 5px; |
21 } | 21 } |
22 ct-button { | 22 ct-button { |
23 white-space: nowrap; | 23 white-space: nowrap; |
24 } | 24 } |
| 25 |
| 26 #bugReminder { |
| 27 font-size: large; |
| 28 color: red; |
| 29 } |
25 </style> | 30 </style> |
26 <ct-button id="examine" on-tap="{{ examine }}" label="Examine"></ct-button> | 31 <ct-button id="examine" on-tap="{{ examine }}" label="Examine"></ct-button> |
27 <template if="{{ !group.isSnoozed }}"> | 32 <template if="{{ !group.isSnoozed }}"> |
28 <ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button> | 33 <ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button> |
29 </template> | 34 </template> |
30 <template if="{{ group.isSnoozed }}"> | 35 <template if="{{ group.isSnoozed }}"> |
31 <ct-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></ct-butto
n> | 36 <ct-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></ct-butto
n> |
32 </template> | 37 </template> |
33 <ct-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></ct-button
> | 38 <ct-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></ct-button
> |
34 | 39 |
35 <paper-dialog heading="Enter bug number" transition="paper-transition-center
" id="bugDialog"> | 40 <paper-dialog heading="Enter bug number" transition="paper-transition-center
" id="bugDialog"> |
36 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-
input> | 41 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-
input> |
| 42 <div><a id="fileBugLink" target="_blank" on-click="{{ fileBugClicked }}"> |
| 43 <template if="{{ !_fileBugClicked }}"> |
| 44 File bug |
| 45 </template> |
| 46 </a></div> |
| 47 <template if="{{ _fileBugClicked }}"> |
| 48 <div id="bugReminder"> |
| 49 Remember to enter the new bug number above! |
| 50 </div> |
| 51 </template> |
37 <ct-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id=
"dialogRemoveBug"></ct-button> | 52 <ct-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id=
"dialogRemoveBug"></ct-button> |
38 <ct-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"></c
t-button> | 53 <ct-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"></c
t-button> |
39 </paper-dialog> | 54 </paper-dialog> |
40 </template> | 55 </template> |
41 <script> | 56 <script> |
42 Polymer({ | 57 Polymer({ |
43 group: null, | 58 group: null, |
| 59 _fileBugClicked: false, |
44 | 60 |
45 examine: function() { | 61 examine: function() { |
46 this.fire('ct-examine-failures', this.group); | 62 this.fire('ct-examine-failures', this.group); |
47 }, | 63 }, |
48 | 64 |
49 snooze: function() { | 65 snooze: function() { |
50 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); | 66 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000); |
51 }, | 67 }, |
52 | 68 |
53 unsnooze: function() { | 69 unsnooze: function() { |
54 this.group.unsnooze(); | 70 this.group.unsnooze(); |
55 }, | 71 }, |
56 | 72 |
57 linkBug: function() { | 73 linkBug: function() { |
58 this.$.bug.value = this.group.bug; | 74 this.$.bug.value = this.group.bug; |
| 75 this._fileBugClicked = false; |
| 76 this.$.fileBugLink.href = this.group.data.fileBugLink(); |
59 this.$.bugDialog.toggle(); | 77 this.$.bugDialog.toggle(); |
60 }, | 78 }, |
61 | 79 |
62 saveBug: function() { | 80 saveBug: function() { |
63 this.group.setBug(this.$.bug.value); | 81 this.group.setBug(this.$.bug.value); |
64 }, | 82 }, |
65 | 83 |
66 removeBug: function() { | 84 removeBug: function() { |
67 this.group.clearBug(); | 85 this.group.clearBug(); |
68 }, | 86 }, |
| 87 |
| 88 fileBugClicked: function() { |
| 89 this._fileBugClicked = true; |
| 90 }, |
69 }); | 91 }); |
70 </script> | 92 </script> |
71 </polymer-element> | 93 </polymer-element> |
OLD | NEW |