Skip to content

Commit 060307e

Browse files
committed
/doc/rfcNNNN/: show the internet-draft name (if known) and link to its history
- Legacy-Id: 2017
1 parent 5a501cf commit 060307e

5 files changed

Lines changed: 23 additions & 27 deletions

File tree

ietf/idrfc/idrfc_wrapper.py

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
1+
# Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
22
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -231,6 +231,7 @@ class RfcWrapper:
231231
publication_date = None
232232
maturity_level = None
233233
ietf_process = None
234+
draft_name = None
234235

235236
def __init__(self, rfcindex, rfc=None, idinternal=None):
236237
self._rfcindex = rfcindex
@@ -253,6 +254,16 @@ def __init__(self, rfcindex, rfc=None, idinternal=None):
253254
if not self.maturity_level:
254255
self.maturity_level = "Unknown"
255256

257+
ids = InternetDraft.objects.filter(rfc_number=self.rfc_number)
258+
if len(ids) >= 1:
259+
self.draft_name = ids[0].filename
260+
elif self._rfcindex and self._rfcindex.draft:
261+
# rfcindex occasionally includes drafts that were not
262+
# really submitted to IETF (e.g. April 1st)
263+
ids = InternetDraft.objects.filter(filename=self._rfcindex.draft)
264+
if len(ids) > 0:
265+
self.draft_name = self._rfcindex.draft
266+
256267
def _rfc_doc_list(self, name):
257268
if (not self._rfcindex) or (not self._rfcindex.__dict__[name]):
258269
return None
@@ -495,30 +506,6 @@ def view_sort_key_byad(self):
495506
else:
496507
return "3"
497508

498-
# def debug_data(self):
499-
# s = ""
500-
# if self.draft:
501-
# s = s + "draft("+self.draft.filename+","+str(self.draft.id_document_tag)+","+str(self.draft.rfc_number)+")"
502-
# if self.idinternal:
503-
# s = s + ",idinternal()"
504-
# if self._rfc:
505-
# s = s + ",rfc("+str(self._rfc.rfc_number)+")"
506-
# if self.rfcIndex:
507-
# s = s + ",rfcIndex("+str(self.rfcIndex.rfc_number)+")"
508-
# if self.rfc_idinternal:
509-
# s = s + ",rfc_idinternal("+str(self.rfc_idinternal.draft_id)+")"
510-
# return s
511-
512-
513-
# if idinternal:
514-
# o['stateChangeNoticeTo'] = idinternal.state_change_notice_to
515-
# if idinternal.returning_item > 0:
516-
# o['telechatReturningItem'] = True
517-
# if idinternal.telechat_date:
518-
# o['telechatDate'] = str(idinternal.telechat_date)
519-
# o['onTelechatAgenda'] = (idinternal.agenda > 0)
520-
#
521-
522509
# ---------------------------------------------------------------------------
523510

524511
class BallotWrapper:

ietf/idrfc/testurl.list

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
200 /doc/rfc3852/_debug.data
2727
200 /doc/rfc3852/_ballot.data
2828

29+
# old RFC
30+
200 /doc/rfc822/
31+
200 /doc/rfc822/_debug.data
32+
2933
404 /doc/draft-no-such-draft/
3034
404 /doc/rfc4637/
3135

ietf/idrfc/views_doc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ def _get_history(doc, versions):
161161
if doc.is_id_wrapper and doc.draft_status == "Expired" and doc._draft.expiration_date:
162162
results.append({'is_text':True, 'date':doc._draft.expiration_date, 'text':'Draft expired'})
163163
if doc.is_rfc_wrapper:
164-
results.append({'is_text':True, 'date':doc.publication_date, 'text':'RFC Published'})
164+
if doc.draft_name:
165+
text = 'RFC Published (see <a href="/doc/%s/">%s</a> for earlier history)' % (doc.draft_name,doc.draft_name)
166+
else:
167+
text = 'RFC Published'
168+
results.append({'is_text':True, 'date':doc.publication_date, 'text':text})
165169

166170
# convert plain dates to datetimes (required for sorting)
167171
for x in results:

ietf/templates/idrfc/doc_history.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
{% if c.is_text %}
5050
<td>&nbsp;</td>
5151
<td>(System)</td>
52-
<td>{{ c.text }}</td>
52+
<td>{{ c.text|safe }}</td>
5353
{% endif %}
5454

5555
{% if c.is_com %}

ietf/templates/idrfc/doc_main_rfc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
{% if doc.updated_by %}<br />Updated by {{ doc.updated_by }}{%endif %}
4444
{% if doc.obsoletes %}<br />Obsoletes {{ doc.obsoletes }}{%endif %}
4545
{% if doc.updates %}<br />Updates {{ doc.updates }}{%endif %}
46+
{% if doc.draft_name %}<br/ >Was <a href="/doc/{{ doc.draft_name}}/">{{doc.draft_name}}</a>{% endif %}
4647
</td></tr>
4748
<tr><td>Published:</td><td> {{ doc.publication_date|default:"(data missing)" }}</td></tr>
4849
{% if doc.in_ietf_process %}

0 commit comments

Comments
 (0)