Skip to content

Commit 1e1bd2f

Browse files
committed
Merged in [17147] from rjsparks@nostrum.com:
Show diff controls for a bis -00 document. Fixes ietf-tools#2846. - Legacy-Id: 17155 Note: SVN reference [17147] has been migrated to Git commit 18b8a79
2 parents 09557af + 18b8a79 commit 1e1bd2f

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

ietf/doc/tests.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,20 @@ def test_history(self):
858858
r = self.client.get(url)
859859
self.assertEqual(r.status_code, 200)
860860
self.assertContains(r, e.desc)
861-
861+
862+
def test_history_bis_00(self):
863+
rfcname='rfc9090'
864+
rfc = WgRfcFactory(alias2=rfcname)
865+
bis_draft = WgDraftFactory(name='draft-ietf-{}-{}bis'.format(rfc.group.acronym,rfcname))
866+
867+
url = urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=bis_draft.name))
868+
r = self.client.get(url)
869+
self.assertEqual(r.status_code, 200)
870+
q = PyQuery(unicontent(r))
871+
attr1='value="{}"'.format(rfcname)
872+
self.assertEqual(len(q('option['+attr1+'][selected="selected"]')), 1)
873+
874+
862875
def test_document_feed(self):
863876
doc = IndividualDraftFactory()
864877

ietf/templates/doc/document_history.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{% origin %}
2020
{{ top|safe }}
2121

22-
{% if diff_revisions and diff_revisions|length > 1 %}
22+
{% if diff_revisions and diff_revisions|length > 1 or doc.name|rfcbis %}
2323
<h2>Revision differences</h2>
2424

2525
<form class="form-horizontal diff-form" action="{{rfcdiff_base_url}}" method="get" target="_blank">
@@ -31,13 +31,13 @@ <h2>Revision differences</h2>
3131
<div class="col-sm-10">
3232
<select class="form-control" id="url1" name="url1">
3333
{% for name, rev, time, url in diff_revisions %}
34-
<option value="{{ url }}" {% if forloop.counter == 2 %} selected="selected" {% endif %}>
34+
<option value="{{ url }}" {% if diff_revisions|length > 1 and forloop.counter == 2 %} selected="selected" {% endif %}>
3535
{{ name }}{% if rev %}-{{ rev }}{% endif %}
3636
({{ time|date:"Y-m-d" }})
3737
</option>
3838
{% endfor %}
3939
{% if doc.name|rfcbis %}
40-
<option value="{{ doc.name|rfcbis }}">
40+
<option value="{{ doc.name|rfcbis }}"{% if diff_revisions and diff_revisions|length == 1 %} selected="selected"{% endif %}>
4141
{{ doc.name|rfcbis }}
4242
</option>
4343
{% endif %}

0 commit comments

Comments
 (0)