fix: Show recordings for interims#7197
Conversation
|
Should the same fix be made for the buttons, at https://github.com/ietf-tools/datatracker/blob/main/ietf/templates/meeting/session_buttons_include.html#L139 ? |
| {% endif %} | ||
| {# Recordings #} | ||
| {% if meeting.number|add:"0" >= 80 %} | ||
| {% if meeting.number|add:"0" >= 80 or "interim" in meeting.number %} |
There was a problem hiding this comment.
| {% if meeting.number|add:"0" >= 80 or "interim" in meeting.number %} | |
| {% if meeting.type_id == 'ietf' and meeting.number|add:"0" >= 80 or meeting.type_id != 'ietf' %} |
There was a problem hiding this comment.
The above suggestion is a bit awkward - it requires knowing the precedence of operators as documented at https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#boolean-operators. It might be better to move this into the view code to get away from the |add:"0" type-coersion-by-hack-trick anyhow.
There was a problem hiding this comment.
I thought of something like that. In addition to the one mentioned above, the other tests against meeting 60. What's the significance of meetings 60 and 80? I'd like to remove the magic numbers, replacing with a reasonable function name.
There was a problem hiding this comment.
they aren't magic (though they aren't complete) - they are places where the shape of proceedings and what was captured at meetings fundamentally changes. 60 was when we first started capturing chatlogs (jabber at the time). 80 was a point at where recording tech changed significantly.
That said, we don't have any Documents of type "recording" before ietf-100, so the code being touched here could could (for meetings of type ietf) not show the recordings block at all for meeting numbers < 100.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7197 +/- ##
==========================================
- Coverage 88.78% 88.77% -0.02%
==========================================
Files 296 299 +3
Lines 41320 41355 +35
==========================================
+ Hits 36687 36712 +25
- Misses 4633 4643 +10 ☔ View full report in Codecov by Sentry. |
Looks like it. This really needs a new (or updated) test. |
rjsparks
left a comment
There was a problem hiding this comment.
This is shaping up nicely. It should go a litter further as noted inline.
| return text | ||
|
|
||
| @register.filter | ||
| def has_chat_logs(meeting): |
There was a problem hiding this comment.
Should this get the same "Return true for interims" treatment?
There was a problem hiding this comment.
It's not clear that these should be filters - why aren't they methods on Meeting instead? (those would be visible to the templates). I think you were on the way to discovering that with the partial removal of the has_notes filter, and the redundant argument passed to the templates in the views later.
There was a problem hiding this comment.
Happy to make them methods on the meeting if you prefer. I didn't know templates could invoke methods directly :)
There was a problem hiding this comment.
Should this get the same "Return true for interims" treatment?
I guess? I changed it in the commit 466a630
| #register.filter | ||
| #define has_notes(meeting): | ||
| return meeting.uses_notes() |
There was a problem hiding this comment.
This looks incomplete - if the intent was to remove the filter L899 should also go.
There was a problem hiding this comment.
(and I suspect all of these should just be removed once the functionality is moved to Meeting.
There was a problem hiding this comment.
yes, this was just checking in a snapshot before i got on the plane. will move to templates and fix shortly.
5a99e85 to
89449d7
Compare
|
Rebased, squashed, fixed the tests. This is ready for review now. |
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
jennifer-richards
left a comment
There was a problem hiding this comment.
Overall looks good - thank you for getting rid of the kludgy template code! There are a few nits to adjust that I've noted inline but I don't see any big issues.
| if self.type_id != 'ietf': | ||
| return True | ||
| num = self.get_number() | ||
| return num != None and num >= 108 |
There was a problem hiding this comment.
Generally preferable to write the first test as num is not None
| return num != None and num >= 80 | ||
|
|
||
| def has_chat_logs(self): | ||
| num = self.get_number() |
There was a problem hiding this comment.
For symmetry with the other has_* methods, I think it'd be good to make clear how this behaves with non-"ietf" meetings
| "categories": filter_organizer.get_filter_categories(), | ||
| "isCurrentMeeting": is_current_meeting, | ||
| "useNotes": meeting.uses_notes(), | ||
| "uses_notes": meeting.uses_notes(), |
There was a problem hiding this comment.
Should also stay as a camelCase key (usesNotes) to match the rest of the structure
style: Use "is not None" instead of "!=" For non-IETF meetings assume chat logs exist
|
@jennifer-richards I believe I addressed all your feedback, PTAL. |
jennifer-richards
left a comment
There was a problem hiding this comment.
One question inline
rjsparks
left a comment
There was a problem hiding this comment.
Let me know if I misread the request for keeping the js variables in camelCase.
Also add comment about meeting number field in tests
jennifer-richards
left a comment
There was a problem hiding this comment.
I think there's still one variable name change needed
|
I think there was still disagreement about |
List the recordings if the "meeting number" starts with "interim"
Fixes: #6543