|
|
@ -12,17 +12,21 @@ module.exports = Marionette.ItemView.extend({
|
|
|
|
|
|
|
|
|
|
|
|
render : function() {
|
|
|
|
render : function() {
|
|
|
|
this.$el.empty();
|
|
|
|
this.$el.empty();
|
|
|
|
|
|
|
|
|
|
|
|
if (HealthCollection.length === 0) {
|
|
|
|
if (HealthCollection.length === 0) {
|
|
|
|
return this;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var count = HealthCollection.length;
|
|
|
|
var count = HealthCollection.length;
|
|
|
|
var label = 'label-warning';
|
|
|
|
var label = 'label-warning';
|
|
|
|
var errors = HealthCollection.some(function(model) {
|
|
|
|
var errors = HealthCollection.some(function(model) {
|
|
|
|
return model.get('type') === 'error';
|
|
|
|
return model.get('type') === 'error';
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (errors) {
|
|
|
|
if (errors) {
|
|
|
|
label = 'label-danger';
|
|
|
|
label = 'label-danger';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.$el.html('<span class="label {0}">{1}</span>'.format(label, count));
|
|
|
|
this.$el.html('<span class="label {0}">{1}</span>'.format(label, count));
|
|
|
|
return this;
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
},
|
|
|
|