Skip to content

Commit 4ca4845

Browse files
committed
Improve coloring for "for N days" information
- Legacy-Id: 1963
1 parent 67ecb98 commit 4ca4845

1 file changed

Lines changed: 31 additions & 10 deletions

File tree

ietf/idrfc/templatetags/ballot_icon.py

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,37 @@ def state_age_colored(doc):
155155
if main_state in ["Dead","AD is watching","RFC Published"]:
156156
return ""
157157
days = timesince_days(doc.ietf_process.state_date())
158-
goal = 0
159-
if sub_state == "Revised ID Needed":
160-
goal = 30
158+
# loosely based on
159+
# http://trac.tools.ietf.org/group/iesg/trac/wiki/PublishPath
160+
if main_state == "In Last Call":
161+
goal1 = 30
162+
goal2 = 30
161163
elif main_state == "RFC Ed Queue":
162-
goal = 60
163-
elif main_state == "In Last Call":
164-
goal = 30
164+
goal1 = 60
165+
goal2 = 120
166+
elif main_state in ["Last Call Requested", "Approved-announcement to be sent"]:
167+
goal1 = 4
168+
goal2 = 7
169+
elif sub_state == "Revised ID Needed":
170+
goal1 = 14
171+
goal2 = 28
172+
elif main_state == "Publication Requested":
173+
goal1 = 7
174+
goal2 = 14
175+
elif main_state == "AD Evaluation":
176+
goal1 = 14
177+
goal2 = 28
165178
else:
166-
goal = 14
167-
if days > goal:
168-
return '<span style="padding:0 2px;font-size:85%%;background:yellow;" title="Goal is %d days">(for&nbsp;%d&nbsp;day%s)</span>' % (goal,days,('','s')[days != 1])
179+
goal1 = 14
180+
goal2 = 28
181+
if days > goal2:
182+
style = 'padding:0 2px;background:#ffa0a0;'
183+
elif days > goal1:
184+
style = 'padding:0 2px;background:yellow;'
169185
else:
170-
return '<span style="font-size:85%%;">(for&nbsp;%d&nbsp;day%s)</span>' % (days,('','s')[days != 1])
186+
style = ''
187+
if style:
188+
title = ' title="Goal is &lt;%d days"' % (goal1,)
189+
else:
190+
title = ''
191+
return '<span style="font-size:85%%;%s"%s>(for&nbsp;%d&nbsp;day%s)</span>' % (style,title,days,('','s')[days != 1])

0 commit comments

Comments
 (0)