Skip to content

Commit a5ee606

Browse files
committed
Merged in [10348] from rcross@amsl.com:
Add more information to Secretariat session recordings view. - Legacy-Id: 10364 Note: SVN reference [10348] has been migrated to Git commit 8c82fef
2 parents f73193e + 8c82fef commit a5ee606

5 files changed

Lines changed: 75 additions & 23 deletions

File tree

ietf/meeting/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,9 @@ def agenda(self):
928928
def minutes(self):
929929
return self.get_material("minutes", only_one=True)
930930

931+
def recordings(self):
932+
return list(self.get_material("recording", only_one=False))
933+
931934
def slides(self):
932935
return list(self.get_material("slides", only_one=False))
933936

ietf/secr/proceedings/tests.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from ietf.utils.test_data import make_test_data
1515
from ietf.utils.test_utils import TestCase
1616

17+
from ietf.name.models import SessionStatusName
1718
from ietf.secr.utils.meeting import get_proceedings_path
1819

1920
SECR_USER='secretary'
@@ -27,19 +28,23 @@ def test_main(self):
2728
response = self.client.get(url)
2829
self.assertEqual(response.status_code, 200)
2930

31+
3032
class RecordingTestCase(TestCase):
3133
def test_page(self):
32-
make_test_data()
33-
meeting = Meeting.objects.first()
34+
meeting = make_meeting_test_data()
3435
url = reverse('proceedings_recording', kwargs={'meeting_num':meeting.number})
3536
self.client.login(username="secretary", password="secretary+password")
3637
response = self.client.get(url)
3738
self.assertEqual(response.status_code, 200)
39+
3840
def test_post(self):
39-
make_meeting_test_data()
40-
meeting = Meeting.objects.first()
41+
meeting = make_meeting_test_data()
4142
group = Group.objects.get(acronym='mars')
42-
session = Session.objects.filter(meeting=meeting,group=group,status__in=('sched','schedw')).first()
43+
session = Session.objects.filter(meeting=meeting,group=group).first()
44+
# explicitly set to scheduled for this test
45+
status = SessionStatusName.objects.get(slug='sched')
46+
session.status = status
47+
session.save()
4348
url = reverse('proceedings_recording', kwargs={'meeting_num':meeting.number})
4449
data = dict(group=group.acronym,external_url='http://youtube.com/xyz',session=session.pk)
4550
self.client.login(username="secretary", password="secretary+password")
@@ -54,7 +59,8 @@ def test_post(self):
5459
response = self.client.post(url,dict(external_url=external_url),follow=True)
5560
self.assertEqual(response.status_code, 200)
5661
self.failUnless(external_url in response.content)
57-
62+
63+
5864
class BluesheetTestCase(TestCase):
5965
def setUp(self):
6066
self.proceedings_dir = os.path.abspath("tmp-proceedings-dir")

ietf/secr/proceedings/views.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,21 @@ def get_doc_filename(doc):
7575
# TODO we might want to choose from among multiple files using some logic
7676
return files[0]
7777

78+
def get_unmatched_recordings(meeting):
79+
'''
80+
Returns a list of recording filenames that haven't been matched to a session
81+
'''
82+
unmatched_recordings = []
83+
path = os.path.join(settings.MEETING_RECORDINGS_DIR,'ietf{}'.format(meeting.number))
84+
try:
85+
files = os.listdir(path)
86+
except OSError:
87+
files = []
88+
for file in files:
89+
if not Document.objects.filter(external_url__endswith=file).exists():
90+
unmatched_recordings.append(file)
91+
return unmatched_recordings
92+
7893
def get_extras(meeting):
7994
'''
8095
Gather "extras" which are one off groups. ie iab-wcit(86)
@@ -608,10 +623,13 @@ def progress_report(request, meeting_num):
608623
@role_required('Secretariat')
609624
def recording(request, meeting_num):
610625
'''
611-
Enter Session recording info. Creates Document and associates it with Session
626+
Enter Session recording info. Creates Document and associates it with Session.
627+
For auditing purposes, lists all scheduled sessions and associated recordings, if
628+
any. Also lists those audio recording files which haven't been matched to a
629+
session.
612630
'''
613631
meeting = get_object_or_404(Meeting, number=meeting_num)
614-
recordings = Document.objects.filter(name__startswith='recording-{}'.format(meeting.number),states__slug='active').order_by('group__acronym')
632+
sessions = meeting.session_set.filter(type='session',status='sched').order_by('group__acronym')
615633

616634
if request.method == 'POST':
617635
form = RecordingForm(request.POST)
@@ -638,7 +656,8 @@ def recording(request, meeting_num):
638656
return render_to_response('proceedings/recording.html',{
639657
'meeting':meeting,
640658
'form':form,
641-
'recordings':recordings},
659+
'sessions':sessions,
660+
'unmatched_recordings': get_unmatched_recordings(meeting)},
642661
RequestContext(request, {}),
643662
)
644663

ietf/secr/static/secr/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ td.hidden {
583583
display: none;
584584
}
585585

586+
td.document-name {
587+
white-space: nowrap;
588+
}
589+
586590
/* ==========================================================================
587591
Role Tool
588592
========================================================================== */

ietf/secr/templates/proceedings/recording.html

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ <h2>Recording Metadata</h2>
4343
</div> <!-- button-group -->
4444

4545
</form>
46+
4647
<div class="inline-related">
47-
<h2>{{ meeting }} - Recordings
48-
</h2>
48+
<h2>{{ meeting }} - Recordings</h2>
4949
<table class="center">
5050
<thead>
5151
<tr>
@@ -57,27 +57,47 @@ <h2>{{ meeting }} - Recordings
5757
</tr>
5858
</thead>
5959
<tbody>
60-
{% for record in recordings %}
60+
{% for session in sessions %}
6161
<tr>
62-
<td>{{ record.group.acronym }}</td>
63-
<td>{{ record.session_set.first.official_scheduledsession.timeslot.time|date:"m-d H:i" }}</td>
64-
<td>{{ record.name }}</td>
65-
<td><a href="{{ record.href }}">{{ record.href }}</a></td>
66-
<td><a href="{% url "proceedings_recording_edit" meeting_num=meeting.number name=record.name %}">Edit</a></td>
62+
<td>{{ session.group.acronym }}</td>
63+
<td>{{ session.official_timeslotassignment.timeslot.time|date:"m-d H:i" }}</td>
64+
{% if session.recordings %}
65+
<td class="document-name" >{{ session.recordings.0.name }}</td>
66+
<td><a href="{{ session.recordings.first.href }}">{{ session.recordings.0.href }}</a></td>
67+
<td><a href="{% url "proceedings_recording_edit" meeting_num=meeting.number name=session.recordings.0.name %}">Edit</a></td>
68+
{% else %}
69+
<td></td>
70+
<td></td>
71+
<td></td>
72+
{% endif %}
6773
</tr>
6874
{% endfor %}
6975
</tbody>
7076
</table>
77+
</div> <!-- inline-group -->
7178

79+
{% if unmatched_recordings %}
80+
<div class="inline-related">
81+
<h2>Unmatched Recording Files</h2>
82+
<table class="center">
83+
<thead>
84+
<tr>
85+
<th>Filename</th>
86+
</tr>
87+
</thead>
88+
<tbody>
89+
{% for file in unmatched_recordings %}
90+
<tr>
91+
<td>{{ file }}</td>
92+
</tr>
93+
{% endfor %}
94+
</tbody>
95+
</table>
7296
</div> <!-- inline-group -->
97+
{% endif %}
98+
7399
</div> <!-- module -->
74100

75-
{% if docevents %}
76-
<br>
77-
<div class="module interim-container">
78-
{% include "includes/docevents.html" %}
79-
</div>
80-
{% endif %}
81101

82102
{% endblock %}
83103

0 commit comments

Comments
 (0)