Skip to content

Commit f2964b9

Browse files
committed
Continued iterative-improvements to auto-generated proceedings:
- Migration to create documents and sessionpresentations for ietf95 and 96 bluesheets. Add bluesheets to proceedings. - Refactor columns for proceedings to group agenda, minutes, and bluesheets into one column. - Add a column for recordings. Show the recordings for all sessions for a group. - Refactored all_meeting_ functions on session. Improved (with a hack) how recordings are displayed. - Add guards against very old meetings. For more modern, past, meetings, add a warning that these are not the official proceedings and provide a link to the official proceedings. Commit ready for merge. - Legacy-Id: 11758
2 parents c68ae76 + 56c232e commit f2964b9

6 files changed

Lines changed: 217 additions & 21 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
import os
5+
6+
from django.db import migrations
7+
from django.conf import settings
8+
9+
10+
def official_time(session):
11+
return session.timeslotassignments.filter(schedule=session.meeting.agenda).first()
12+
13+
def forward(apps, schema_editor):
14+
Document = apps.get_model('doc','Document')
15+
State = apps.get_model('doc','State')
16+
Group = apps.get_model('group','Group')
17+
Meeting = apps.get_model('meeting', 'Meeting')
18+
19+
active = State.objects.get(type_id='bluesheets',slug='active')
20+
21+
for num in [95, 96]:
22+
mtg = Meeting.objects.get(number=num)
23+
bs_path = '%s/bluesheets/'% os.path.join(settings.AGENDA_PATH,mtg.number)
24+
bs_files = os.listdir(bs_path)
25+
bs_acronyms = set([x[14:-7] for x in bs_files])
26+
group_acronyms = set([x.group.acronym for x in mtg.session_set.all() if official_time(x) and x.group.type_id in ['wg','rg','ag'] and not x.agenda_note.lower().startswith('cancel')])
27+
28+
if bs_acronyms-group_acronyms:
29+
print "Warning IETF%s : groups that have bluesheets but did not appear to meet: %s"%(num,list(bs_acronyms-group_acronyms))
30+
if group_acronyms-bs_acronyms:
31+
print "Warning IETF%s : groups that appeared to meet but have no bluesheets: %s"%(num,list(group_acronyms-bs_acronyms))
32+
33+
for acronym in group_acronyms & bs_acronyms:
34+
group = Group.objects.get(acronym=acronym)
35+
bs = sorted([x for x in bs_files if '-%s-'%acronym in x])
36+
bs_count = len(bs)
37+
sess = sorted([ x for x in mtg.session_set.filter(group__acronym=acronym) if not x.agenda_note.lower().startswith('cancel')],
38+
key = lambda x: official_time(x).timeslot.time)
39+
sess_count = len(sess)
40+
if bs_count != sess_count:
41+
print "Warning IETF%s: %s : different number of bluesheets (%d) than sessions (%d)"%(num,acronym,bs_count,sess_count)
42+
numdocs = min(bs_count,sess_count)
43+
for n in range(numdocs):
44+
doc = Document.objects.create(
45+
name=bs[n][:-4],
46+
type_id='bluesheets',
47+
title='Bluesheets IETF%d : %s : %s ' % (num,acronym,official_time(sess[n]).timeslot.time.strftime('%a %H:%M')),
48+
group=group,
49+
rev='00',
50+
external_url=bs[n],
51+
)
52+
doc.states.add(active)
53+
sess[n].sessionpresentation_set.create(document=doc,rev='00')
54+
55+
def reverse(apps, schema_editor):
56+
Document = apps.get_model('doc','Document')
57+
Document.objects.filter(type_id='bluesheets',sessionpresentation__session__meeting__number_in=[95,96]).exclude(group__acronym='openpgp').delete()
58+
59+
class Migration(migrations.Migration):
60+
61+
dependencies = [
62+
('meeting', '0028_add_audio_stream_data'),
63+
('doc', '0012_auto_20160207_0537'),
64+
('group','0008_auto_20160505_0523'),
65+
]
66+
67+
operations = [
68+
migrations.RunPython(forward,reverse)
69+
]

ietf/meeting/models.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,9 @@ def minutes(self):
10101010
def recordings(self):
10111011
return list(self.get_material("recording", only_one=False))
10121012

1013+
def bluesheets(self):
1014+
return list(self.get_material("bluesheets", only_one=False))
1015+
10131016
def slides(self):
10141017
if not hasattr(self, "_slides_cache"):
10151018
self._slides_cache = list(self.get_material("slides", only_one=False))
@@ -1018,9 +1021,28 @@ def slides(self):
10181021
def drafts(self):
10191022
return list(self.materials.filter(type='draft'))
10201023

1024+
def all_meeting_sessions_for_group(self):
1025+
sessions = [s for s in self.meeting.session_set.filter(group=self.group,type=self.type) if s.official_timeslotassignment()]
1026+
return sorted(sessions, key = lambda x: x.official_timeslotassignment().timeslot.time)
1027+
1028+
def all_meeting_recordings(self):
1029+
recordings = []
1030+
sessions = self.all_meeting_sessions_for_group()
1031+
for session in sessions:
1032+
recordings.extend(session.recordings())
1033+
return recordings
1034+
1035+
def all_meeting_bluesheets(self):
1036+
bluesheets = []
1037+
sessions = self.all_meeting_sessions_for_group()
1038+
for session in sessions:
1039+
bluesheets.extend(session.bluesheets())
1040+
return bluesheets
1041+
10211042
def all_meeting_drafts(self):
10221043
drafts = []
1023-
for session in self.meeting.session_set.filter(group=self.group):
1044+
sessions = self.all_meeting_sessions_for_group()
1045+
for session in sessions:
10241046
drafts.extend(session.drafts())
10251047
return drafts
10261048

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from django import template
2+
3+
register = template.Library()
4+
5+
@register.filter
6+
def hack_recording_title(recording,add_timestamp=False):
7+
8+
if recording.title.startswith('Audio recording for') or recording.title.startswith('Video recording for'):
9+
hacked_title = recording.title[:15]
10+
if add_timestamp:
11+
hacked_title += ' '+recording.sessionpresentation_set.first().session.official_timeslotassignment().timeslot.time.strftime("%a %H:%M")
12+
return hacked_title
13+
else:
14+
return recording.title

ietf/meeting/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,10 @@ def floor_plan(request, num=None, floor=None, ):
15251525
def proceedings(request, num=None):
15261526

15271527
meeting = get_meeting(num)
1528+
1529+
if meeting.number <= 64 or not meeting.agenda.assignments.exists():
1530+
return HttpResponseRedirect( 'https://www.ietf.org/proceedings/%s' % num )
1531+
15281532
begin_date = meeting.get_submission_start_date()
15291533
cut_off_date = meeting.get_submission_cut_off_date()
15301534
cor_cut_off_date = meeting.get_submission_correction_date()
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{# Copyright The IETF Trust 2015, All Rights Reserved #}{% load origin %}{% origin %}
2+
{% load ietf_filters %}
3+
{% load proceedings_filters %}
4+
<tr>
5+
<td>
6+
{% comment %}
7+
<a name="{{ session.group.acronym }}"></a>
8+
<a name="wg-{{ session.group.acronym }}"></a>
9+
<a name="session.group-{{ session.group.acronym }}"></a>
10+
{% endcomment %}
11+
{% if session.name %}
12+
<div class="anchor-target" id="{{ session.name|slugify }}">{{ session.name }}</div>
13+
{% else %}
14+
<div class="anchor-target" id="{{session.group.acronym}}"><a href="{% url 'ietf.group.views.group_home' acronym=session.group.acronym %}">{{session.group.acronym}}</a></div>
15+
{% if session.group.state.slug == "bof" %}
16+
<span class="label label-success">{{ session.group.state.slug|upper }}</span>
17+
{% endif %}
18+
{% endif %}
19+
</td>
20+
21+
{% if session.status_id == 'canceled' %}
22+
<td colspan="3"><span class="label label-danger">Session cancelled</span></td>
23+
{% else %}
24+
<td>
25+
{% if session.agenda %}
26+
<a href="https://www.ietf.org/proceedings/{{meeting_num}}/agenda/{{ session.agenda }}">Agenda</a><br>
27+
{% else %}
28+
{% if show_agenda == "True" %}
29+
<span class="label label-warning">No agenda</span><br>
30+
{% endif %}
31+
{% endif %}
32+
{% if session.minutes %}
33+
<a href="https://www.ietf.org/proceedings/{{ meeting_num }}/minutes/{{ session.minutes }}">Minutes</a><br>
34+
{% else %}
35+
{% if show_agenda == "True" %}
36+
<span class="label label-warning">No minutes</span><br>
37+
{% endif %}
38+
{% endif %}
39+
{% if session.all_meeting_bluesheets %}
40+
{% if session.all_meeting_bluesheets|length == 1 %}
41+
<a href="{{session.all_meeting_bluesheets.0.get_absolute_url}}">Bluesheets</a></br>
42+
{% else %}
43+
{% for bs in session.all_meeting_bluesheets %}
44+
<a href="{{bs.get_absolute_url}}">Bluesheets {{bs.sessionpresentation_set.first.session.official_timeslotassignment.timeslot.time|date:"D G:i"}}</a></br>
45+
{% endfor %}
46+
{% endif %}
47+
{% endif %}
48+
49+
</td>
50+
<td>
51+
{% if session.all_meeting_sessions_for_group|length == 1 %}
52+
{% for rec in session.all_meeting_recordings %}
53+
<a href="{{rec.get_absolute_url}}">{{rec|hack_recording_title:False}}</a><br>
54+
{% endfor %}
55+
{% else %}
56+
{% for rec in session.all_meeting_recordings %}
57+
<a href="{{rec.get_absolute_url}}">{{rec|hack_recording_title:True}}</a><br>
58+
{% endfor %}
59+
{% endif %}
60+
</td>
61+
<td>
62+
{% with session.slides as slides %}
63+
{% for slide in slides %}
64+
<a href="https://www.ietf.org/proceedings/{{meeting_num}}/slides/{{ slide.external_url }}">{{ slide.title|clean_whitespace }}</a>
65+
<br>
66+
{% empty %}
67+
<span class="label label-warning">No slides</span>
68+
{% endfor %}
69+
{% endwith %}
70+
</td>
71+
<td>
72+
{% with session.all_meeting_drafts as drafts %}
73+
{% for draft in drafts %}
74+
<a href="{% url "doc_view" name=draft.canonical_name %}">{{ draft.canonical_name }}</a><br>
75+
{% empty %}
76+
<span class="label label-warning">No drafts</span>
77+
{% endfor %}
78+
{% endwith %}
79+
</td>
80+
{% endif %}
81+
</tr>
82+

ietf/templates/meeting/proceedings.html

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ <h1>IETF {{ meeting_num }} Proceedings</h1>
2222
<p class="alert alert-info">
2323
<b>This page is under construction</b>
2424
</p>
25+
{% if meeting_num|add:0 <= 96 %}
26+
<p class="alert alert-info">
27+
<b>These are not the official proceedings for IETF{{meeting_num}}. This page shows what would be generated by the new automatic proceedings generator for that meeting. The official proceedings are located at <a href="https://www.ietf.org/proceedings/{{meeting_num}}">https://www.ietf.org/proceedings/{{meeting_num}}</a></b>
28+
</p>
29+
{% endif %}
2530

2631
{# cache for 15 minutes, as long as there's no proceedings activity. takes 4-8 seconds to generate. #}
2732
{% load cache %}
@@ -35,16 +40,16 @@ <h2 class="anchor-target" id="plenaries">Plenaries</h2>
3540
<thead>
3641
<tr>
3742
<th class="col-md-1">Group</th>
38-
<th class="col-md-1">Agenda</th>
39-
<th class="col-md-1">Minutes</th>
40-
<th class="col-md-6">Slides</th>
43+
<th class="col-md-1">Artifacts</th>
44+
<th class="col-md-2">Recordings</th>
45+
<th class="col-md-4">Slides</th>
4146
<th class="col-md-3">Drafts</th>
4247
</tr>
4348
</thead>
4449

4550
<tbody>
4651
{% for session in plenaries %}
47-
{% include "meeting/group_materials.html" %}
52+
{% include "meeting/group_proceedings.html" %}
4853
{% endfor %}
4954
</tbody>
5055
</table>
@@ -58,17 +63,17 @@ <h2 class="anchor-target" id="{{sessions.list.0.group.parent.acronym}}">{{sessio
5863
<thead>
5964
<tr>
6065
<th class="col-md-1">Group</th>
61-
<th class="col-md-1">Agenda</th>
62-
<th class="col-md-1">Minutes</th>
63-
<th class="col-md-6">Slides</th>
66+
<th class="col-md-1">Artifacts</th>
67+
<th class="col-md-2">Recordings</th>
68+
<th class="col-md-4">Slides</th>
6469
<th class="col-md-3">Drafts</th>
6570
</tr>
6671
</thead>
6772

6873
<tbody>
6974
{% for session in sessions.list|dictsort:"group.acronym" %}
7075
{% ifchanged session.group.acronym %}
71-
{% include "meeting/group_materials.html" %}
76+
{% include "meeting/group_proceedings.html" %}
7277
{% endifchanged %}
7378
{% endfor %}
7479
</tbody>
@@ -83,17 +88,17 @@ <h2 class="anchor-target" id="training">Training</h2>
8388
<thead>
8489
<tr>
8590
<th class="col-md-1">Group</th>
86-
<th class="col-md-1">Agenda</th>
87-
<th class="col-md-1">Minutes</th>
88-
<th class="col-md-6">Slides</th>
91+
<th class="col-md-1">Artifacts</th>
92+
<th class="col-md-2">Recordings</th>
93+
<th class="col-md-4">Slides</th>
8994
<th class="col-md-3">Drafts</th>
9095
</tr>
9196
</thead>
9297

9398
<tbody>
9499
{% for session in training %}
95100
{% ifchanged %}
96-
{% include "meeting/group_materials.html" %}
101+
{% include "meeting/group_proceedings.html" %}
97102
{% endifchanged %}
98103
{% endfor %}
99104
</tbody>
@@ -108,17 +113,17 @@ <h2 class="anchor-target" id="iab">IAB <small>Internet Architecture Board</small
108113
<thead>
109114
<tr>
110115
<th class="col-md-1">Group</th>
111-
<th class="col-md-1">Agenda</th>
112-
<th class="col-md-1">Minutes</th>
113-
<th class="col-md-6">Slides</th>
116+
<th class="col-md-1">Artifacts</th>
117+
<th class="col-md-2">Recordings</th>
118+
<th class="col-md-4">Slides</th>
114119
<th class="col-md-3">Drafts</th>
115120
</tr>
116121
</thead>
117122

118123
<tbody>
119124
{% for session in iab %}
120125
{% ifchanged %}
121-
{% include "meeting/group_materials.html" %}
126+
{% include "meeting/group_proceedings.html" %}
122127
{% endifchanged %}
123128
{% endfor %}
124129
</tbody>
@@ -132,17 +137,17 @@ <h2 class="anchor-target" id="irtf">IRTF <small>Internet Research Task Force</sm
132137
<thead>
133138
<tr>
134139
<th class="col-md-1">Group</th>
135-
<th class="col-md-1">Agenda</th>
136-
<th class="col-md-1">Minutes</th>
137-
<th class="col-md-6">Slides</th>
140+
<th class="col-md-1">Artifacts</th>
141+
<th class="col-md-2">Recordings</th>
142+
<th class="col-md-4">Slides</th>
138143
<th class="col-md-3">Drafts</th>
139144
</tr>
140145
</thead>
141146

142147
<tbody>
143148
{% for session in irtf|dictsort:"group.acronym" %}
144149
{% ifchanged %}
145-
{% include "meeting/group_materials.html" %}
150+
{% include "meeting/group_proceedings.html" %}
146151
{% endifchanged %}
147152
{% endfor %}
148153
</tbody>

0 commit comments

Comments
 (0)