Skip to content

Commit cabddc9

Browse files
committed
Merged [2990] from adam@nostrum.com:
In response to early feedback, changed 'close' metaphor from 'click anywhere' to 'click on the red "x" icon.' - Legacy-Id: 2993 Note: SVN reference [2990] has been migrated to Git commit 04289ed
1 parent 3edf194 commit cabddc9

5 files changed

Lines changed: 68 additions & 45 deletions

File tree

ietf/meeting/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from ietf.idrfc.idrfc_wrapper import IdWrapper
2626
from ietf.utils.pipe import pipe
2727

28-
from ietf.proceedings.models import Meeting, MeetingTime, WgMeetingSession, MeetingVenue, IESGHistory, Proceeding, Switches, WgProceedingsActivities
28+
from ietf.proceedings.models import Meeting, MeetingTime, WgMeetingSession, MeetingVenue, IESGHistory, Proceeding, Switches, WgProceedingsActivities, SessionConflict
2929

3030

3131
@decorator_from_middleware(GZipMiddleware)
@@ -104,7 +104,6 @@ def agenda_info(num=None):
104104
def html_agenda(request, num=None):
105105
timeslots, update, meeting, venue, ads, plenaryw_agenda, plenaryt_agenda = agenda_info(num)
106106

107-
108107
groups_meeting = [];
109108
for slot in timeslots:
110109
for session in slot.sessions():
@@ -321,12 +320,13 @@ def week_view(request, num=None):
321320
wgs = IETFWG.objects.filter(status=IETFWG.ACTIVE).order_by('group_acronym__acronym')
322321
rgs = IRTF.objects.all().order_by('acronym')
323322
areas = Area.objects.filter(status=Area.ACTIVE).order_by('area_acronym__acronym')
323+
conflicts = SessionConflict.objects.filter(meeting_num=meeting.meeting_num)
324324
template = "meeting/week-view.html"
325325
return render_to_response(template,
326326
{"timeslots":timeslots, "update":update, "meeting":meeting,
327327
"venue":venue, "ads":ads, "plenaryw_agenda":plenaryw_agenda,
328328
"plenaryt_agenda":plenaryt_agenda, "wg_list" : wgs,
329-
"rg_list" : rgs, "area_list" : areas},
329+
"rg_list" : rgs, "area_list" : areas, "conflicts":conflicts},
330330
context_instance=RequestContext(request))
331331

332332
def ical_agenda(request, num=None):

ietf/proceedings/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ class SessionConflict(models.Model):
209209
conflict_gid = models.ForeignKey(Acronym, related_name='conflicts_with_set', db_column='conflict_gid')
210210
meeting_num = models.ForeignKey(Meeting, db_column='meeting_num')
211211
def __str__(self):
212-
return "At IETF %s, %s conflicts with %s" % ( self.meeting_num_id, self.group_acronym.acronym, self.conflict_gid.acronym)
212+
try:
213+
return "At IETF %s, %s conflicts with %s" % ( self.meeting_num_id, self.group_acronym.acronym, self.conflict_gid.acronym)
214+
except BaseException:
215+
return "At IETF %s, something conflicts with something" % ( self.meeting_num_id )
216+
213217
class Meta:
214218
db_table = 'session_conflicts'
215219

ietf/templates/meeting/week-view.html

Lines changed: 60 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{# Copyright The IETF Trust 2007, All Rights Reserved #}
22
{% load humanize %}
33

4+
45
<html> <head>
56
<script type="text/javascript" src='/js/agenda2.js'></script>
67
<script type="text/javascript">
@@ -10,6 +11,7 @@
1011
items.push({day:{{slot.day_id}}, time:"{{slot.time_desc}}", time_id:{{slot.time_id}}, name:"{{session.acronym_name}}", wg:"{{session.acronym}}", area:"{{session.area}}", room:"{{session.room_id.room_name}}", dayname:"{{ slot.meeting_date|date:"l"|upper }}, {{ slot.meeting_date|date:"F j, Y" }}"{% if session.agenda_file %}, agenda:"/meeting/{{session.agenda_file}}"{% endif %}});{% endfor %}{% endfor %}
1112
{% endautoescape %}
1213

14+
1315
var fg = {
1416
'app': "#008",
1517
'gen': "#080",
@@ -195,7 +197,7 @@
195197
//-----------------------------------------------------------------
196198
var resize_func = function(div,t,l,w,h,to_fit)
197199
{ return function(){resize(div,t,l,w,h,to_fit);} }
198-
var click_func = function (e) { return function(){handle_click(e);}}
200+
var maximize_func = function (e) { return function(){maximize(e);}}
199201

200202
for (i = 0; i < items.length; i++)
201203
{
@@ -256,7 +258,7 @@
256258

257259
if (items[i].agenda)
258260
{
259-
e.onclick=click_func(e);
261+
e.onclick=maximize_func(e);
260262
e.style.cursor="pointer";
261263
}
262264

@@ -374,7 +376,21 @@
374376
return;
375377
}
376378

377-
var child = e.firstChild;
379+
e.insertBefore(document.createElement("br"),e.firstChild);
380+
381+
var minimize_func = function (e) { return function(){minimize(e);} }
382+
var img = document.createElement("img");
383+
img.src = "/images/close.png";
384+
img.style.cssFloat="right";
385+
img.onclick = minimize_func(e);
386+
img.style.cursor="pointer";
387+
e.insertBefore(img,e.firstChild);
388+
389+
var h = document.createElement("span");
390+
h.appendChild(document.createTextNode(items[e.id].dayname));
391+
h.style.fontWeight="bold";
392+
e.insertBefore(h,e.firstChild);
393+
e.style.fontSize="10pt";
378394

379395
var tmp = e.style.height;
380396
e.style.removeProperty("height");
@@ -401,52 +417,55 @@
401417
e.appendChild(frame);
402418
}
403419

404-
function handle_click(e)
420+
function finish_minimize(e)
421+
{
422+
e.onmouseover = e.oldmouseover;
423+
e.onmouseout = e.oldmouseout;
424+
e.oldmouseover = undefined;
425+
e.oldmouseout = undefined;
426+
e.style.cursor="pointer";
427+
}
428+
429+
function maximize(e)
405430
{
406431
if (e.onmouseover)
407432
{
408-
e.oldmouseover = e.onmouseover;
409-
e.oldmouseout = e.onmouseout;
410-
e.onmouseover = undefined;
411-
e.onmouseout = undefined;
412-
413-
var callback_func = function (e) { return function(){finish_maximize(e);}}
414-
e.callback = callback_func(e);
415-
416-
resize(e,0,0,
417-
document.body.clientWidth-2*(padding + border),
418-
document.body.clientHeight-2*(padding + border));
419-
420-
421-
e.insertBefore(document.createElement("br"),e.firstChild);
422-
423-
var h = document.createElement("span");
424-
h.appendChild(document.createTextNode(items[e.id].dayname));
425-
h.style.fontWeight="bold";
426-
e.insertBefore(h,e.firstChild);
427-
e.style.fontSize="10pt";
428-
}
429-
else
430-
{
431-
var agenda = document.getElementById("agenda");
432-
if (agenda)
433-
{
434-
e.removeChild(agenda);
435-
}
436-
e.onmouseover = e.oldmouseover;
437-
e.onmouseout = e.oldmouseout;
438-
e.oldmouseover = undefined;
439-
e.oldmouseout = undefined;
440-
e.onmouseout();
441-
442-
e.removeChild(e.firstChild);
443-
e.removeChild(e.firstChild);
444-
e.style.fontSize="8pt";
433+
e.oldmouseover = e.onmouseover;
434+
e.oldmouseout = e.onmouseout;
435+
e.onmouseover = undefined;
436+
e.onmouseout = undefined;
437+
e.style.cursor="auto";
438+
439+
var callback_func = function (e) { return function(){finish_maximize(e);}}
440+
e.callback = callback_func(e);
441+
442+
resize(e,0,0,
443+
document.body.clientWidth-2*(padding + border),
444+
document.body.clientHeight-2*(padding + border));
445445
}
446446
}
447447

448+
function minimize(e)
449+
{
450+
var agenda = document.getElementById("agenda");
451+
if (agenda)
452+
{
453+
e.removeChild(agenda);
454+
}
455+
456+
var callback_func = function (e) { return function(){finish_minimize(e);}}
457+
e.callback = callback_func(e);
458+
e.oldmouseout();
459+
460+
e.removeChild(e.firstChild);
461+
e.removeChild(e.firstChild);
462+
e.removeChild(e.firstChild);
463+
e.style.fontSize="8pt";
464+
}
465+
448466
function wavg(x1,x2,percent)
449467
{
468+
if (percent == 100) { return x2; }
450469
var res = x2 * (percent / 100) + x1 * ((100 - percent) / 100);
451470
return res;
452471
}

static/images/close.png

6.4 KB
Loading

static/images/warning.png

6.31 KB
Loading

0 commit comments

Comments
 (0)