From f8fb37bae8772f3382dbdc3e4ecbc3d0d6bf65e4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 12 Oct 2014 00:02:34 -0700 Subject: [PATCH] New: Show warning for queue when there is a warning --- src/UI/History/Queue/QueueStatusCell.js | 3 --- src/UI/History/Queue/QueueView.js | 11 ++++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/UI/History/Queue/QueueStatusCell.js b/src/UI/History/Queue/QueueStatusCell.js index 439c3c267..1cd6eaafe 100644 --- a/src/UI/History/Queue/QueueStatusCell.js +++ b/src/UI/History/Queue/QueueStatusCell.js @@ -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()); diff --git a/src/UI/History/Queue/QueueView.js b/src/UI/History/Queue/QueueView.js index c13413344..79cf76016 100644 --- a/src/UI/History/Queue/QueueView.js +++ b/src/UI/History/Queue/QueueView.js @@ -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('{1}'.format(label, count)); return this; }