fix: Show recordings for interims (#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: #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>
This commit is contained in:
parent
f921cdba5d
commit
0c8db80b18
|
@ -296,7 +296,7 @@ const meetingEvents = computed(() => {
|
|||
color: 'red'
|
||||
})
|
||||
}
|
||||
if (agendaStore.useNotes) {
|
||||
if (agendaStore.usesNotes) {
|
||||
links.push({
|
||||
id: `lnk-${item.id}-note`,
|
||||
label: 'Notepad for note-takers',
|
||||
|
|
|
@ -50,7 +50,7 @@ export const useAgendaStore = defineStore('agenda', {
|
|||
selectedCatSubs: [],
|
||||
settingsShown: false,
|
||||
timezone: DateTime.local().zoneName,
|
||||
useNotes: false,
|
||||
usesNotes: false,
|
||||
visibleDays: []
|
||||
}),
|
||||
getters: {
|
||||
|
@ -160,7 +160,7 @@ export const useAgendaStore = defineStore('agenda', {
|
|||
this.isCurrentMeeting = agendaData.isCurrentMeeting
|
||||
this.meeting = agendaData.meeting
|
||||
this.schedule = agendaData.schedule
|
||||
this.useNotes = agendaData.useNotes
|
||||
this.usesNotes = agendaData.usesNotes
|
||||
|
||||
// -> Compute current info note hash
|
||||
this.infoNoteHash = murmur(agendaData.meeting.infoNote, 0).toString()
|
||||
|
|
|
@ -996,7 +996,7 @@ def document_raw_id(request, name, rev=None, ext=None):
|
|||
for t in possible_types:
|
||||
if os.path.exists(base_path + t):
|
||||
found_types[t]=base_path+t
|
||||
if ext == None:
|
||||
if ext is None:
|
||||
ext = 'txt'
|
||||
if not ext in found_types:
|
||||
raise Http404('dont have the file for that extension')
|
||||
|
@ -1227,7 +1227,7 @@ def document_bibtex(request, name, rev=None):
|
|||
raise Http404()
|
||||
|
||||
# Make sure URL_REGEXPS did not grab too much for the rev number
|
||||
if rev != None and len(rev) != 2:
|
||||
if rev is not None and len(rev) != 2:
|
||||
mo = re.search(r"^(?P<m>[0-9]{1,2})-(?P<n>[0-9]{2})$", rev)
|
||||
if mo:
|
||||
name = name+"-"+mo.group(1)
|
||||
|
@ -1250,7 +1250,7 @@ def document_bibtex(request, name, rev=None):
|
|||
replaced_by = [d.name for d in doc.related_that("replaces")]
|
||||
draft_became_rfc = doc.became_rfc()
|
||||
|
||||
if rev != None and rev != doc.rev:
|
||||
if rev is not None and rev != doc.rev:
|
||||
# find the entry in the history
|
||||
for h in doc.history_set.order_by("-time"):
|
||||
if rev == h.rev:
|
||||
|
@ -1291,7 +1291,7 @@ def document_bibxml(request, name, rev=None):
|
|||
raise Http404()
|
||||
|
||||
# Make sure URL_REGEXPS did not grab too much for the rev number
|
||||
if rev != None and len(rev) != 2:
|
||||
if rev is not None and len(rev) != 2:
|
||||
mo = re.search(r"^(?P<m>[0-9]{1,2})-(?P<n>[0-9]{2})$", rev)
|
||||
if mo:
|
||||
name = name+"-"+mo.group(1)
|
||||
|
@ -1439,7 +1439,7 @@ def document_referenced_by(request, name):
|
|||
if doc.type_id in ["bcp","std","fyi"]:
|
||||
for rfc in doc.contains():
|
||||
refs |= rfc.referenced_by()
|
||||
full = ( request.GET.get('full') != None )
|
||||
full = ( request.GET.get('full') is not None )
|
||||
numdocs = refs.count()
|
||||
if not full and numdocs>250:
|
||||
refs=refs[:250]
|
||||
|
@ -1459,7 +1459,7 @@ def document_ballot_content(request, doc, ballot_id, editable=True):
|
|||
augment_events_with_revision(doc, all_ballots)
|
||||
|
||||
ballot = None
|
||||
if ballot_id != None:
|
||||
if ballot_id is not None:
|
||||
ballot_id = int(ballot_id)
|
||||
for b in all_ballots:
|
||||
if b.id == ballot_id:
|
||||
|
@ -1661,7 +1661,7 @@ def add_comment(request, name):
|
|||
|
||||
login = request.user.person
|
||||
|
||||
if doc.type_id == "draft" and doc.group != None:
|
||||
if doc.type_id == "draft" and doc.group is not None:
|
||||
can_add_comment = bool(has_role(request.user, ("Area Director", "Secretariat", "IRTF Chair", "IANA", "RFC Editor")) or (
|
||||
request.user.is_authenticated and
|
||||
Role.objects.filter(name__in=("chair", "secr"),
|
||||
|
|
|
@ -383,7 +383,22 @@ class Meeting(models.Model):
|
|||
return Meeting.objects.filter(type_id=self.type_id,date__lt=self.date).order_by('-date').first()
|
||||
|
||||
def uses_notes(self):
|
||||
return self.date>=datetime.date(2020,7,6)
|
||||
if self.type_id != 'ietf':
|
||||
return True
|
||||
num = self.get_number()
|
||||
return num is not None and num >= 108
|
||||
|
||||
def has_recordings(self):
|
||||
if self.type_id != 'ietf':
|
||||
return True
|
||||
num = self.get_number()
|
||||
return num is not None and num >= 80
|
||||
|
||||
def has_chat_logs(self):
|
||||
if self.type_id != 'ietf':
|
||||
return True;
|
||||
num = self.get_number()
|
||||
return num is not None and num >= 60
|
||||
|
||||
def meeting_start(self):
|
||||
"""Meeting-local midnight at the start of the meeting date"""
|
||||
|
|
|
@ -259,7 +259,7 @@ class MeetingTests(BaseMeetingTestCase):
|
|||
},
|
||||
"categories": rjson.get("categories"), # Just expect the value to exist
|
||||
"isCurrentMeeting": True,
|
||||
"useNotes": True,
|
||||
"usesNotes": False, # make_meeting_test_data sets number=72
|
||||
"schedule": rjson.get("schedule"), # Just expect the value to exist
|
||||
"floors": []
|
||||
}
|
||||
|
|
|
@ -1617,7 +1617,6 @@ def agenda_plain(request, num=None, name=None, base=None, ext=None, owner=None,
|
|||
"now": timezone.now().astimezone(meeting.tz()),
|
||||
"display_timezone": display_timezone,
|
||||
"is_current_meeting": is_current_meeting,
|
||||
"use_notes": meeting.uses_notes(),
|
||||
"cache_time": 150 if is_current_meeting else 3600,
|
||||
},
|
||||
content_type=mimetype[ext],
|
||||
|
@ -1692,7 +1691,7 @@ def api_get_agenda_data (request, num=None):
|
|||
},
|
||||
"categories": filter_organizer.get_filter_categories(),
|
||||
"isCurrentMeeting": is_current_meeting,
|
||||
"useNotes": meeting.uses_notes(),
|
||||
"usesNotes": meeting.uses_notes(),
|
||||
"schedule": list(map(agenda_extract_schedule, filtered_assignments)),
|
||||
"floors": list(map(agenda_extract_floorplan, floors))
|
||||
})
|
||||
|
@ -2489,7 +2488,6 @@ def session_details(request, num, acronym):
|
|||
'can_manage_materials' : can_manage,
|
||||
'can_view_request': can_view_request,
|
||||
'thisweek': datetime_today()-datetime.timedelta(days=7),
|
||||
'use_notes': meeting.uses_notes(),
|
||||
})
|
||||
|
||||
class SessionDraftsForm(forms.Form):
|
||||
|
|
|
@ -78,9 +78,9 @@
|
|||
<div class="regular float-end">
|
||||
{# see note in the included templates re: show_agenda parameter and required JS import #}
|
||||
{% if s.meeting.type.slug == 'interim' %}
|
||||
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False session=s meeting=s.meeting use_notes=s.meeting.use_notes %}
|
||||
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False session=s meeting=s.meeting %}
|
||||
{% else %}
|
||||
{% 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 %}
|
||||
{% include "meeting/session_buttons_include.html" with show_agenda=False item=s.official_timeslotassignment session=s meeting=s.meeting %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
{# notes #}
|
||||
{% if use_notes %}
|
||||
{% if session.agenda.uses_notes %}
|
||||
<a class="btn btn-outline-primary"
|
||||
href="{{ session.notes_url }}"
|
||||
aria-label="Notepad for note-takers"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
{# Notes #}
|
||||
{% if use_notes %}
|
||||
{% if meeting.uses_notes %}
|
||||
<a class="btn btn-outline-primary"
|
||||
role="button"
|
||||
href="{{ session.notes_url }}"
|
||||
|
@ -126,7 +126,7 @@
|
|||
</a>
|
||||
{% else %}
|
||||
{# chat logs #}
|
||||
{% if meeting.number|add:"0" >= 60 %}
|
||||
{% if meeting.has_chat_logs %}
|
||||
<a class="btn btn-outline-primary"
|
||||
role="button"
|
||||
href="{{session.chat_archive_url}}"
|
||||
|
@ -136,7 +136,7 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
{# Recordings #}
|
||||
{% if meeting.number|add:"0" >= 80 %}
|
||||
{% if meeting.has_recordings %}
|
||||
{% with session.recordings as recordings %}
|
||||
{% if recordings %}
|
||||
{# There's no guaranteed order, so this is a bit messy: #}
|
||||
|
@ -229,7 +229,7 @@
|
|||
</li>
|
||||
{% endif %}
|
||||
{# Notes #}
|
||||
{% if use_notes %}
|
||||
{% if meeting.uses_notes %}
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ session.notes_url }}">
|
||||
<i class="bi bi-journal-text"></i> Notepad for note-takers
|
||||
|
@ -303,7 +303,7 @@
|
|||
</li>
|
||||
{% else %}
|
||||
{# chat logs #}
|
||||
{% if meeting.number|add:"0" >= 60 %}
|
||||
{% if meeting.has_chat_logs %}
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="session.chat_room_url">
|
||||
|
@ -312,7 +312,7 @@
|
|||
</li>
|
||||
{% endif %}
|
||||
{# Recordings #}
|
||||
{% if meeting.number|add:"0" >= 80 %}
|
||||
{% if meeting.has_recordings %}
|
||||
{% with session.recordings as recordings %}
|
||||
{% if recordings %}
|
||||
{# There's no guaranteed order, so this is a bit messy: #}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% if meeting.type.slug == 'interim' %}
|
||||
{% include "meeting/interim_session_buttons.html" with show_agenda=False show_empty=False %}
|
||||
{% else %}
|
||||
{% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment use_notes=session.meeting.use_notes %}
|
||||
{% include "meeting/session_buttons_include.html" with show_agenda=False item=session.official_timeslotassignment %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -230,7 +230,7 @@
|
|||
<table class="table table-sm table-striped meeting-tools"
|
||||
id="meeting_tools_{{ session.pk }}">
|
||||
<tbody>
|
||||
{% if use_notes %}
|
||||
{% if meeting.uses_notes %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ session.notes_url }}">
|
||||
|
@ -310,7 +310,7 @@
|
|||
<table class="table table-sm table-striped meeting-tools"
|
||||
id="notes_and_recordings_{{ session.pk }}">
|
||||
<tbody>
|
||||
{% if use_notes %}
|
||||
{% if session.uses_notes %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ session.notes_url }}">
|
||||
|
@ -320,7 +320,7 @@
|
|||
</tr>
|
||||
{% endif %}
|
||||
{# Recordings #}
|
||||
{% if meeting.type.slug == 'interim' or meeting.number|add:"0" >= 80 %}
|
||||
{% if session.has_recordings %}
|
||||
{% with session.recordings as recordings %}
|
||||
{% if recordings %}
|
||||
{# There's no guaranteed order, so this is a bit messy: #}
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
<span class="badge rounded-pill text-bg-warning">Cancelled</span>
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="text-end">{% include "meeting/interim_session_buttons.html" with show_agenda=True use_notes=meeting.uses_notes %}</td>
|
||||
<td class="text-end">{% include "meeting/interim_session_buttons.html" with show_agenda=True %}</td>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
|
|
|
@ -630,7 +630,7 @@ module.exports = {
|
|||
},
|
||||
categories,
|
||||
isCurrentMeeting: dateMode !== 'past',
|
||||
useNotes: true,
|
||||
usesNotes: true,
|
||||
schedule,
|
||||
floors
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue