[Debconf-video-commits] r379 - in package/branches/pycon09/src/pyconvideo: . pyconvideo
benh at alioth.debian.org
benh at alioth.debian.org
Tue Mar 24 14:04:17 UTC 2009
Author: benh
Date: 2009-03-24 14:04:17 +0000 (Tue, 24 Mar 2009)
New Revision: 379
Added:
package/branches/pycon09/src/pyconvideo/pyconvideo/event_list.html
package/branches/pycon09/src/pyconvideo/pyconvideo/videorecording_list.html
package/branches/pycon09/src/pyconvideo/pyconvideo/videotargetfile_list.html
Modified:
package/branches/pycon09/src/pyconvideo/pyconvideo/views.py
package/branches/pycon09/src/pyconvideo/settings.py
package/branches/pycon09/src/pyconvideo/urls.py
Log:
Add event, recording and target views for ordinary users.
Change front page to point to these.
Added: package/branches/pycon09/src/pyconvideo/pyconvideo/event_list.html
===================================================================
--- package/branches/pycon09/src/pyconvideo/pyconvideo/event_list.html (rev 0)
+++ package/branches/pycon09/src/pyconvideo/pyconvideo/event_list.html 2009-03-24 14:04:17 UTC (rev 379)
@@ -0,0 +1,36 @@
+<html>
+
+ <head><title>Events</title></head>
+
+ <body>
+ <h1>Events</h1>
+
+ <table>
+ <tr>
+ <th>Title</th>
+ <th>Start time</th>
+ <th>Duration</th>
+ <th>Room</th>
+ <th>Recorded as</th>
+ </tr>
+ {% for event in object_list %}
+ <tr>
+ <td>{{ event.title }}</td>
+ <td>{{ event.start_time }}</td>
+ <td>{{ event.duration }}</td>
+ <td>{{ event.conference_room }}</td>
+ <td>
+ {% for recording in event.recording_set.all %}
+ <a href="file:///{{ recording.recording_filename|urlencode }}"
+ class="status-{{ recording.file_status.file_status_code }}">
+ {{ recording.recording_filename }}<br />
+ </a>
+ {% endfor %}
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+
+ </body>
+
+</html>
Added: package/branches/pycon09/src/pyconvideo/pyconvideo/videorecording_list.html
===================================================================
--- package/branches/pycon09/src/pyconvideo/pyconvideo/videorecording_list.html (rev 0)
+++ package/branches/pycon09/src/pyconvideo/pyconvideo/videorecording_list.html 2009-03-24 14:04:17 UTC (rev 379)
@@ -0,0 +1,42 @@
+<html>
+
+ <head><title>Video recordings</title></head>
+
+ <body>
+ <h1>Video recordings</h1>
+
+ <table>
+ <tr>
+ <th>Start time</th>
+ <th>Duration</th>
+ <th>Room</th>
+ <th>Filename</th>
+ <th>Quality/status</th>
+ <th>Events covered</th>
+ <th>Comments</th>
+ </tr>
+ {% for recording in object_list %}
+ <tr class="status-{{ recording.file_status.file_status_code }}">
+ <td>{{ recording.recording_time }}</td>
+ <td>{{ recording.recording_duration }}</td>
+ <td>{{ recording.conference_room }}</td>
+ <td>
+ <a href="file:///{{ recording.recording_filename|urlencode }}">
+ {{ recording.recording_filename }}
+ </a>
+ </td>
+ <td>{{ recording.file_status.file_status_code }}</td>
+ <td>
+ {% for event in recording.event_set.all %}
+ {{ event.title }}<br />
+ {% endfor %}
+ <a href="{{ recording.id }}/review">Review</a>
+ </td>
+ <td>{{ recording.comments }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+
+ </body>
+
+</html>
Added: package/branches/pycon09/src/pyconvideo/pyconvideo/videotargetfile_list.html
===================================================================
--- package/branches/pycon09/src/pyconvideo/pyconvideo/videotargetfile_list.html (rev 0)
+++ package/branches/pycon09/src/pyconvideo/pyconvideo/videotargetfile_list.html 2009-03-24 14:04:17 UTC (rev 379)
@@ -0,0 +1,36 @@
+<html>
+
+ <head><title>Target files</title></head>
+
+ <body>
+ <h1>Target files</h1>
+
+ <table>
+ <tr>
+ <th>Event</th>
+ <th>Recording</th>
+ {% for format in formats %}
+ <th>Target '{{ format.target_format_abbr }}'</th>
+ {% endfor %}
+ </tr>
+ {% for file_set in files %}
+ <tr>
+ <td>{{ file_set.source.event.title }}</td>
+ <td>{{ file_set.source.recording.recording_filename }}</td>
+ {% for target in file_set.target %}
+ {% if target %}
+ <td class="status-{{ target.status.status_code }}">
+ <a href="file:///{{ target.target_filename|urlencode }}">File</a>
+ | <a href="{{ target.id }}/review">Review</a>
+ </td>
+ {% else %}
+ <td>pending</td>
+ {% endif %}
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </table>
+
+ </body>
+
+</html>
Modified: package/branches/pycon09/src/pyconvideo/pyconvideo/views.py
===================================================================
--- package/branches/pycon09/src/pyconvideo/pyconvideo/views.py 2009-03-24 13:51:30 UTC (rev 378)
+++ package/branches/pycon09/src/pyconvideo/pyconvideo/views.py 2009-03-24 14:04:17 UTC (rev 379)
@@ -1 +1,24 @@
-# Create your views here.
+from django.shortcuts import render_to_response
+from . import models
+
+def review_recording(request, recording_id):
+ recording_id = int(recording_id)
+
+def list_targets(request):
+ sources = models.VideoEventRecording.objects.all().select_related()
+ formats = models.VideoTargetFormat.objects.all()
+ files = []
+ for source in sources:
+ files.append({'source': source, 'target': []})
+ for format in formats:
+ for target in source.target_set.all():
+ if target.target_format == format:
+ break
+ else:
+ target = None
+ files[-1]['target'].append(target)
+ return render_to_response('pyconvideo/videotargetfile_list.html',
+ {'files': files, 'formats': formats})
+
+def review_target(request, target_id):
+ target_id = int(target_id)
Modified: package/branches/pycon09/src/pyconvideo/settings.py
===================================================================
--- package/branches/pycon09/src/pyconvideo/settings.py 2009-03-24 13:51:30 UTC (rev 378)
+++ package/branches/pycon09/src/pyconvideo/settings.py 2009-03-24 14:04:17 UTC (rev 379)
@@ -1,6 +1,7 @@
# Django settings for web project.
import debconfvideo
+import os.path
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@@ -70,6 +71,7 @@
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
+ os.path.abspath(os.path.dirname(__file__))
)
INSTALLED_APPS = (
Modified: package/branches/pycon09/src/pyconvideo/urls.py
===================================================================
--- package/branches/pycon09/src/pyconvideo/urls.py 2009-03-24 13:51:30 UTC (rev 378)
+++ package/branches/pycon09/src/pyconvideo/urls.py 2009-03-24 14:04:17 UTC (rev 379)
@@ -1,5 +1,7 @@
-from django.conf.urls.defaults import *
+from django.conf.urls.defaults import patterns
from django.http import HttpResponse
+from django.views.generic.list_detail import object_list
+from .pyconvideo import models, views
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
@@ -11,15 +13,21 @@
<head><title>Pycon Video Management</title></head>
<body>
<h1>Pycon Video Management</h1>
- <p><a href="admin/pyconvideo/event/">Events</a> - all known events in the conference</p>
- <p><a href="admin/pyconvideo/videorecording/">Recordings</a> - all recorded files</p>
- <p><a href="admin/pyconvideo/videoeventrecording/">Event-recordings</a> - events known to have been recorded</p>
- <p><a href="admin/pyconvideo/videotargetfile/">Target files</a> - completed files for publication or archival</p>
+ <p><a href="event/">Events</a> - all known events in the conference</p>
+ <p><a href="recording/">Recordings</a> - all recorded files</p>
+ <p><a href="target/">Target files</a> - completed files for publication or archival</p>
</body>
</html>
''')
urlpatterns = patterns('',
(r'^$', front_page),
+ (r'^event/$', object_list,
+ {'queryset': models.Event.objects.all().select_related()}),
+ (r'^recording/$', object_list,
+ {'queryset': models.VideoRecording.objects.all().select_related()}),
+ (r'^recording/(\d+)/review$', views.review_recording),
+ (r'^target/$', views.list_targets),
+ (r'^target/(\d+)/review$', views.review_target),
(r'^admin/(.*)', admin.site.root),
)
More information about the Debconf-video-commits
mailing list