From ae821d0696be63c31bd5a325298cfa8eee3b48cb Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 9 Feb 2012 22:21:05 +0100 Subject: occupation-refresh-button with nice js spinner --- src/meetingtools/apps/room/views.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/meetingtools/apps') diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py index ba949fe..e612141 100644 --- a/src/meetingtools/apps/room/views.py +++ b/src/meetingtools/apps/room/views.py @@ -358,6 +358,16 @@ def _clean(request,room): room.sco_id = None return _update_room(request, room) +def occupation(request,rid): + room = get_object_or_404(Room,pk=rid) + with ac_api_client(room.acc) as api: + api.poll_user_counts(room) + d = {'nusers': room.user_count, 'nhosts': room.host_count} + return respond_to(request, + {'text/html': 'apps/room/fragments/occupation.txt', + 'application/json': json_response(d, request)}, + d) + def go_by_id(request,id): room = get_object_or_404(Room,pk=id) return goto(request,room) -- cgit v1.1