Skip to content

Commit

Permalink
Merged [2990] from [email protected]:
Browse files Browse the repository at this point in the history
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
  • Loading branch information
levkowetz committed Mar 28, 2011
1 parent 3edf194 commit cabddc9
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 45 deletions.
6 changes: 3 additions & 3 deletions ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ietf.idrfc.idrfc_wrapper import IdWrapper
from ietf.utils.pipe import pipe

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


@decorator_from_middleware(GZipMiddleware)
Expand Down Expand Up @@ -104,7 +104,6 @@ def agenda_info(num=None):
def html_agenda(request, num=None):
timeslots, update, meeting, venue, ads, plenaryw_agenda, plenaryt_agenda = agenda_info(num)


groups_meeting = [];
for slot in timeslots:
for session in slot.sessions():
Expand Down Expand Up @@ -321,12 +320,13 @@ def week_view(request, num=None):
wgs = IETFWG.objects.filter(status=IETFWG.ACTIVE).order_by('group_acronym__acronym')
rgs = IRTF.objects.all().order_by('acronym')
areas = Area.objects.filter(status=Area.ACTIVE).order_by('area_acronym__acronym')
conflicts = SessionConflict.objects.filter(meeting_num=meeting.meeting_num)
template = "meeting/week-view.html"
return render_to_response(template,
{"timeslots":timeslots, "update":update, "meeting":meeting,
"venue":venue, "ads":ads, "plenaryw_agenda":plenaryw_agenda,
"plenaryt_agenda":plenaryt_agenda, "wg_list" : wgs,
"rg_list" : rgs, "area_list" : areas},
"rg_list" : rgs, "area_list" : areas, "conflicts":conflicts},
context_instance=RequestContext(request))

def ical_agenda(request, num=None):
Expand Down
6 changes: 5 additions & 1 deletion ietf/proceedings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ class SessionConflict(models.Model):
conflict_gid = models.ForeignKey(Acronym, related_name='conflicts_with_set', db_column='conflict_gid')
meeting_num = models.ForeignKey(Meeting, db_column='meeting_num')
def __str__(self):
return "At IETF %s, %s conflicts with %s" % ( self.meeting_num_id, self.group_acronym.acronym, self.conflict_gid.acronym)
try:
return "At IETF %s, %s conflicts with %s" % ( self.meeting_num_id, self.group_acronym.acronym, self.conflict_gid.acronym)
except BaseException:
return "At IETF %s, something conflicts with something" % ( self.meeting_num_id )

class Meta:
db_table = 'session_conflicts'

Expand Down
101 changes: 60 additions & 41 deletions ietf/templates/meeting/week-view.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{# Copyright The IETF Trust 2007, All Rights Reserved #}
{% load humanize %}


<html> <head>
<script type="text/javascript" src='/js/agenda2.js'></script>
<script type="text/javascript">
Expand All @@ -10,6 +11,7 @@
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 %}
{% endautoescape %}


var fg = {
'app': "#008",
'gen': "#080",
Expand Down Expand Up @@ -195,7 +197,7 @@
//-----------------------------------------------------------------
var resize_func = function(div,t,l,w,h,to_fit)
{ return function(){resize(div,t,l,w,h,to_fit);} }
var click_func = function (e) { return function(){handle_click(e);}}
var maximize_func = function (e) { return function(){maximize(e);}}

for (i = 0; i < items.length; i++)
{
Expand Down Expand Up @@ -256,7 +258,7 @@

if (items[i].agenda)
{
e.onclick=click_func(e);
e.onclick=maximize_func(e);
e.style.cursor="pointer";
}

Expand Down Expand Up @@ -374,7 +376,21 @@
return;
}

var child = e.firstChild;
e.insertBefore(document.createElement("br"),e.firstChild);

var minimize_func = function (e) { return function(){minimize(e);} }
var img = document.createElement("img");
img.src = "/images/close.png";
img.style.cssFloat="right";
img.onclick = minimize_func(e);
img.style.cursor="pointer";
e.insertBefore(img,e.firstChild);

var h = document.createElement("span");
h.appendChild(document.createTextNode(items[e.id].dayname));
h.style.fontWeight="bold";
e.insertBefore(h,e.firstChild);
e.style.fontSize="10pt";

var tmp = e.style.height;
e.style.removeProperty("height");
Expand All @@ -401,52 +417,55 @@
e.appendChild(frame);
}

function handle_click(e)
function finish_minimize(e)
{
e.onmouseover = e.oldmouseover;
e.onmouseout = e.oldmouseout;
e.oldmouseover = undefined;
e.oldmouseout = undefined;
e.style.cursor="pointer";
}

function maximize(e)
{
if (e.onmouseover)
{
e.oldmouseover = e.onmouseover;
e.oldmouseout = e.onmouseout;
e.onmouseover = undefined;
e.onmouseout = undefined;

var callback_func = function (e) { return function(){finish_maximize(e);}}
e.callback = callback_func(e);

resize(e,0,0,
document.body.clientWidth-2*(padding + border),
document.body.clientHeight-2*(padding + border));


e.insertBefore(document.createElement("br"),e.firstChild);

var h = document.createElement("span");
h.appendChild(document.createTextNode(items[e.id].dayname));
h.style.fontWeight="bold";
e.insertBefore(h,e.firstChild);
e.style.fontSize="10pt";
}
else
{
var agenda = document.getElementById("agenda");
if (agenda)
{
e.removeChild(agenda);
}
e.onmouseover = e.oldmouseover;
e.onmouseout = e.oldmouseout;
e.oldmouseover = undefined;
e.oldmouseout = undefined;
e.onmouseout();

e.removeChild(e.firstChild);
e.removeChild(e.firstChild);
e.style.fontSize="8pt";
e.oldmouseover = e.onmouseover;
e.oldmouseout = e.onmouseout;
e.onmouseover = undefined;
e.onmouseout = undefined;
e.style.cursor="auto";

var callback_func = function (e) { return function(){finish_maximize(e);}}
e.callback = callback_func(e);

resize(e,0,0,
document.body.clientWidth-2*(padding + border),
document.body.clientHeight-2*(padding + border));
}
}

function minimize(e)
{
var agenda = document.getElementById("agenda");
if (agenda)
{
e.removeChild(agenda);
}

var callback_func = function (e) { return function(){finish_minimize(e);}}
e.callback = callback_func(e);
e.oldmouseout();

e.removeChild(e.firstChild);
e.removeChild(e.firstChild);
e.removeChild(e.firstChild);
e.style.fontSize="8pt";
}

function wavg(x1,x2,percent)
{
if (percent == 100) { return x2; }
var res = x2 * (percent / 100) + x1 * ((100 - percent) / 100);
return res;
}
Expand Down
Binary file added static/images/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cabddc9

Please sign in to comment.