diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 98bc3af89..a7c9e248b 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -930,13 +930,21 @@ Man Expires September 22, 2015 [Page 3] doc.rev = "01" doc.save_with_history([DocEvent.objects.create(doc=doc, rev=doc.rev, type="changed_document", by=Person.objects.get(user__username="secretary"), desc="Test")]) + # Fetch the main page resulting latest version r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc.name))) self.assertEqual(r.status_code, 200) self.assertContains(r, "%s-01"%docname) - + + # Fetch 01 version even when it is last version r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc.name,rev="01"))) + self.assertEqual(r.status_code, 200) + self.assertContains(r, "%s-01"%docname) + + # Fetch version number which is too large, that should redirect to main page + r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc.name,rev="02"))) self.assertEqual(r.status_code, 302) - + + # Fetch 00 version which should result that version r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=doc.name,rev="00"))) self.assertEqual(r.status_code, 200) self.assertContains(r, "%s-00"%docname) diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index b0094781f..b1c0c6356 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -139,9 +139,6 @@ def document_main(request, name, rev=None): gh = None if rev != None: - if rev == doc.rev: - return redirect('ietf.doc.views_doc.document_main', name=name) - # find the entry in the history for h in doc.history_set.order_by("-time"): if rev == h.rev: @@ -210,7 +207,7 @@ def document_main(request, name, rev=None): latest_revision = None - if doc.get_state_slug() == "rfc": + if not snapshot and doc.get_state_slug() == "rfc": # content content = doc.text_or_error() # pyflakes:ignore content = markup_txt.markup(maybe_split(content, split=split_content)) diff --git a/ietf/templates/doc/document_draft.html b/ietf/templates/doc/document_draft.html index 5d6600e79..d5046b651 100644 --- a/ietf/templates/doc/document_draft.html +++ b/ietf/templates/doc/document_draft.html @@ -7,7 +7,7 @@ {% block pagehead %} - + @@ -18,7 +18,7 @@ {% endblock %} {% block title %} - {% if doc.get_state_slug == "rfc" %} + {% if doc.get_state_slug == "rfc" and not snapshot %} RFC {{ rfc_number }} - {{ doc.title }} {% else %} {{ name }}-{{ doc.rev }} - {{ doc.title }} @@ -38,7 +38,11 @@ {% if doc.rev != latest_rev %} The information below is for an old version of the document {% else %} - + {% if doc.get_state_slug == "rfc" and snapshot %} + The information below is for an old version of the document that is already published as an RFC + {% else %} + + {% endif %} {% endif %} @@ -49,7 +53,7 @@ Type - {% if doc.get_state_slug == "rfc" %} + {% if doc.get_state_slug == "rfc" and not snapshot %} RFC - {{ doc.std_level }} ({% if published %}{{ published.time|date:"F Y" }}{% else %}publication date unknown{% endif %}{% if has_errata %}; Errata{% else %}; No errata{% endif %}) @@ -170,7 +174,7 @@ - {% if doc.get_state_slug != "rfc" %} + {% if doc.get_state_slug != "rfc" and not snapshot %} Intended RFC status diff --git a/ietf/templates/doc/revisions_list.html b/ietf/templates/doc/revisions_list.html index 134d2b9f7..ca7274ef9 100644 --- a/ietf/templates/doc/revisions_list.html +++ b/ietf/templates/doc/revisions_list.html @@ -2,8 +2,8 @@