ui: add panelbar helper

This commit is contained in:
Jack Pearkes 2014-05-01 13:15:33 -04:00
parent a40a845f91
commit c0372ddf18
3 changed files with 13 additions and 1 deletions

View File

@ -379,7 +379,7 @@
{{#each check in model.Checks }}
<div class="panel">
<div {{bind-attr class=":panel-bar model.hasFailingChecks:bg-orange:bg-green"}} ></div>
{{ panelBar check.Status }}
<div class="panel-heading">
<h3 class="panel-title">
{{check.Name}}
@ -431,6 +431,7 @@
<script src="javascripts/app/models.js"></script>
<script src="javascripts/app/views.js"></script>
<script src="javascripts/app/controllers.js"></script>
<script src="javascripts/app/helpers.js"></script>
<!-- to activate the test runner, add the "?test" query string parameter -->
<script src="tests/runner.js"></script>
<!-- <script src="static/application.min.js"></script> -->

View File

@ -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('<div class="panel-bar ' + highlightClass + '"></div>');
});

View File

@ -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|