Commit 67fe87d5 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Move display_owner to the base Image model

parent b1fbe13b
......@@ -27,17 +27,8 @@
display_size: function() {
return this.get_readable_size();
},
display_owner: function() {
var owner = this.get_owner();
if (_.include(_.keys(synnefo.config.system_images_owners), owner)) {
return synnefo.config.system_images_owners[owner];
} else {
return owner;
}
}
})
models.GlanceImages = snf.models.Images.extend({
......
......@@ -232,6 +232,15 @@
return this.get('owner') || _.keys(synnefo.config.system_images_owners)[0];
},
display_owner: function() {
var owner = this.get_owner();
if (_.include(_.keys(synnefo.config.system_images_owners), owner)) {
return synnefo.config.system_images_owners[owner];
} else {
return owner;
}
},
get_readable_size: function() {
return this.get_size() > 0 ? util.readablizeBytes(this.get_size() * 1024 * 1024) : "unknown";
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment