diff options
author | Leif Johansson <leifj@sunet.se> | 2011-05-13 23:31:52 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-05-13 23:31:52 +0200 |
commit | 22bc00a3c040bc06f9149eb99573dc8a1114aabd (patch) | |
tree | fd23e6aa45741279d460a21c7d0188abcb6a08bc | |
parent | 678b54d910c0022ea4ba9360ef9a5ba11d7e18a7 (diff) |
add recordings and some minor cleanup
-rw-r--r-- | src/meetingtools/apps/cluster/models.py | 5 | ||||
-rw-r--r-- | src/meetingtools/apps/room/views.py | 25 | ||||
-rw-r--r-- | src/meetingtools/urls.py | 3 | ||||
-rw-r--r-- | src/templates/apps/room/list.html | 7 |
4 files changed, 34 insertions, 6 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()), diff --git a/src/templates/apps/room/list.html b/src/templates/apps/room/list.html index f529650..c47763d 100644 --- a/src/templates/apps/room/list.html +++ b/src/templates/apps/room/list.html @@ -7,7 +7,7 @@ $("#rooms").accordion({ header: 'h3', active: false, - event: "click", + event: "click", collapsible: true, navigation: true, animated: true, @@ -29,7 +29,7 @@ <h3 class="listheader">{{r.name}}</h3> <div> {% tags_for_object r as tags %} - <p><a href="{{r|roomurl}}">{{r|roomurl}}<span style="vertical-align: bottom;" class="ui-icon ui-icon-extlink"></span></a></p> + <p><a target="_connect" href="{{r|roomurl}}">{{r|roomurl}}<span style="vertical-align: bottom;" class="ui-icon ui-icon-extlink"></span></a></p> <p class="infopanel ui-widget ui-corner-all ui-state-highlight">{% if r.description %}{{r.description|safe}}{% else %}<em>No description available...</em>{% endif %}</p> <ul class="nlist square" style="padding-left: 2px;"> <li>» Tags: {% for tag in tags %}<a style="margin-right: 5px;" class="ui-widget" href="{% prefix %}/room/+{{tag}}">{{tag}}</a>{% endfor %} {%if edit %}<a style="font-size: 75%;" href="{% prefix %}/room/{{r.id}}/tag"><em>... manage room tags</em></a>{%endif%}</li> @@ -40,9 +40,10 @@ </ul> <br/> <ul class="ilist"> - <li class="button"><a href="{% prefix %}/go/{{r.id}}">Enter Room</a></li> + <li class="button"><a target="_connect" href="{% prefix %}/go/{{r.id}}">Enter Room</a></li> {% if edit %} <li class="button"><a href="{% prefix %}/room/{{r.id}}/tag">Room Tags</a></li> + <li class="button"><a href="{% prefix %}/room/{{r.id}}/recordings">Room Recordings</a></li> <li class="button"><a href="{% prefix %}/room/{{r.id}}/modify">Modify Room</a></li> <li class="button"><a href="{% prefix %}/room/{{r.id}}/delete">Delete Room</a></li> {% endif %} |