| Index: Tools/GardeningServer/ui/ct-failure-card-buttons.html
|
| diff --git a/Tools/GardeningServer/ui/ct-failure-card-buttons.html b/Tools/GardeningServer/ui/ct-failure-card-buttons.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..de1f2723eec6cef73bd6e9d86aab9c88b7690af6
|
| --- /dev/null
|
| +++ b/Tools/GardeningServer/ui/ct-failure-card-buttons.html
|
| @@ -0,0 +1,100 @@
|
| +<!--
|
| +Copyright 2014 The Chromium Authors. All rights reserved.
|
| +Use of this source code is governed by a BSD-style license that can be
|
| +found in the LICENSE file.
|
| +-->
|
| +
|
| +<link rel="import" href="../model/ct-builder-list.html">
|
| +<link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">
|
| +<link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
|
| +<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
| +
|
| +<polymer-element name="ct-failure-card-buttons" attributes="group bug">
|
| + <template>
|
| + <style>
|
| + :host {
|
| + display: flex;
|
| + flex-direction: column;
|
| + }
|
| +
|
| + /* FIXME: All this paper-button styling should go in a cr-button component so that
|
| + we can use buttons in different places and have them all look the same. */
|
| + paper-button {
|
| + -webkit-user-select: none;
|
| + background: #f5f5f5;
|
| + border-radius: 2px;
|
| + border: 1px solid #dcdcdc;
|
| + color: #444;
|
| + padding: 0 16px;
|
| + margin-bottom: 5px;
|
| + text-align: center;
|
| + }
|
| +
|
| + paper-button:focus {
|
| + border: 1px solid #4d90fe;
|
| + outline: none;
|
| + }
|
| +
|
| + paper-button:active {
|
| + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
|
| + }
|
| +
|
| + paper-button:active, paper-button:hover {
|
| + background: #f8f8f8;
|
| + border-color: #c6c6c6;
|
| + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
|
| + color: #222;
|
| + }
|
| + </style>
|
| + <paper-button id="examine" on-tap="{{ examine }}" label="Examine"></paper-button>
|
| + <template if="{{ !group.isSnoozed }}">
|
| + <paper-button id="snooze" on-tap="{{ snooze }}" label="Snooze"></paper-button>
|
| + </template>
|
| + <template if="{{ group.isSnoozed }}">
|
| + <paper-button id="snooze" on-tap="{{ unsnooze }}" label="Unsnooze"></paper-button>
|
| + </template>
|
| + <paper-button id="link-bug" on-tap="{{ linkBug }}" label="Link Bug"></paper-button>
|
| + <template if="{{ group.bug !== undefined }}">
|
| + <div>
|
| + <a href="{{ group.bug }}">
|
| + {{ group.bugLabel }}</a>
|
| + </div>
|
| + </template>
|
| +
|
| + <paper-dialog heading="Enter bug number" transition="paper-transition-center" id="bugDialog">
|
| + <paper-input label="Bug# or URL" floatingLabel autofocus id="bug"></paper-input>
|
| + <paper-button label="Remove bug link" on-tap="{{ removeBug }}" dismissive id="dialogRemoveBug"></paper-button>
|
| + <paper-button label="OK" on-tap="{{ saveBug }}" affirmative id="dialogOk"></paper-button>
|
| + </paper-dialog>
|
| + </template>
|
| + <script>
|
| + Polymer({
|
| + group: null,
|
| +
|
| + examine: function() {
|
| + this.fire('ct-examine-failures', this.group);
|
| + },
|
| +
|
| + snooze: function() {
|
| + this.group.snoozeUntil(Date.now() + 60 * 60 * 1000);
|
| + },
|
| +
|
| + unsnooze: function() {
|
| + this.group.unsnooze();
|
| + },
|
| +
|
| + linkBug: function() {
|
| + this.$.bug.value = this.group.bug;
|
| + this.$.bugDialog.toggle();
|
| + },
|
| +
|
| + saveBug: function() {
|
| + this.group.setBug(this.$.bug.value);
|
| + },
|
| +
|
| + removeBug: function() {
|
| + this.group.clearBug();
|
| + },
|
| + });
|
| + </script>
|
| +</polymer-element>
|
|
|