summaryrefslogtreecommitdiff
path: root/src/meetingtools
diff options
context:
space:
mode:
Diffstat (limited to 'src/meetingtools')
-rw-r--r--src/meetingtools/apps/cluster/models.py5
-rw-r--r--src/meetingtools/apps/room/views.py25
-rw-r--r--src/meetingtools/urls.py3
3 files changed, 30 insertions, 3 deletions
diff --git a/src/meetingtools/apps/cluster/models.py b/src/meetingtools/apps/cluster/models.py
index 7dba80e..9921dd4 100644
--- a/src/meetingtools/apps/cluster/models.py
+++ b/src/meetingtools/apps/cluster/models.py
@@ -16,4 +16,7 @@ class ACCluster(models.Model):
domain_match = TextField()
def __unicode__(self):
- return self.url \ No newline at end of file
+ return self.url
+
+ def make_url(self,path=""):
+ return "%s%s" % (self.url,path) \ No newline at end of file
diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py
index 97a487c..b0297cd 100644
--- a/src/meetingtools/apps/room/views.py
+++ b/src/meetingtools/apps/room/views.py
@@ -440,4 +440,27 @@ def tag(request,rid):
else:
form = TagRoomForm()
- return respond_to(request, {'text/html': "apps/room/tag.html"}, {'form': form,'formtitle': 'Add Tag','cancelname':'Done','submitname': 'Add Tag','room': room, 'tags': Tag.objects.get_for_object(room)}) \ No newline at end of file
+ return respond_to(request,
+ {'text/html': "apps/room/tag.html"},
+ {'form': form,'formtitle': 'Add Tag','cancelname':'Done','submitname': 'Add Tag','room': room, 'tags': Tag.objects.get_for_object(room)})
+
+
+from time import mktime
+from feedparser import _parse_date as parse_date
+
+@login_required
+def recordings(request,rid):
+ room = get_object_or_404(Room,pk=rid)
+ api = ac_api_client(request, room.acc)
+
+ r = api.request('sco-expanded-contents',{'sco-id': room.sco_id,'filter-icon':'archive'},True)
+ recordings = [{'name': sco.findtext('name'),
+ 'sco_id': sco.get('sco-id'),
+ 'url': room.acc.make_url(sco.findtext('url-path')),
+ 'description': sco.findtext('description'),
+ 'date_created': datetime.fromtimestamp(mktime(parse_date(sco.findtext('date-created')))),
+ 'date_modified': datetime.fromtimestamp(mktime(parse_date(sco.findtext('date-modified'))))} for sco in r.et.findall(".//sco")]
+
+ return respond_to(request,
+ {'text/html': 'apps/room/recordings.html'},
+ {'recordings': recordings,'room':room}) \ No newline at end of file
diff --git a/src/meetingtools/urls.py b/src/meetingtools/urls.py
index d927409..7df1ea0 100644
--- a/src/meetingtools/urls.py
+++ b/src/meetingtools/urls.py
@@ -18,7 +18,7 @@ urlpatterns = patterns('',
(r'^accounts/login?$','meetingtools.apps.auth.views.login'),
(r'^accounts/login-federated$','meetingtools.apps.auth.views.accounts_login_federated'),
(r'^accounts/logout$','meetingtools.apps.auth.views.logout'),
- (r'^rooms?$','meetingtools.apps.room.views.user_rooms'),
+ (r'^(?:room|rooms)$','meetingtools.apps.room.views.user_rooms'),
(r'^go/(\d+)$','meetingtools.apps.room.views.go_by_id'),
(r'^go/(.+)$','meetingtools.apps.room.views.go_by_path'),
(r'^launch/(\d+)$','meetingtools.apps.room.views.launch'),
@@ -29,6 +29,7 @@ urlpatterns = patterns('',
(r'^room/(\d+)/delete$','meetingtools.apps.room.views.delete'),
(r'^room/(\d+)/tag$','meetingtools.apps.room.views.tag'),
(r'^room/(\d+)/untag/(.+)$','meetingtools.apps.room.views.untag'),
+ (r'^room/(\d+)/recordings$','meetingtools.apps.room.views.recordings'),
(r'^widget/\+(.+)$','meetingtools.apps.room.views.widget'),
(r'^room/\+(.+)\.(?:json|html|htm)$','meetingtools.apps.room.views.list_by_tag'),
(r'^room/\+(.+)\.(?:atom)$',RoomAtomTagFeed()),