UI Cleanup - Updated Activity subtree.

This commit is contained in:
Taloth Saldono
2015-02-13 22:03:50 +01:00
parent b308f06af3
commit b556eda4a0
25 changed files with 659 additions and 510 deletions
+11 -6
View File
@@ -6,26 +6,31 @@ var FormatHelpers = require('../../Shared/FormatHelpers');
module.exports = NzbDroneCell.extend({
className : 'timeleft-cell',
render : function(){
render : function() {
this.$el.empty();
if(this.cellValue) {
if(this.cellValue.get('status').toLowerCase() === 'pending') {
if (this.cellValue) {
if (this.cellValue.get('status').toLowerCase() === 'pending') {
var ect = this.cellValue.get('estimatedCompletionTime');
var time = '{0} at {1}'.format(FormatHelpers.relativeDate(ect), moment(ect).format(UiSettingsModel.time(true, false)));
this.$el.html('-');
this.$el.attr('title', 'Will be processed during the first RSS Sync after {0}'.format(time));
return this;
}
var timeleft = this.cellValue.get('timeleft');
var totalSize = fileSize(this.cellValue.get('size'), 1, false);
var remainingSize = fileSize(this.cellValue.get('sizeleft'), 1, false);
if(timeleft === undefined) {
if (timeleft === undefined) {
this.$el.html('-');
}
else {
} else {
this.$el.html('<span title="{1} / {2}">{0}</span>'.format(timeleft, remainingSize, totalSize));
}
}
return this;
}
});