Skip to content

Commit

Permalink
Allow display of short type names in entity table
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Dec 31, 2014
1 parent 236f8e0 commit 2a5488e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htdocs/frontend/javascripts/entity.js
Expand Up @@ -497,6 +497,10 @@ Entity.prototype.getDOMDetails = function(edit) {
* Get DOM for list of entities
*/
Entity.prototype.getDOMRow = function(parent) {
// full or shortened type name
var type = this.definition.translation[vz.options.language];
if (vz.options.shortenLongTypes) type = type.replace(/\s*\(.+?\)/, '');

var row = $('<tr>')
.addClass((parent) ? 'child-of-entity-' + parent.uuid : '')
.addClass((this.definition.model == 'Volkszaehler\\Model\\Aggregator') ? 'aggregator' : 'channel')
Expand Down Expand Up @@ -529,7 +533,7 @@ Entity.prototype.getDOMRow = function(parent) {
)
)
)
.append($('<td>').text(this.definition.translation[vz.options.language])) // channel type
.append($('<td>').text(type)) // channel type
.append($('<td>').addClass('min')) // min
.append($('<td>').addClass('max')) // max
.append($('<td>').addClass('average')) // avg
Expand Down
1 change: 1 addition & 0 deletions htdocs/frontend/javascripts/options.js
Expand Up @@ -29,6 +29,7 @@ vz.options = {
precision: 2, // TODO update from middleware capabilities?
tuples: null, // automatically determined by plot size
refresh: false,
shortenLongTypes: false, // show shorter type names in table
minTimeout: 2000, // minimum refresh time in ms
interval: 24*60*60*1000, // 1 day default time interval to show
localMiddleware: '../middleware.php',
Expand Down

0 comments on commit 2a5488e

Please sign in to comment.