Skip to content

Commit 1a53f66

Browse files
committed
Merged in [18808] from rjsparks@nostrum.com:
Tweaked schedule editor colors to match preferences chosen by Liz. Added coloration for sessions having the IAB as a parent. - Legacy-Id: 18809 Note: SVN reference [18808] has been migrated to Git commit f93a5ea
2 parents 9a9f3fa + f93a5ea commit 1a53f66

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

ietf/meeting/views.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,12 +730,29 @@ def cubehelix(i, total, hue=1.2, start_angle=0.5):
730730

731731
session_parents = sorted(set(
732732
s.group.parent for s in sessions
733-
if s.group and s.group.parent and (s.group.parent.type_id == 'area' or s.group.parent.acronym == 'irtf')
733+
if s.group and s.group.parent and (s.group.parent.type_id == 'area' or s.group.parent.acronym in ('irtf','iab'))
734734
), key=lambda p: p.acronym)
735+
736+
liz_preferred_colors = {
737+
'art' : { 'dark' : (204, 121, 167) , 'light' : (234, 232, 230) },
738+
'gen' : { 'dark' : (29, 78, 17) , 'light' : (232, 237, 231) },
739+
'iab' : { 'dark' : (255, 165, 0) , 'light' : (255, 246, 230) },
740+
'int' : { 'dark' : (132, 240, 240) , 'light' : (232, 240, 241) },
741+
'irtf' : { 'dark' : (154, 119, 230) , 'light' : (243, 239, 248) },
742+
'ops' : { 'dark' : (199, 133, 129) , 'light' : (250, 240, 242) },
743+
'rtg' : { 'dark' : (222, 219, 124) , 'light' : (247, 247, 233) },
744+
'sec' : { 'dark' : (0, 114, 178) , 'light' : (245, 252, 248) },
745+
'tsv' : { 'dark' : (117,201,119) , 'light' : (251, 252, 255) },
746+
}
735747
for i, p in enumerate(session_parents):
736-
rgb_color = cubehelix(i, len(session_parents))
737-
p.scheduling_color = "rgb({}, {}, {})".format(*tuple(int(round(x * 255)) for x in rgb_color))
738-
p.light_scheduling_color = "rgb({}, {}, {})".format(*tuple(int(round((0.9 + 0.1 * x) * 255)) for x in rgb_color))
748+
if p.acronym in liz_preferred_colors:
749+
colors = liz_preferred_colors[p.acronym]
750+
p.scheduling_color = "rgb({}, {}, {})".format(*colors['dark'])
751+
p.light_scheduling_color = "rgb({}, {}, {})".format(*colors['light'])
752+
else:
753+
rgb_color = cubehelix(i, len(session_parents))
754+
p.scheduling_color = "rgb({}, {}, {})".format(*tuple(int(round(x * 255)) for x in rgb_color))
755+
p.light_scheduling_color = "rgb({}, {}, {})".format(*tuple(int(round((0.9 + 0.1 * x) * 255)) for x in rgb_color))
739756

740757
return render(request, "meeting/edit_meeting_schedule.html", {
741758
'meeting': meeting,

0 commit comments

Comments
 (0)