diff options
author | Leif Johansson <leifj@sunet.se> | 2012-02-09 22:21:05 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2012-02-09 22:21:05 +0100 |
commit | ae821d0696be63c31bd5a325298cfa8eee3b48cb (patch) | |
tree | 03a9f067827825b7a86db9ddd41ed0ac336c67e5 /src/meetingtools/apps/room/views.py | |
parent | 1b769af104c1d1c8d41cb6b0482c7eb67b7b8517 (diff) |
occupation-refresh-button with nice js spinner
Diffstat (limited to 'src/meetingtools/apps/room/views.py')
-rw-r--r-- | src/meetingtools/apps/room/views.py | 10 |
1 files changed, 10 insertions, 0 deletions
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) |