Skip to content

Commit 0c8db80

Browse files
richsalzjennifer-richardsrjsparks
authored
fix: Show recordings for interims (ietf-tools#7197)
* fix: Show recordings for interims Add methods uses_notes(), has_recordings(), and uses_chat_logs() to the meeting object (with semantically correct tests) and use them consistently throughout. List the recordings if the "meeting numnber" starts with "interim" Fixes: ietf-tools#6543 * style: Use "is not" and "is" for None comparisons * None comparison and non-IETF meetings style: Use "is not None" instead of "!=" For non-IETF meetings assume chat logs exist * fix: Restore useNotes for JS fields * fix: uses_notes->useNotes (in JavaScript) Also add comment about meeting number field in tests * Missed a uses_notes->useNotes edit * fix: useNotes->usesNotes --------- Co-authored-by: Jennifer Richards <jennifer@staff.ietf.org> Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
1 parent f921cdb commit 0c8db80

12 files changed

Lines changed: 43 additions & 30 deletions

File tree

client/agenda/AgendaScheduleList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const meetingEvents = computed(() => {
296296
color: 'red'
297297
})
298298
}
299-
if (agendaStore.useNotes) {
299+
if (agendaStore.usesNotes) {
300300
links.push({
301301
id: `lnk-${item.id}-note`,
302302
label: 'Notepad for note-takers',

client/agenda/store.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const useAgendaStore = defineStore('agenda', {
5050
selectedCatSubs: [],
5151
settingsShown: false,
5252
timezone: DateTime.local().zoneName,
53-
useNotes: false,
53+
usesNotes: false,
5454
visibleDays: []
5555
}),
5656
getters: {
@@ -160,7 +160,7 @@ export const useAgendaStore = defineStore('agenda', {
160160
this.isCurrentMeeting = agendaData.isCurrentMeeting
161161
this.meeting = agendaData.meeting
162162
this.schedule = agendaData.schedule
163-
this.useNotes = agendaData.useNotes
163+
this.usesNotes = agendaData.usesNotes
164164

165165
// -> Compute current info note hash
166166
this.infoNoteHash = murmur(agendaData.meeting.infoNote, 0).toString()

ietf/doc/views_doc.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ def document_raw_id(request, name, rev=None, ext=None):
996996
for t in possible_types:
997997
if os.path.exists(base_path + t):
998998
found_types[t]=base_path+t
999-
if ext == None:
999+
if ext is None:
10001000
ext = 'txt'
10011001
if not ext in found_types:
10021002
raise Http404('dont have the file for that extension')
@@ -1227,7 +1227,7 @@ def document_bibtex(request, name, rev=None):
12271227
raise Http404()
12281228

12291229
# Make sure URL_REGEXPS did not grab too much for the rev number
1230-
if rev != None and len(rev) != 2:
1230+
if rev is not None and len(rev) != 2:
12311231
mo = re.search(r"^(?P<m>[0-9]{1,2})-(?P<n>[0-9]{2})$", rev)
12321232
if mo:
12331233
name = name+"-"+mo.group(1)
@@ -1250,7 +1250,7 @@ def document_bibtex(request, name, rev=None):
12501250
replaced_by = [d.name for d in doc.related_that("replaces")]
12511251
draft_became_rfc = doc.became_rfc()
12521252

1253-
if rev != None and rev != doc.rev:
1253+
if rev is not None and rev != doc.rev:
12541254
# find the entry in the history
12551255
for h in doc.history_set.order_by("-time"):
12561256
if rev == h.rev:
@@ -1291,7 +1291,7 @@ def document_bibxml(request, name, rev=None):
12911291
raise Http404()
12921292

12931293
# Make sure URL_REGEXPS did not grab too much for the rev number
1294-
if rev != None and len(rev) != 2:
1294+
if rev is not None and len(rev) != 2:
12951295
mo = re.search(r"^(?P<m>[0-9]{1,2})-(?P<n>[0-9]{2})$", rev)
12961296
if mo:
12971297
name = name+"-"+mo.group(1)
@@ -1439,7 +1439,7 @@ def document_referenced_by(request, name):
14391439
if doc.type_id in ["bcp","std","fyi"]:
14401440
for rfc in doc.contains():
14411441
refs |= rfc.referenced_by()
1442-
full = ( request.GET.get('full') != None )
1442+
full = ( request.GET.get('full') is not None )
14431443
numdocs = refs.count()
14441444
if not full and numdocs>250:
14451445
refs=refs[:250]
@@ -1459,7 +1459,7 @@ def document_ballot_content(request, doc, ballot_id, editable=True):
14591459
augment_events_with_revision(doc, all_ballots)
14601460

14611461
ballot = None
1462-
if ballot_id != None:
1462+
if ballot_id is not None:
14631463
ballot_id = int(ballot_id)
14641464
for b in all_ballots:
14651465
if b.id == ballot_id:
@@ -1661,7 +1661,7 @@ def add_comment(request, name):
16611661

16621662
login = request.user.person
16631663

1664-
if doc.type_id == "draft" and doc.group != None:
1664+
if doc.type_id == "draft" and doc.group is not None:
16651665
can_add_comment = bool(has_role(request.user, ("Area Director", "Secretariat", "IRTF Chair", "IANA", "RFC Editor")) or (
16661666
request.user.is_authenticated and
16671667
Role.objects.filter(name__in=("chair", "secr"),

ietf/meeting/models.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,22 @@ def previous_meeting(self):
383383
return Meeting.objects.filter(type_id=self.type_id,date__lt=self.date).order_by('-date').first()
384384

385385
def uses_notes(self):
386-
return self.date>=datetime.date(2020,7,6)
386+
if self.type_id != 'ietf':
387+
return True
388+
num = self.get_number()
389+
return num is not None and num >= 108
390+
391+
def has_recordings(self):
392+
if self.type_id != 'ietf':
393+
return True
394+
num = self.get_number()
395+
return num is not None and num >= 80
396+
397+
def has_chat_logs(self):
398+
if self.type_id != 'ietf':
399+
return True;
400+
num = self.get_number()
401+
return num is not None and num >= 60
387402

388403
def meeting_start(self):
389404
"""Meeting-local midnight at the start of the meeting date"""

ietf/meeting/tests_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def test_meeting_agenda(self):
259259
},
260260
"categories": rjson.get("categories"), # Just expect the value to exist
261261
"isCurrentMeeting": True,
262-
"useNotes": True,
262+
"usesNotes": False, # make_meeting_test_data sets number=72
263263
"schedule": rjson.get("schedule"), # Just expect the value to exist
264264
"floors": []
265265
}

ietf/meeting/views.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,6 @@ def agenda_plain(request, num=None, name=None, base=None, ext=None, owner=None,
16171617
"now": timezone.now().astimezone(meeting.tz()),
16181618
"display_timezone": display_timezone,
16191619
"is_current_meeting": is_current_meeting,
1620-
"use_notes": meeting.uses_notes(),
16211620
"cache_time": 150 if is_current_meeting else 3600,
16221621
},
16231622
content_type=mimetype[ext],
@@ -1692,7 +1691,7 @@ def api_get_agenda_data (request, num=None):
16921691
},
16931692
"categories": filter_organizer.get_filter_categories(),
16941693
"isCurrentMeeting": is_current_meeting,
1695-
"useNotes": meeting.uses_notes(),
1694+
"usesNotes": meeting.uses_notes(),
16961695
"schedule": list(map(agenda_extract_schedule, filtered_assignments)),
16971696
"floors": list(map(agenda_extract_floorplan, floors))
16981697
})
@@ -2489,7 +2488,6 @@ def session_details(request, num, acronym):
24892488
'can_manage_materials' : can_manage,
24902489
'can_view_request': can_view_request,
24912490
'thisweek': datetime_today()-datetime.timedelta(days=7),
2492-
'use_notes': meeting.uses_notes(),
24932491
})
24942492

24952493
class SessionDraftsForm(forms.Form):

ietf/templates/group/meetings-row.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<div class="regular float-end">
7979
{# see note in the included templates re: show_agenda parameter and required JS import #}
8080
{% if s.meeting.type.slug == 'interim' %}
81-
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False session=s meeting=s.meeting use_notes=s.meeting.use_notes %}
81+
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False session=s meeting=s.meeting %}
8282
{% else %}
83-
{% include "meeting/session_buttons_include.html" with show_agenda=False item=s.official_timeslotassignment session=s meeting=s.meeting use_notes=s.meeting.use_notes %}
83+
{% include "meeting/session_buttons_include.html" with show_agenda=False item=s.official_timeslotassignment session=s meeting=s.meeting %}
8484
{% endif %}
8585
</div>
8686
{% endif %}

ietf/templates/meeting/interim_session_buttons.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</a>
3535
{% endif %}
3636
{# notes #}
37-
{% if use_notes %}
37+
{% if session.agenda.uses_notes %}
3838
<a class="btn btn-outline-primary"
3939
href="{{ session.notes_url }}"
4040
aria-label="Notepad for note-takers"

ietf/templates/meeting/session_buttons_include.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</a>
4242
{% endif %}
4343
{# Notes #}
44-
{% if use_notes %}
44+
{% if meeting.uses_notes %}
4545
<a class="btn btn-outline-primary"
4646
role="button"
4747
href="{{ session.notes_url }}"
@@ -126,7 +126,7 @@
126126
</a>
127127
{% else %}
128128
{# chat logs #}
129-
{% if meeting.number|add:"0" >= 60 %}
129+
{% if meeting.has_chat_logs %}
130130
<a class="btn btn-outline-primary"
131131
role="button"
132132
href="{{session.chat_archive_url}}"
@@ -136,7 +136,7 @@
136136
</a>
137137
{% endif %}
138138
{# Recordings #}
139-
{% if meeting.number|add:"0" >= 80 %}
139+
{% if meeting.has_recordings %}
140140
{% with session.recordings as recordings %}
141141
{% if recordings %}
142142
{# There's no guaranteed order, so this is a bit messy: #}
@@ -229,7 +229,7 @@
229229
</li>
230230
{% endif %}
231231
{# Notes #}
232-
{% if use_notes %}
232+
{% if meeting.uses_notes %}
233233
<li>
234234
<a class="dropdown-item" href="{{ session.notes_url }}">
235235
<i class="bi bi-journal-text"></i> Notepad for note-takers
@@ -303,7 +303,7 @@
303303
</li>
304304
{% else %}
305305
{# chat logs #}
306-
{% if meeting.number|add:"0" >= 60 %}
306+
{% if meeting.has_chat_logs %}
307307
<li>
308308
<a class="dropdown-item"
309309
href="session.chat_room_url">
@@ -312,7 +312,7 @@
312312
</li>
313313
{% endif %}
314314
{# Recordings #}
315-
{% if meeting.number|add:"0" >= 80 %}
315+
{% if meeting.has_recordings %}
316316
{% with session.recordings as recordings %}
317317
{% if recordings %}
318318
{# There's no guaranteed order, so this is a bit messy: #}

ietf/templates/meeting/session_details_panel.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% if meeting.type.slug == 'interim' %}
1010
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False %}
1111
{% else %}
12-
{% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment use_notes=session.meeting.use_notes %}
12+
{% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment %}
1313
{% endif %}
1414
</div>
1515
{% endif %}
@@ -230,7 +230,7 @@ <h3 class="mt-4">Meeting tools</h3>
230230
<table class="table table-sm table-striped meeting-tools"
231231
id="meeting_tools_{{ session.pk }}">
232232
<tbody>
233-
{% if use_notes %}
233+
{% if meeting.uses_notes %}
234234
<tr>
235235
<td>
236236
<a href="{{ session.notes_url }}">
@@ -310,7 +310,7 @@ <h3 class="mt-4">Notes and recordings</h3>
310310
<table class="table table-sm table-striped meeting-tools"
311311
id="notes_and_recordings_{{ session.pk }}">
312312
<tbody>
313-
{% if use_notes %}
313+
{% if session.uses_notes %}
314314
<tr>
315315
<td>
316316
<a href="{{ session.notes_url }}">
@@ -320,7 +320,7 @@ <h3 class="mt-4">Notes and recordings</h3>
320320
</tr>
321321
{% endif %}
322322
{# Recordings #}
323-
{% if meeting.type.slug == 'interim' or meeting.number|add:"0" >= 80 %}
323+
{% if session.has_recordings %}
324324
{% with session.recordings as recordings %}
325325
{% if recordings %}
326326
{# There's no guaranteed order, so this is a bit messy: #}

0 commit comments

Comments
 (0)