user/guest stats

This commit is contained in:
j 2011-11-07 15:46:16 +01:00
parent 3cec9cefa2
commit 03ae9a5a8c
2 changed files with 7 additions and 5 deletions

View file

@ -518,7 +518,8 @@ Positions
response['data']['positions'] = utils.get_positions(ids, data['positions'])
else:
response['data']['items'] = qs.count()
response['data']['users'] = qs.exclude(user=None).count()
response['data']['guests'] = response['data']['items'] - response['data']['users']
return render_to_json_response(response)
actions.register(findUsers)

View file

@ -206,11 +206,12 @@ pandora.ui.usersDialog = function() {
})
.bindEvent({
init: function(data) {
numberOfUsers = data.items;
$status.html(
Ox.formatNumber(numberOfUsers)
+ ' user' + (numberOfUsers == 1 ? '' : 's')
+ ' (' + Ox.formatNumber(numberOfUsers) + ' registered, 0 guests)'
Ox.formatNumber(data.items)
+ ' user' + (data.items == 1 ? '' : 's')
+ ' (' + Ox.formatNumber(data.users) + ' registered, '
+ Ox.formatNumber(data.guests) + ' guest' + (data.guests == 1 ? '' : 's')
+ ')'
);
},
select: function(data) {