Browse Source

ui: add panelbar helper

pull/98/head
Jack Pearkes 11 years ago
parent
commit
c0372ddf18
  1. 3
      ui/index.html
  2. 10
      ui/javascripts/app/helpers.js
  3. 1
      ui/scripts/compile.rb

3
ui/index.html

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

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

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

Loading…
Cancel
Save