Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show recordings for interims #7197

Merged
merged 8 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/agenda/AgendaScheduleList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ const meetingEvents = computed(() => {
color: 'red'
})
}
if (agendaStore.useNotes) {
if (agendaStore.uses_notes) {
rjsparks marked this conversation as resolved.
Show resolved Hide resolved
links.push({
id: `lnk-${item.id}-note`,
label: 'Notepad for note-takers',
Expand Down
4 changes: 2 additions & 2 deletions client/agenda/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const useAgendaStore = defineStore('agenda', {
selectedCatSubs: [],
settingsShown: false,
timezone: DateTime.local().zoneName,
useNotes: false,
rjsparks marked this conversation as resolved.
Show resolved Hide resolved
uses_notes: false,
visibleDays: []
}),
getters: {
Expand Down Expand Up @@ -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.uses_notes = agendaData.uses_notes

// -> Compute current info note hash
this.infoNoteHash = murmur(agendaData.meeting.infoNote, 0).toString()
Expand Down
15 changes: 14 additions & 1 deletion ietf/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,20 @@ def previous_meeting(self):
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 != None and num >= 108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally preferable to write the first test as num is not None


def has_recordings(self):
if self.type_id != 'ietf':
return True
num = self.get_number()
return num != None and num >= 80

def has_chat_logs(self):
num = self.get_number()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For symmetry with the other has_* methods, I think it'd be good to make clear how this behaves with non-"ietf" meetings

return num != None and num >= 60

def meeting_start(self):
"""Meeting-local midnight at the start of the meeting date"""
Expand Down
4 changes: 2 additions & 2 deletions ietf/meeting/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ def test_meeting_agenda(self):
"updated": rjson.get("meeting").get("updated"), # Just expect the value to exist
"timezone": meeting.time_zone,
"infoNote": meeting.agenda_info_note,
"warningNote": meeting.agenda_warning_note
"warningNote": meeting.agenda_warning_note,
"uses_notes": False
},
"categories": rjson.get("categories"), # Just expect the value to exist
"isCurrentMeeting": True,
"useNotes": True,
"schedule": rjson.get("schedule"), # Just expect the value to exist
"floors": []
}
Expand Down
4 changes: 1 addition & 3 deletions ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,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],
Expand Down Expand Up @@ -1691,7 +1690,7 @@ def api_get_agenda_data (request, num=None):
},
"categories": filter_organizer.get_filter_categories(),
"isCurrentMeeting": is_current_meeting,
"useNotes": meeting.uses_notes(),
"uses_notes": meeting.uses_notes(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also stay as a camelCase key (usesNotes) to match the rest of the structure

"schedule": list(map(agenda_extract_schedule, filtered_assignments)),
"floors": list(map(agenda_extract_floorplan, floors))
})
Expand Down Expand Up @@ -2498,7 +2497,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):
Expand Down
4 changes: 2 additions & 2 deletions ietf/templates/group/meetings-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/meeting/interim_session_buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions ietf/templates/meeting/session_buttons_include.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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}}"
Expand All @@ -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: #}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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">
Expand All @@ -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: #}
Expand Down
8 changes: 4 additions & 4 deletions ietf/templates/meeting/session_details_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down Expand Up @@ -230,7 +230,7 @@ <h3 class="mt-4">Meeting tools</h3>
<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 }}">
Expand Down Expand Up @@ -310,7 +310,7 @@ <h3 class="mt-4">Notes and recordings</h3>
<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 }}">
Expand All @@ -320,7 +320,7 @@ <h3 class="mt-4">Notes and recordings</h3>
</tr>
{% endif %}
{# Recordings #}
{% if 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: #}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/meeting/upcoming.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h1>Upcoming Meetings</h1>
<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 %}
Expand Down
2 changes: 1 addition & 1 deletion playwright/helpers/meeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ module.exports = {
},
categories,
isCurrentMeeting: dateMode !== 'past',
useNotes: true,
uses_notes: true,
schedule,
floors
}
Expand Down
Loading