Revision 03639c6d snf-cyclades-app/synnefo/ui/static/snf/js/models.js

b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js
240 240
                return owner;
241 241
            }
242 242
        },
243

  
243
    
244 244
        get_readable_size: function() {
245
            return this.get_size() > 0 ? util.readablizeBytes(this.get_size() * 1024 * 1024) : "unknown";
245
            if (this.is_deleted()) {
246
                return synnefo.config.image_deleted_size_title || '(none)';
247
            }
248
            return this.get_size() > 0 ? util.readablizeBytes(this.get_size() * 1024 * 1024) : '(none)';
246 249
        },
247 250

  
248 251
        get_os: function() {
......
267 270
        is_public: function() {
268 271
            return this.get('is_public') || true;
269 272
        },
273

  
274
        is_deleted: function() {
275
            return this.get('status') == "DELETED"
276
        },
270 277
        
271 278
        ssh_keys_path: function() {
272 279
            prepend = '';
......
1584 1591
                            callback(this.get(id));
1585 1592
                        }, this));
1586 1593
                    } else {
1594
                        var title = synnefo.config.image_deleted_title || 'Deleted';
1587 1595
                        // else add a dummy DELETED state image entry
1588
                        this.add({id:id, name:"Unknown image", size:-1, 
1596
                        this.add({id:id, name:title, size:-1, 
1589 1597
                                  progress:100, status:"DELETED"});
1590 1598
                        callback(this.get(id));
1591 1599
                    }   
......
1594 1602
                }
1595 1603
            }, this), _.bind(function(image, msg, xhr) {
1596 1604
                if (!image) {
1597
                    this.add({id:id, name:"Unknown image", size:-1, 
1605
                    var title = synnefo.config.image_deleted_title || 'Deleted';
1606
                    this.add({id:id, name:title, size:-1, 
1598 1607
                              progress:100, status:"DELETED"});
1599 1608
                    callback(this.get(id));
1600 1609
                    return;

Also available in: Unified diff