From 35a94362a111ece5e54b591e3cd9c035bfbe1872 Mon Sep 17 00:00:00 2001
From: Ryan Cross
Date: Sat, 4 Jan 2014 00:38:44 +0000
Subject: [PATCH] changes to official proceedings generation code to support
new agenda schema - Legacy-Id: 7073
---
ietf/secr/proceedings/proc_utils.py | 20 ++++-----
ietf/secr/proceedings/views.py | 9 ++--
ietf/secr/templates/proceedings/agenda.html | 42 +++++++++----------
ietf/secr/templates/proceedings/overview.html | 4 +-
4 files changed, 38 insertions(+), 37 deletions(-)
diff --git a/ietf/secr/proceedings/proc_utils.py b/ietf/secr/proceedings/proc_utils.py
index cd47e52bc..4b24515a7 100644
--- a/ietf/secr/proceedings/proc_utils.py
+++ b/ietf/secr/proceedings/proc_utils.py
@@ -7,7 +7,8 @@ from django.conf import settings
from django.shortcuts import render_to_response
from ietf.group.models import Group, Role
from ietf.group.utils import get_charter_text
-from ietf.meeting.models import Session, TimeSlot, Meeting
+from ietf.meeting.helpers import get_schedule, meeting_updated
+from ietf.meeting.models import Session, TimeSlot, Meeting, ScheduledSession
from ietf.doc.models import Document, RelatedDocument, DocEvent
from itertools import chain
from ietf.secr.proceedings.models import Registration
@@ -248,9 +249,12 @@ def create_proceedings(meeting, group, is_final=False):
if not os.path.exists(target):
os.makedirs(target)
- shutil.copy(source,target)
+ try:
+ shutil.copy(source,target)
+ rfc.bytes = os.path.getsize(source)
+ except IOError:
+ pass
rfc.url = url_root + "rfc/%s" % filename
- rfc.bytes = os.path.getsize(source)
rfc.num = "RFC %s" % rfc_num
# check related documents
# check obsoletes
@@ -372,16 +376,12 @@ def gen_acknowledgement(context):
def gen_agenda(context):
meeting = context['meeting']
-
- timeslots = TimeSlot.objects.filter(meeting=meeting)
-
- # sort by area:group then time
- sort1 = sorted(timeslots, key = mycomp)
- sort2 = sorted(sort1, key = lambda a: a.time)
+ schedule = get_schedule(meeting)
+ scheduledsessions = ScheduledSession.objects.filter(schedule=schedule).exclude(session__isnull=True)
html = render_to_response('proceedings/agenda.html',{
'meeting': meeting,
- 'timeslots': sort2}
+ 'scheduledsessions': scheduledsessions}
)
path = os.path.join(settings.SECR_PROCEEDINGS_DIR,meeting.number,'agenda.html')
diff --git a/ietf/secr/proceedings/views.py b/ietf/secr/proceedings/views.py
index 3bb04c945..8f30f9b80 100644
--- a/ietf/secr/proceedings/views.py
+++ b/ietf/secr/proceedings/views.py
@@ -20,7 +20,7 @@ from ietf.secr.sreq.forms import GroupSelectForm
from ietf.secr.utils.decorators import check_permissions, sec_only
from ietf.secr.utils.document import get_rfc_num, get_full_path
from ietf.secr.utils.group import get_my_groups, groups_by_session
-from ietf.secr.utils.meeting import get_upload_root, get_proceedings_path, get_material
+from ietf.secr.utils.meeting import get_upload_root, get_proceedings_path, get_material, get_timeslot
from ietf.doc.models import Document, DocAlias, DocEvent, State, NewRevisionDocEvent, RelatedDocument
from ietf.group.models import Group
@@ -83,9 +83,9 @@ def get_extras(meeting):
Gather "extras" which are one off groups. ie iab-wcit(86)
'''
groups = []
- sessions = Session.objects.filter(meeting=meeting).exclude(group__parent__acronym__in=('app','gen','int','ops','rai','rtg','sec','tsv','irtf')).filter(timeslot__type='session')
+ sessions = Session.objects.filter(meeting=meeting).exclude(group__parent__acronym__in=('app','gen','int','ops','rai','rtg','sec','tsv','irtf'))
for session in sessions:
- if session.materials.all():
+ if get_timeslot(session).type.slug == 'session' and session.materials.all():
groups.append(session.group)
return groups
@@ -227,7 +227,8 @@ def ajax_generate_proceedings(request, meeting_num):
context = {'meeting':meeting,
'areas':areas,
'others':others,
- 'extras':extras}
+ 'extras':extras,
+ 'request':request}
proceedings_url = get_proceedings_url(meeting)
# the acknowledgement page can be edited manually so only produce if it doesn't already exist
diff --git a/ietf/secr/templates/proceedings/agenda.html b/ietf/secr/templates/proceedings/agenda.html
index c573f0ff2..1d9f48bbc 100644
--- a/ietf/secr/templates/proceedings/agenda.html
+++ b/ietf/secr/templates/proceedings/agenda.html
@@ -11,50 +11,50 @@
*** Click on a name of the group to get a meeting agenda ***
-{% for slot in timeslots %}
+{% for ss in scheduledsessions %}
{% ifchanged %}
- {{ slot.time|date:"l"|upper }}, {{ slot.time|date:"F j, Y" }}
+ {{ ss.timeslot.time|date:"l"|upper }}, {{ ss.timeslot.time|date:"F j, Y" }}
|
{% endifchanged %}
{% ifchanged %}
- {{slot.time|date:"Hi"}}-{{slot.end_time|date:"Hi"}}
+ {{ss.timeslot.time|date:"Hi"}}-{{ss.timeslot.end_time|date:"Hi"}}
|
- {{slot.name}}
- {% if slot.type.name != 'Session' %}
- {% if slot.show_location %} - {{slot.get_location|escape}}{% endif %}
+ {{ss.timeslot.name}}
+ {% if ss.timeslot.type.name != 'Session' %}
+ {% if ss.timeslot.show_location %} - {{ss.timeslot.get_location|escape}}{% endif %}
{% endif %}
|
{% endifchanged %}
- {% if slot.type.name = 'Session' %} {% if slot.session.group %}
-
- {% if slot.show_location %}{{slot.get_location|escape}}{% endif %} |
- {{slot.session.group.parent.acronym|upper}} |
+ {% if ss.timeslot.type.name = 'Session' %} {% if ss.session.group %}
+
+ {% if ss.timeslot.show_location %}{{ss.timeslot.get_location|escape}}{% endif %} |
+ {{ss.session.group.parent.acronym|upper}} |
- {% if slot.session.group.charter %}{{slot.session.group.acronym}}
- {% else %}{{slot.session.group.acronym}}{% endif %} |
+ {% if ss.session.group.charter %}{{ss.session.group.acronym}}
+ {% else %}{{ss.session.group.acronym}}{% endif %}
- {% if slot.session.agenda %}{{slot.session.group.name}}
- {% else %}{{slot.session.group.name}}{% endif %}
- {% if slot.session.group.state.name = "BOF" %} BOF {% endif %}
- {% if slot.session.agenda_note %}
- {{slot.session.agenda_note}}{% endif %} |
+ {% if ss.session.agenda %}{{ss.session.group.name}}
+ {% else %}{{ss.session.group.name}}{% endif %}
+ {% if ss.session.group.state.name = "BOF" %} BOF {% endif %}
+ {% if ss.session.agenda_note %}
+
{{ss.session.agenda_note}}{% endif %}
{% endif %} {% endif %}
- {% if slot.type.name = 'Plenary' %}
+ {% if ss.timeslot.type.name = 'Plenary' %}
- {% if slot.show_location %}{{slot.get_location|escape}}{% endif %} |
+ {% if ss.timeslot.show_location %}{{ss.timeslot.get_location|escape}}{% endif %} |
|
|
- {% if slot.session.agenda %}Agenda
- {% else %}{{slot.session.group.name}}{% endif %}
+ | {% if ss.session.agenda %}Agenda
+ {% else %}{{ss.session.group.name}}{% endif %}
|
{% endif %}
diff --git a/ietf/secr/templates/proceedings/overview.html b/ietf/secr/templates/proceedings/overview.html
index 11186ab2e..0a5bec291 100644
--- a/ietf/secr/templates/proceedings/overview.html
+++ b/ietf/secr/templates/proceedings/overview.html
@@ -96,11 +96,11 @@ Fremont, California.The IETF Executive Director is Alexa Morris
Project Manager |
- Wanda Lo |
+ Stephanie McCammon |
Meeting Registrar |
- Stephanie McCammon |
+ Maddy Conner |
Project Manager |