Show session details for interims as well as ietf meetings. Commit ready for merge.
- Legacy-Id: 10733
This commit is contained in:
parent
a0457c74f8
commit
2bae86397e
|
@ -106,15 +106,18 @@ def get_wg_list(assignments):
|
|||
return Group.objects.filter(acronym__in = set(wg_name_list)).order_by('parent__acronym','acronym')
|
||||
|
||||
|
||||
def get_meetings(num=None):
|
||||
def get_meetings(num=None,type_in=['ietf',]):
|
||||
meetings = Meeting.objects
|
||||
if type_in:
|
||||
meetings = meetings.filter(type__in=type_in)
|
||||
if num == None:
|
||||
meetings = Meeting.objects.filter(type="ietf").order_by("-date")
|
||||
meetings = meetings.order_by("-date")
|
||||
else:
|
||||
meetings = Meeting.objects.filter(type="ietf", number=num)
|
||||
meetings = meetings.filter(number=num)
|
||||
return meetings
|
||||
|
||||
def get_meeting(num=None):
|
||||
meetings = get_meetings(num)
|
||||
def get_meeting(num=None,type_in=['ietf',]):
|
||||
meetings = get_meetings(num,type_in)
|
||||
if meetings.exists():
|
||||
return meetings.first()
|
||||
else:
|
||||
|
|
|
@ -7,6 +7,7 @@ from ietf.meeting import views
|
|||
from ietf.meeting import ajax
|
||||
|
||||
safe_for_all_meeting_types = [
|
||||
url(r'^session/(?P<acronym>[A-Za-z0-9_\-\+]+)/$', views.session_details),
|
||||
]
|
||||
|
||||
type_ietf_only_patterns = [
|
||||
|
@ -37,7 +38,6 @@ type_ietf_only_patterns = [
|
|||
url(r'^sessions.json', ajax.sessions_json),
|
||||
url(r'^session/(?P<sessionid>\d+).json', ajax.session_json),
|
||||
url(r'^session/(?P<sessionid>\d+)/constraints.json', ajax.session_constraints),
|
||||
url(r'^session/(?P<acronym>[A-Za-z0-9_\-\+]+)/$', views.session_details),
|
||||
url(r'^constraint/(?P<constraintid>\d+).json', ajax.constraint_json),
|
||||
url(r'^json$', ajax.meeting_json),
|
||||
]
|
||||
|
@ -61,6 +61,7 @@ urlpatterns = [
|
|||
url(r'^(?P<meeting_num>\d+)/materials.html$', views.materials),
|
||||
url(r'^requests.html$', RedirectView.as_view(url='/meeting/requests', permanent=True)),
|
||||
url(r'^(?P<num>\d+)/requests.html$', RedirectView.as_view(url='/meeting/%(num)s/requests', permanent=True)),
|
||||
url(r'^(?P<num>[A-Za-z0-9._+-]+)/', include(safe_for_all_meeting_types)),
|
||||
# The optionals have to go first, otherwise the agenda/(owner)/(name)/ patterns match things they shouldn't
|
||||
url(r'^(?:(?P<num>\d+)/)?', include(type_ietf_only_patterns_id_optional)),
|
||||
url(r'^(?P<num>\d+)/', include(type_ietf_only_patterns)),
|
||||
|
|
|
@ -826,7 +826,7 @@ def meeting_requests(request, num=None):
|
|||
"groups_not_meeting": groups_not_meeting})
|
||||
|
||||
def session_details(request, num, acronym ):
|
||||
meeting = get_meeting(num)
|
||||
meeting = get_meeting(num=num,type_in=None)
|
||||
sessions = Session.objects.filter(meeting=meeting,group__acronym=acronym,type__in=['session','plenary','other'])
|
||||
|
||||
if not sessions:
|
||||
|
@ -847,7 +847,12 @@ def session_details(request, num, acronym ):
|
|||
for session in sessions:
|
||||
|
||||
ss = session.timeslotassignments.filter(schedule=meeting.agenda).order_by('timeslot__time')
|
||||
session.time = ', '.join(x.timeslot.time.strftime("%A %b-%d %H%M") for x in ss) if ss else 'Not yet scheduled'
|
||||
if ss:
|
||||
session.time = ', '.join(x.timeslot.time.strftime("%A %b-%d-%Y %H%M") for x in ss)
|
||||
elif session.meeting.type_id=='interim':
|
||||
session.time = session.meeting.date.strftime("%A %b-%d-%Y")
|
||||
else:
|
||||
session.time = 'Not yet scheduled'
|
||||
|
||||
# TODO FIXME Deleted materials shouldn't be in the sessionpresentation_set
|
||||
session.filtered_sessionpresentation_set = [p for p in session.sessionpresentation_set.all() if p.document.get_state_slug(p.document.type_id)!='deleted']
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</td>
|
||||
<td>{% if s.minutes %}<a href="{{ s.minutes.get_absolute_url }}">Minutes</a>{% endif %}</td>
|
||||
<td>{% if s.agenda %}<a href="{{ s.agenda.get_absolute_url }}">Agenda</a>{% endif %}</td>
|
||||
<td>{% if s.meeting.type.slug == 'ietf' %}<a href="{% url 'ietf.meeting.views.session_details' num=s.meeting.number acronym=s.group.acronym %}">Materials</a>{% endif %}</td>
|
||||
<td><a href="{% url 'ietf.meeting.views.session_details' num=s.meeting.number acronym=s.group.acronym %}">Materials</a></td>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue