user/guest stats
This commit is contained in:
parent
3cec9cefa2
commit
03ae9a5a8c
2 changed files with 7 additions and 5 deletions
|
@ -518,7 +518,8 @@ Positions
|
||||||
response['data']['positions'] = utils.get_positions(ids, data['positions'])
|
response['data']['positions'] = utils.get_positions(ids, data['positions'])
|
||||||
else:
|
else:
|
||||||
response['data']['items'] = qs.count()
|
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)
|
return render_to_json_response(response)
|
||||||
actions.register(findUsers)
|
actions.register(findUsers)
|
||||||
|
|
||||||
|
|
|
@ -206,11 +206,12 @@ pandora.ui.usersDialog = function() {
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
init: function(data) {
|
init: function(data) {
|
||||||
numberOfUsers = data.items;
|
|
||||||
$status.html(
|
$status.html(
|
||||||
Ox.formatNumber(numberOfUsers)
|
Ox.formatNumber(data.items)
|
||||||
+ ' user' + (numberOfUsers == 1 ? '' : 's')
|
+ ' user' + (data.items == 1 ? '' : 's')
|
||||||
+ ' (' + Ox.formatNumber(numberOfUsers) + ' registered, 0 guests)'
|
+ ' (' + Ox.formatNumber(data.users) + ' registered, '
|
||||||
|
+ Ox.formatNumber(data.guests) + ' guest' + (data.guests == 1 ? '' : 's')
|
||||||
|
+ ')'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
select: function(data) {
|
select: function(data) {
|
||||||
|
|
Loading…
Reference in a new issue