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.
7 <link rel="import" href="../model/ct-builder-list.html">
8 <link rel="import" href="ct-button.html">
9 <link rel="import" href="ct-view-handler.html">
10 <link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">
11 <link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
12 <link rel="import" href="../bower_components/paper-input/paper-input.html">
14 <polymer-element name="ct-failure-card-buttons" attributes="group bug">
32 <ct-view-handler></ct-view-handler>
33 <a href="{{ group.examineUrl }}">
34 <ct-button id="examine" label="Examine"></ct-button>
36 <template if="{{ !group.isSnoozed }}">
37 <ct-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></ct-button>
39 <template if="{{ group.isSnoozed }}">
40 <ct-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></ct-button>
42 <ct-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></ct-button>
44 <paper-dialog heading="Enter bug number" transition="paper-transition-center" id="bugDialog">
45 <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-input>
46 <div><a id="fileBugLink" target="_blank" on-click="{{ fileBugClicked }}">
47 <template if="{{ !_fileBugClicked }}">
51 <template if="{{ _fileBugClicked }}">
52 <div id="bugReminder">
53 Remember to enter the new bug number above!
56 <ct-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id="dialogRemoveBug"></ct-button>
57 <ct-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"></ct-button>
63 _fileBugClicked: false,
66 this.group.snoozeUntil(Date.now() + 60 * 60 * 1000);
69 unsnooze: function() {
70 this.group.unsnooze();
74 this.$.bug.value = this.group.bug;
75 this._fileBugClicked = false;
76 this.$.fileBugLink.href = this.group.data.fileBugLink();
77 this.$.bugDialog.toggle();
81 this.group.setBug(this.$.bug.value);
84 removeBug: function() {
85 this.group.clearBug();
88 fileBugClicked: function() {
89 this._fileBugClicked = true;