From 993b892761dc4f54ba9fe453fa0d3e529c98a3bc Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Thu, 1 May 2014 13:15:33 -0400 Subject: [PATCH] ui: add panelbar helper --- ui/index.html | 3 ++- ui/javascripts/app/helpers.js | 10 ++++++++++ ui/scripts/compile.rb | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ui/javascripts/app/helpers.js diff --git a/ui/index.html b/ui/index.html index 5981be8e8..c78fadb8b 100644 --- a/ui/index.html +++ b/ui/index.html @@ -379,7 +379,7 @@ {{#each check in model.Checks }}
-
+ {{ panelBar check.Status }}

{{check.Name}} @@ -431,6 +431,7 @@ + diff --git a/ui/javascripts/app/helpers.js b/ui/javascripts/app/helpers.js new file mode 100644 index 000000000..19297d30a --- /dev/null +++ b/ui/javascripts/app/helpers.js @@ -0,0 +1,10 @@ +Ember.Handlebars.helper('panelBar', function(status) { + var highlightClass; + + if (status == "passing") { + highlightClass = "bg-green"; + } else { + highlightClass = "bg-orange"; + } + return new Handlebars.SafeString('
'); +}); diff --git a/ui/scripts/compile.rb b/ui/scripts/compile.rb index f69937e6b..b495a1342 100644 --- a/ui/scripts/compile.rb +++ b/ui/scripts/compile.rb @@ -15,6 +15,7 @@ app = [ "javascripts/app/routes.js", "javascripts/app/controllers.js", "javascripts/app/views.js", + "javascripts/app/helpers.js", ] libs.each do |js_file|