Merge pull request #6878 from pselkirk/fix-6861

fix: Correctly display the last pre-RFC rev of a draft
This commit is contained in:
Robert Sparks 2024-01-04 11:01:08 -06:00 committed by GitHub
commit 2331b7541b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View file

@ -840,6 +840,10 @@ Man Expires September 22, 2015 [Page 3]
updated_by = IndividualRfcFactory()
updated_by.relateddocument_set.create(relationship_id='updates',target=rfc)
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name, rev=draft.rev)))
self.assertEqual(r.status_code, 200)
self.assertContains(r, "This is an older version of an Internet-Draft that was ultimately published as")
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)))
self.assertEqual(r.status_code, 302)

View file

@ -31,7 +31,7 @@
{% if doc.rev != latest_rev %}
<div class="alert alert-warning my-3">The information below is for an old version of the document.</div>
{% else %}
{% if doc.type_id == "rfc" and snapshot %}
{% if doc.became_rfc %}
<div class="alert alert-warning my-3">
The information below is for an old version of the document that is already published as an RFC.
</div>
@ -751,7 +751,7 @@
{% endfor %}
{% endif %}
</div>
{% if doc.get_state_slug == "active" or doc.type_id == "rfc" %}
{% if doc.get_state_slug == "active" or doc.type_id == "rfc" or doc.became_rfc %}
<div class="card mt-5">
<div class="card-header">
{% if doc.type_id == "rfc" and not snapshot %}

View file

@ -1,4 +1,4 @@
{# Copyright The IETF Trust 2016-2020, All Rights Reserved #}
{# Copyright The IETF Trust 2016-2023, All Rights Reserved #}
{% load origin %}
{% load static %}
{% load ietf_filters %}
@ -60,8 +60,8 @@
</div>
{% endif %}
{% else %}
{% if snapshot and doc.doc.became_rfc %}
<div{% if document_html %} class="alert alert-warning small"{% endif %}>This is an older version of an Internet-Draft that was ultimately published as <a href="{% if document_html %}{% url 'ietf.doc.views_doc.document_html' name=doc.doc.became_rfc.name %}{% else %}{% url 'ietf.doc.views_doc.document_main' name=doc.doc.became_rfc.name %}{% endif %}">{{doc.doc.became_rfc.name|prettystdname}}</a>.</div>
{% if doc.became_rfc %}
<div{% if document_html %} class="alert alert-warning small"{% endif %}>This is an older version of an Internet-Draft that was ultimately published as <a href="{% if document_html %}{% url 'ietf.doc.views_doc.document_html' name=doc.became_rfc.name %}{% else %}{% url 'ietf.doc.views_doc.document_main' name=doc.became_rfc.name %}{% endif %}">{{doc.became_rfc.name|prettystdname}}</a>.</div>
{% elif snapshot and doc.rev != latest_rev %}
<div{% if document_html %} class="alert alert-warning small"{% endif %}>This is an older version of an Internet-Draft whose latest revision state is "{{ doc.doc.get_state }}".</div>
{% else %}
@ -70,7 +70,7 @@
{% if resurrected_by %}- resurrect requested by {{ resurrected_by }}{% endif %}
{% endif %}
{% endif %}
{% if doc.get_state_slug != "active" and doc.type_id != "rfc" %}
{% if doc.get_state_slug != "active" and doc.get_state_slug != "rfc" and doc.type_id != "rfc" %}
<div class="badge rounded-pill text-bg-warning{% if not document_html %} float-end{% endif %}">
Expired &amp; archived
</div>