From 2b0a8c4f881d23a2f7588ae1adeb95a93659fb11 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 21 Mar 2012 06:57:40 +0000 Subject: [PATCH] users dialog: display bots as bots (comes with better UA parsing, but all this is front-end only, so won't affect sort) --- static/js/pandora/usersDialog.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/usersDialog.js b/static/js/pandora/usersDialog.js index db945138b..68e8e273c 100644 --- a/static/js/pandora/usersDialog.js +++ b/static/js/pandora/usersDialog.js @@ -8,6 +8,12 @@ pandora.ui.usersDialog = function() { dialogWidth = Math.round(window.innerWidth * 0.9), formWidth = 256, numberOfUsers = 0, + userLevels = Ox.merge( + pandora.site.userLevels.map(function(userLevel) { + return Ox.toTitleCase(userLevel); + }), + ['Robot'] + ), $reloadButton = Ox.Button({ title: 'redo', @@ -17,6 +23,7 @@ pandora.ui.usersDialog = function() { .css({float: 'left', margin: '4px 2px 4px 4px'}) .bindEvent({ click: function() { + Ox.Request.clearCache('findUsers'); $list.reloadList(true); } }), @@ -121,13 +128,12 @@ pandora.ui.usersDialog = function() { }, { align: 'center', - format: function(value) { + format: function(value, data) { return Ox.Theme.formatColorLevel( - pandora.site.userLevels.indexOf(value), - pandora.site.userLevels.map(function(userLevel) { - return Ox.toTitleCase(userLevel); - }), - [0, 240] + data.useragent.indexOf('Googlebot') > -1 || data.username == 'rlx' + ? 5 : pandora.site.userLevels.indexOf(value), + userLevels, + [0, 300] ); }, id: 'level', @@ -235,18 +241,24 @@ pandora.ui.usersDialog = function() { width: 160 }, { + format: function(value, data) { + return Ox.parseUserAgent(data.useragent).browser.string; + }, id: 'browser', operator: '+', title: 'Browser', visible: true, - width: 80 + width: 160 }, { + format: function(value, data) { + return Ox.parseUserAgent(data.useragent).system.string; + }, id: 'system', operator: '+', title: 'System', visible: true, - width: 80 + width: 160 }, { id: 'useragent',