Skip to content

Commit e61e4f0

Browse files
committed
Provided a more comprehensive document state indication. May need further refinement.
- Legacy-Id: 4585
1 parent 4cb0643 commit e61e4f0

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

ietf/community/display.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,30 @@ class StatusField(DisplayField):
5151
description = 'Status in the IETF process'
5252

5353
def get_value(self, document, raw=False):
54-
for i in ('draft', 'draft-stream-ietf', 'draft-stream-irtf', 'draft-stream-ise', 'draft-stream-iab', 'draft'):
55-
state = document.get_state(i)
56-
if state:
57-
return state
58-
return ''
59-
54+
draft_state = document.get_state('draft')
55+
stream_state = document.get_state('draft-stream-%s' % (document.stream.slug)) if document.stream else None
56+
iesg_state = document.get_state('draft-iesg')
57+
rfceditor_state = document.get_state('draft-rfceditor')
58+
if draft_state.slug == 'rfc':
59+
state = draft_state.name
60+
elif rfceditor_state:
61+
state = "%s<br/>%s<br/>%s" % (stream_state.name, iesg_state.name, rfceditor_state.name)
62+
elif iesg_state:
63+
state = "%s<br/>%s" % (stream_state.name, iesg_state.name)
64+
elif stream_state:
65+
state = stream_state.name
66+
else:
67+
state = ""
68+
#
69+
if draft_state.slug == 'rfc':
70+
tags = ""
71+
else:
72+
tags = [ tag.name for tag in document.tags.all() ]
73+
if tags:
74+
tags = '[%s]' % ",".join(tags)
75+
else:
76+
tags = ''
77+
return '%s%s' % (state, tags)
6078

6179
class WGField(DisplayField):
6280
codename = 'wg_rg'

0 commit comments

Comments
 (0)