[#77,model][s]: add summary function to product infobox style summary for a doc (all keys and values atm).

This commit is contained in:
Rufus Pollock 2012-05-30 23:37:32 +01:00
parent 6f31228520
commit 2a7807638b

View File

@ -198,6 +198,16 @@ my.Document = Backbone.Model.extend({
val = field.renderer(val, field, this);
}
return val;
},
summary: function(fields) {
var html = '';
for (key in this.attributes) {
if (key != 'id') {
html += '<div><strong>' + key + '</strong>: '+ this.attributes[key] + '</div>';
}
}
return html;
}
});