Skip to content

Commit 4fd27d1

Browse files
committed
IETF 78 code from Adam Roach: Make the selectable WG agenda feature of the datatracker IETF Agenda less resource intensive by only loading WG agendas when we know they are used in the page.
- Legacy-Id: 2444
1 parent 8f3dbc1 commit 4fd27d1

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

ietf/meeting/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def html_agenda(request, num=None):
9898
timeslots, update, meeting, venue, ads, plenaryw_agenda, plenaryt_agenda = agenda_info(num)
9999
wgs = IETFWG.objects.filter(status=IETFWG.ACTIVE).order_by('group_acronym__acronym')
100100
rgs = IRTF.objects.all().order_by('acronym')
101-
areas = Area.objects.filter(status=Area.ACTIVE).order_by('area_acronym')
101+
areas = Area.objects.filter(status=Area.ACTIVE).order_by('area_acronym__acronym')
102102

103103
if settings.SERVER_MODE != 'production' and '_testiphone' in request.REQUEST:
104104
user_agent = "iPhone"

ietf/templates/meeting/agenda.html

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@
101101
if (re.test(rows[i].id) || (hidenone && rows[i].className == 'grouprow'))
102102
{
103103
rows[i].style.display="table-row";
104+
if (rows[i].className == 'groupagenda')
105+
{
106+
var iframe = rows[i].firstElementChild.nextElementSibling.firstElementChild;
107+
iframe.setAttribute("src",iframe.getAttribute("xsrc"));
108+
r(iframe);
109+
}
104110
}
105111
else
106112
{
@@ -115,13 +121,12 @@
115121
/* Resizes an IFRAME to fit its contents */
116122
function r(obj)
117123
{
118-
/* This can't work until we move the agendas into the datatracker.ietf.org
119-
domain -- we can't query the height of a document from another domain. */
120-
121-
/*
122-
docHeight = obj.contentWindow.document.height;
123-
obj.style.height = (docHeight + 20) * 1.05 + "px"
124-
*/
124+
try
125+
{
126+
docHeight = obj.contentWindow.document.height;
127+
obj.style.height = (docHeight + 20) * 1.05 + "px"
128+
}
129+
catch (e) {}
125130
}
126131

127132
function toggle(selection)
@@ -197,6 +202,7 @@ <h1>IETF {{ meeting.num }} Meeting Agenda</h1>
197202
{% for area in area_list %}
198203
<th><div id='selector-{{area.area_acronym|upper}}' class="unselected" onclick="toggle(this)">{{area.area_acronym|upper}}</div></th>
199204
{% endfor %}
205+
<th><div id='selector-IRTF' class="unselected" onclick="toggle(this)">IRTF</div></th>
200206
</tr>
201207

202208
<tr>
@@ -209,6 +215,13 @@ <h1>IETF {{ meeting.num }} Meeting Agenda</h1>
209215
{% endfor %}
210216
</td>
211217
{% endfor %}
218+
219+
<td valign="top" id="IRTF-groups">
220+
{% for rg in rg_list %}
221+
<div id='selector-{{rg|lower}}' class="unselected" onclick="toggle(this)">{{rg|lower}}</div>
222+
{% endfor %}
223+
</td>
224+
212225
</tr>
213226
</table>
214227

@@ -271,7 +284,7 @@ <h2 class="ietf-divider">{{ slot.meeting_date|date:"l"|upper }}, {{ slot.meeting
271284
<td></td>
272285
<td colspan="3">
273286
{% if session.info.agenda_file %}
274-
<iframe width="100%" height="400px" src="http://www.ietf.org/proceedings/{{ session.info.agenda_file }}" onload="r(this)"></iframe>
287+
<iframe width="100%" height="400px" src="about:blank" xsrc="/meeting/{{ session.info.agenda_file }}" onload="r(this)"></iframe>
275288
{% else %}
276289
<b>No Agenda Submitted</b>
277290
{% endif %}

0 commit comments

Comments
 (0)