4747from ietf .meeting .helpers import get_modified_from_assignments
4848from ietf .meeting .helpers import get_wg_list , find_ads_for_meeting
4949from ietf .meeting .helpers import get_meeting , get_schedule , agenda_permissions , get_meetings
50- from ietf .meeting .helpers import preprocess_assignments_for_agenda , read_agenda_file
50+ from ietf .meeting .helpers import preprocess_assignments_for_agenda , read_agenda_file , read_session_file
5151from ietf .meeting .helpers import convert_draft_to_pdf , get_earliest_session_date
5252from ietf .meeting .helpers import can_view_interim_request , can_approve_interim_request
5353from ietf .meeting .helpers import can_edit_interim_request
@@ -612,25 +612,25 @@ def agenda_by_type_ics(request,num=None,type=None):
612612 updated = meeting .updated ()
613613 return render (request ,"meeting/agenda.ics" ,{"schedule" :schedule ,"updated" :updated ,"assignments" :assignments },content_type = "text/calendar" )
614614
615- def session_agenda (request , num , session ):
616- d = Document .objects .filter (type = "agenda" , session__meeting__number = num )
617- if session == "plenaryt" :
615+ def session_document (request , num , acronym , type = "agenda" ):
616+ d = Document .objects .filter (type = type , session__meeting__number = num )
617+ if acronym == "plenaryt" :
618618 d = d .filter (session__name__icontains = "technical" , session__slots__type = "plenary" )
619- elif session == "plenaryw" :
619+ elif acronym == "plenaryw" :
620620 d = d .filter (session__name__icontains = "admin" , session__slots__type = "plenary" )
621621 else :
622- d = d .filter (session__group__acronym = session )
622+ d = d .filter (session__group__acronym = acronym )
623623
624624 if d :
625- agenda = d [0 ]
625+ doc = d [0 ]
626626 html5_preamble = "<!doctype html><html lang=en><head><meta charset=utf-8><title>%s</title></head><body>"
627627 html5_postamble = "</body></html>"
628- content , path = read_agenda_file ( num , agenda )
628+ content , path = read_session_file ( type , num , doc )
629629 _ , ext = os .path .splitext (path )
630630 ext = ext .lstrip ("." ).lower ()
631631
632632 if not content :
633- content = "Could not read agenda file '%s'" % path
633+ content = "Could not read %s file '%s'" % ( type , path )
634634 return HttpResponse (content , content_type = "text/plain; charset=%s" % settings .DEFAULT_CHARSET )
635635
636636 if ext == "txt" :
@@ -641,23 +641,29 @@ def session_agenda(request, num, session):
641641 content = re .sub ("(\r \n |\r )" , "\n " , content )
642642 d = PyQuery (content )
643643 d ("head title" ).empty ()
644- d ("head title" ).append (str (agenda ))
644+ d ("head title" ).append (str (doc ))
645645 d ('meta[http-equiv]' ).remove ()
646646 content = "<!doctype html>" + d .html ()
647647 else :
648- content = "<p>Unrecognized agend file '%s'</p>" % agenda .external_url
649- content = (html5_preamble % agenda ) + content + html5_postamble
648+ content = "<p>Unrecognized %s file '%s'</p>" % ( type , doc .external_url )
649+ content = (html5_preamble % doc ) + content + html5_postamble
650650
651651 return HttpResponse (content )
652652
653- raise Http404 ("No agenda for the %s session of IETF %s is available" % (session , num ))
653+ raise Http404 ("No %s for the %s session of IETF %s is available" % (type , acronym , num ))
654+
655+ def session_agenda (request , num , session ):
656+ return session_document (request , num , acronym = session , type = 'agenda' )
657+
658+ def session_minutes (request , num , session ):
659+ return session_document (request , num , acronym = session , type = 'minutes' )
654660
655661def session_draft_list (num , session ):
656662 try :
657- agendas = Document .objects .filter (type = "agenda" ,
663+ agendas = Document .objects .filter (type = type ,
658664 session__meeting__number = num ,
659665 session__group__acronym = session ,
660- states = State .objects .get (type = "agenda" , slug = "active" )).distinct ()
666+ states = State .objects .get (type = type , slug = "active" )).distinct ()
661667 except Document .DoesNotExist :
662668 raise Http404
663669
0 commit comments