New: Show warning for queue when there is a warning

This commit is contained in:
Mark McDowall 2014-10-12 00:02:34 -07:00
parent f6e4ccda84
commit f8fb37bae8
2 changed files with 10 additions and 4 deletions

View File

@ -16,8 +16,6 @@ define(
if (this.cellValue) {
var status = this.cellValue.get('status').toLowerCase();
var trackedDownloadStatus = this.cellValue.get('trackedDownloadStatus').toLowerCase();
var hasError = this.cellValue.get('hasError') || false;
var hasWarning = this.cellValue.get('hasWarning') || false;
var icon = 'icon-nd-downloading';
var title = 'Downloading';
var itemTitle = this.cellValue.get('title');
@ -55,7 +53,6 @@ define(
if (trackedDownloadStatus === 'warning') {
icon += ' icon-nd-warning';
// title = 'Download failed';
this.templateFunction = Marionette.TemplateCache.get(this.template);
content = this.templateFunction(this.cellValue.toJSON());

View File

@ -22,14 +22,23 @@ define(
var count = QueueCollection.fullCollection.length;
var label = 'label-info';
var errors = QueueCollection.fullCollection.some(function (model) {
return model.has('errorMessage');
return model.get('trackedDownloadStatus').toLowerCase() === 'error';
});
var warnings = QueueCollection.fullCollection.some(function (model) {
return model.get('trackedDownloadStatus').toLowerCase() === 'warning';
});
if (errors) {
label = 'label-danger';
}
else if (warnings) {
label = 'label-warning';
}
this.$el.html('<span class="label {0}">{1}</span>'.format(label, count));
return this;
}