Skip to content

Commit ca1ff2f

Browse files
committed
Implementation of ticket 893
- Legacy-Id: 5003
1 parent 15ff245 commit ca1ff2f

3 files changed

Lines changed: 126 additions & 25 deletions

File tree

ietf/meeting/views.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from django.db.models import Max
2222

2323
import debug
24+
import urllib
2425

2526
from ietf.idtracker.models import InternetDraft
2627
from ietf.utils.pipe import pipe
@@ -425,24 +426,35 @@ def ical_agenda(request, num=None):
425426
meeting = get_meeting(num)
426427

427428
q = request.META.get('QUERY_STRING','') or ""
428-
filter = q.lower().replace('%2c',',').split(',');
429+
filter = urllib.unquote(q).lower().split(',');
429430
include = set(filter)
430-
include_types = ["Plenary","Other"]
431+
include_types = set(["Plenary","Other"])
431432
exclude = []
432433

433434
# Process the special flags.
435+
# "-wgname" will remove a working group from the output.
436+
# "~Type" will add that type to the output.
437+
# "-~Type" will remove that type from the output
438+
# Current types are:
439+
# Session, Other (default on), Break, Plenary (default on)
440+
# Non-Working Group "wg names" include:
441+
# edu, ietf, tools, iesg, iab
442+
434443
for item in include:
435444
if item:
436-
if item[0] == '-':
445+
if item[0] == '-' and item[1] == '~':
446+
include_types -= set([item[2:3].upper()+item[3:]])
447+
elif item[0] == '-':
437448
exclude.append(item[1:])
438-
if item[0] == '~':
439-
include_types.append(item[1:2].upper()+item[2:])
449+
elif item[0] == '~':
450+
include_types |= set([item[1:2].upper()+item[2:]])
440451

441452
timeslots = TimeSlot.objects.filter(Q(meeting__id = meeting.id),
442453
Q(type__name__in = include_types) |
443454
Q(session__group__acronym__in = filter) |
444455
Q(session__group__parent__acronym__in = filter)
445-
)#.exclude(Q(session__group__isnull = False),
456+
).exclude(Q(session__group__acronym__in = exclude))
457+
#.exclude(Q(session__group__isnull = False),
446458
#Q(session__group__acronym__in = exclude) |
447459
#Q(session__group__parent__acronym__in = exclude))
448460

ietf/templates/meeting/agenda.html

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#wg-selector-triangle-right { vertical-align: text-top; }
2020
#wg-selector-triangle-down { vertical-align: text-top; }
2121

22+
table#ics-preconfig { border:1px solid black; border-collapse:collapse; margin-top:24px; margin-bottom:24px;}
23+
2224
#weekview.hidden { display: none; }
2325
#weekview { border: none; margin: 0 0 0 0;}
2426
#ical-link.hidden { display: none; }
@@ -88,6 +90,7 @@
8890
var ical_link = document.getElementById('ical-link');
8991
var ical_href = document.getElementById('ical-href');
9092

93+
9194
lastfrag = frag;
9295

9396
var fragment = frag.split(',');
@@ -163,7 +166,14 @@
163166
}
164167
}
165168

166-
169+
// Handle special cases (checkboxes)
170+
var special = ['edu','ietf','tools','iesg','iab'];
171+
var re3 = RegExp("^(" + fragment.join('|') + ")$");
172+
for (i in special)
173+
{
174+
var include = document.getElementById("include-"+special[i]);
175+
include.checked = ! re3.test("\-"+special[i]);
176+
}
167177
}
168178

169179
/* Resizes an IFRAME to fit its contents. */
@@ -203,33 +213,55 @@
203213
}
204214
}
205215

216+
function add_hash_item(item)
217+
{
218+
if (window.location.hash.replace("#","").length == 0)
219+
{
220+
window.location.hash = item;
221+
}
222+
else
223+
{
224+
window.location.hash += "," + item;
225+
}
226+
window.location.hash = window.location.hash.replace(/^#?,/,'');
227+
}
228+
229+
function remove_hash_item(item)
230+
{
231+
var re = new RegExp('(^|#|,)' + item + "(,|$)");
232+
window.location.hash = window.location.hash.replace(re,"$2")
233+
window.location.hash = window.location.hash.replace(/^#?,/,'');
234+
}
235+
206236
function toggle(selection)
207237
{
208238
var active = selection.className;
209239
var wg = selection.textContent?selection.textContent:selection.text;
210240

211241
if (active == "selected")
212242
{
213-
var re = new RegExp('(^|#|,)' + wg + "(,|$)");
214-
window.location.hash = window.location.hash.replace(re,"$2")
215-
243+
remove_hash_item(wg);
216244
}
217245
else
218246
{
219-
if (window.location.hash.replace("#","").length == 0)
220-
{
221-
window.location.hash = wg;
222-
}
223-
else
224-
{
225-
window.location.hash += "," + wg;
226-
}
227-
247+
add_hash_item(wg);
228248
}
229-
window.location.hash = window.location.hash.replace(/^#?,/,'');
230249
setGroupState();
231250
}
232251

252+
function toggle_special(checkbox)
253+
{
254+
var special = checkbox.id.replace('include-','');
255+
if (checkbox.checked)
256+
{
257+
remove_hash_item("-"+special);
258+
}
259+
else
260+
{
261+
add_hash_item("-"+special);
262+
}
263+
}
264+
233265
function toggle_wg_selector ()
234266
{
235267
var wg_selector = document.getElementById('wg-selector');
@@ -247,6 +279,7 @@
247279
triangle_right.className = '';
248280
triangle_down.className = 'hidden';
249281
}
282+
setGroupState();
250283
}
251284
</script>
252285

@@ -285,13 +318,31 @@ <h1>IETF {{ meeting.number }} Meeting Agenda</h1>
285318
<div id='selector-{{wg.acronym}}' class="unselected" onclick="toggle(this)">{% if wg.state.name = "BOF" %}<i>{{wg.acronym}}</i>{% else %}{{wg.acronym}}{% endif %}</div>{% endfor %}
286319
</td>
287320
</tr>
288-
<tr><td align="center" colspan="{{area_list.count}}"><i>Groups displayed in italics are BOFs</i></td></tr>
321+
<tr><td align="center" colspan="{{area_list.count}}">
322+
Also show:
323+
<input type="checkbox" class="include-checkbox" id="include-edu" onchange="toggle_special(this)"/>EDU &#8226;
324+
<input type="checkbox" class="include-checkbox" id="include-ietf" onchange="toggle_special(this)"/>IETF &#8226;
325+
<input type="checkbox" class="include-checkbox" id="include-tools" onchange="toggle_special(this)"/>Tools &#8226;
326+
<input type="checkbox" class="include-checkbox" id="include-iesg" onchange="toggle_special(this)"/>IESG &#8226;
327+
<input type="checkbox" class="include-checkbox" id="include-iab" onchange="toggle_special(this)"/>IAB
328+
<!-- </td></tr>
329+
<tr><td align="center" colspan="{{area_list.count}}">
330+
-->
331+
<br/><i>Groups displayed in italics are BOFs</i></td></tr>
289332
</table>
290333

291-
<div id="ical-link" class="hidden"><span style="font-size:150%">Week View</span><br/><a id="ical-href" href="{% url ietf.meeting.views.ical_agenda num=meeting.number %}"><em>Download as an .ical file</em></a></div>
334+
<div id="ical-link" class="hidden"><span style="font-size:150%">Week View</span><br/><a id="ical-href" href="{% url ietf.meeting.views.ical_agenda num=meeting.number %}"><em>Download as an .ics file</em></a></div>
292335

293336
<iframe id="weekview" class="hidden" width="100%" height="600px" src="about:blank"></iframe>
294337

338+
<table width="100%" id="ics-preconfig"><tr><td align="center">
339+
Preconfigured .ics links:
340+
{% for area in area_list %}
341+
<a href="{% url ietf.meeting.views.ical_agenda num=meeting.number %}?{{area|upper}},-~Other,-~Plenary">{{area|upper}}</a> &#8226;
342+
{% endfor %}
343+
<a href="{% url ietf.meeting.views.ical_agenda num=meeting.number %}">Non-Area Events</a>
344+
</td></tr></table>
345+
295346
{% if meeting.agenda_note %}<h2 class="ietf-divider" style="background-color: #C00; margin-top: 2em; margin-bottom: 0;">{{ meeting.agenda_note|safe }}</h2>{% endif %}
296347

297348
<table id="agenda" width="100%">

ietf/templates/meeting/week-view.html

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% autoescape off %}
1010

1111
{% for slot in timeslots %} {% if slot.type.name in render_types %}
12-
items.push({day:{{slot.time|date:"w"}}, time:"{{slot.time|date:"Hi"}}-{{slot.end_time|date:"Hi"}}", duration:{{slot.duration.seconds}}, time_id:"{{slot.time|date:"mdHi"}}", type:"{{slot.type}}", {% if slot.session.name %}name:"{{slot.session.name}}",{% else %}{% if slot.type.name == "Break" %}name:"{{slot.name}}", area:"break", wg:"break",{% else %}name:"{{slot.session.group.name}}{%if slot.session.group.state.name = "BOF"%} BOF{%endif%}",wg:"{{slot.session.group.acronym}}",area:"{{slot.session.group.parent.acronym}}",{% endif %}{% endif %} {% if slot.show_location %}room:"{{slot.get_location}}",{% endif %} dayname:"{{ slot.time|date:"l"|upper }}, {{ slot.time|date:"F j, Y" }}"{% if slot.session.agenda %}, agenda:"http://www.ietf.org{{slot.session.agenda.get_absolute_url}}"{% endif %} });{% endif %}{% endfor %}
12+
items.push({key:"{{slot.pk}}",day:{{slot.time|date:"w"}}, time:"{{slot.time|date:"Hi"}}-{{slot.end_time|date:"Hi"}}", duration:{{slot.duration.seconds}}, time_id:"{{slot.time|date:"mdHi"}}", type:"{{slot.type}}", {% if slot.session.name %}name:"{{slot.session.name}}",{% if slot.session.group.acronym %} wg:"{{slot.session.group.acronym}}",{%endif%}{% else %}{% if slot.type.name == "Break" %}name:"{{slot.name}}", area:"break", wg:"break",{% else %}name:"{{slot.session.group.name}}{%if slot.session.group.state.name = "BOF"%} BOF{%endif%}",wg:"{{slot.session.group.acronym}}",state:"{{slot.session.group.state}}",area:"{{slot.session.group.parent.acronym}}",{% endif %}{% endif %} {% if slot.show_location %}room:"{{slot.get_location}}",{% endif %} dayname:"{{ slot.time|date:"l"|upper }}, {{ slot.time|date:"F j, Y" }}"{% if slot.session.agenda %}, agenda:"http://www.ietf.org{{slot.session.agenda.get_absolute_url}}"{% endif %} });{% endif %}{% endfor %}
1313
{% endautoescape %}
1414

1515
/* Saturday events need to be moved to the day -1 */
@@ -63,8 +63,40 @@
6363
var padding = 2;
6464
var border = 1;
6565

66+
var include = Array();
67+
6668
setInterval("animate()",50);
6769

70+
function is_visible(item)
71+
{
72+
// "-wgname" will remove a working group from the output.
73+
// "~Type" will add that type to the output.
74+
// "-~Type" will remove that type from the output
75+
// "@bof" will include all BOFs
76+
// Current types are:
77+
// Session, Other, Break, Plenary
78+
79+
if ("wg" in item)
80+
{
81+
if (include[(item.wg).toLowerCase()]) { return true; }
82+
if (include["-"+(item.wg).toLowerCase()]) { return false; }
83+
}
84+
if ("state" in item)
85+
{
86+
if (include["@"+(item.state).toLowerCase()]) { return true; }
87+
}
88+
if (include["~"+(item.type).toLowerCase()]) { return true; }
89+
if (include["-~"+(item.type).toLowerCase()]) { return false; }
90+
if ("area" in item)
91+
{
92+
if (include[(item.area).toLowerCase()]) { return true; }
93+
}
94+
if (item.type === "Plenary") { return true; }
95+
if (item.type === "Other") { return true; }
96+
97+
return false;
98+
}
99+
68100
function draw_calendar()
69101
{
70102
window.setTimeout("draw_calendar()",1000);
@@ -88,7 +120,7 @@
88120

89121
var day_start = 0;
90122
var day_end = 0;
91-
var include = Array();
123+
include = [];
92124

93125
var frag = window.location.hash.replace("#",'').split(',');
94126
for (i = 0; i < frag.length; i++)
@@ -99,8 +131,11 @@
99131
/* Find our boundaries */
100132
for (i = 0; i < items.length; i++)
101133
{
134+
if (is_visible(items[i]))
135+
/*
102136
if (!("wg" in items[i]) || (include[(items[i].wg).toLowerCase()]
103137
|| include[(items[i].area).toLowerCase()]))
138+
*/
104139
{
105140
var start_time = parseInt(items[i].time.substr(0,2),10) * 60 +
106141
parseInt(items[i].time.substr(2,2),10);
@@ -207,8 +242,11 @@
207242

208243
for (i = 0; i < items.length; i++)
209244
{
210-
if (!("wg" in items[i])|| (include[(items[i].wg).toLowerCase()]
245+
if (is_visible(items[i]))
246+
/*
247+
if (!("wg" in items[i]) || (include[(items[i].wg).toLowerCase()]
211248
|| include[(items[i].area).toLowerCase()]))
249+
*/
212250
{
213251
var start_time = parseInt(items[i].time.substr(0,2),10) * 60 +
214252
parseInt(items[i].time.substr(2,2),10);

0 commit comments

Comments
 (0)