| Index: Tools/GardeningServer/ui/ct-tree-status.html
|
| diff --git a/Tools/GardeningServer/ui/ct-tree-status.html b/Tools/GardeningServer/ui/ct-tree-status.html
|
| index 0ee4d32e8514e2da067cadbf746501d7e8c67054..f36535faa75d2a905a7e6cf94014056236492c38 100644
|
| --- a/Tools/GardeningServer/ui/ct-tree-status.html
|
| +++ b/Tools/GardeningServer/ui/ct-tree-status.html
|
| @@ -4,32 +4,36 @@ Use of this source code is governed by a BSD-style license that can be
|
| found in the LICENSE file.
|
| -->
|
|
|
| -<polymer-element name="ct-tree-status" attributes="project status">
|
| +<polymer-element name="ct-tree-status">
|
| <template>
|
| - <style>
|
| - :host {
|
| - display: block;
|
| - whitespace: nowrap;
|
| - overflow: hidden;
|
| - text-overflow: ellispis;
|
| - }
|
| + <template if="{{ message }}">
|
| + <style>
|
| + :host {
|
| + display: block;
|
| + whitespace: nowrap;
|
| + overflow: hidden;
|
| + text-overflow: ellispis;
|
| + }
|
|
|
| - :host([status=throttled]) {
|
| - background-color: khaki;
|
| - }
|
| + :host([status=throttled]) {
|
| + background-color: khaki;
|
| + }
|
|
|
| - :host([status=closed]) {
|
| - color: white;
|
| - background-color: tomato;
|
| - }
|
| - </style>
|
| - {{project}}: {{message}}
|
| + :host([status=closed]) {
|
| + color: white;
|
| + background-color: tomato;
|
| + }
|
| + </style>
|
| + {{project}}: {{message}}
|
| + </template>
|
| </template>
|
| <script>
|
| Polymer({
|
| publish: {
|
| + project: '',
|
| + message: '',
|
| status: {
|
| - value: 'unknown',
|
| + value: 'open',
|
| reflect: true,
|
| },
|
| },
|
| @@ -43,18 +47,19 @@ found in the LICENSE file.
|
|
|
| updateStatus: function(status) {
|
| if (status.can_commit_freely) {
|
| - this.message = 'Tree is open';
|
| + this.message = '';
|
| this.status = 'open';
|
| + return;
|
| + }
|
| +
|
| + this.message = status.message + ' by ' + status.username;
|
| + var responseLowerCase = status.message.toLowerCase();
|
| + if (responseLowerCase.indexOf('throttled') != -1) {
|
| + this.status = 'throttled';
|
| + } else if (responseLowerCase.indexOf("closed") != -1) {
|
| + this.status = 'closed';
|
| } else {
|
| - this.message = status.message + ' by ' + status.username;
|
| - var responseLowerCase = status.message.toLowerCase();
|
| - if (responseLowerCase.indexOf('throttled') != -1) {
|
| - this.status = 'throttled';
|
| - } else if (responseLowerCase.indexOf("closed") != -1) {
|
| - this.status = 'closed';
|
| - } else {
|
| - this.status = 'unknown';
|
| - }
|
| + this.status = 'unknown';
|
| }
|
| },
|
| });
|
|
|