Skip to content

Commit 18b8a79

Browse files
committed
Show diff controls for a bis -00 document. Fixes ietf-tools#2846. Commit ready for merge.
- Legacy-Id: 17147
1 parent cbe8da6 commit 18b8a79

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
@@ -855,7 +855,20 @@ def test_history(self):
855855
r = self.client.get(url)
856856
self.assertEqual(r.status_code, 200)
857857
self.assertContains(r, e.desc)
858-
858+
859+
def test_history_bis_00(self):
860+
rfcname='rfc9090'
861+
rfc = WgRfcFactory(alias2=rfcname)
862+
bis_draft = WgDraftFactory(name='draft-ietf-{}-{}bis'.format(rfc.group.acronym,rfcname))
863+
864+
url = urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=bis_draft.name))
865+
r = self.client.get(url)
866+
self.assertEqual(r.status_code, 200)
867+
q = PyQuery(unicontent(r))
868+
attr1='value="{}"'.format(rfcname)
869+
self.assertEqual(len(q('option['+attr1+'][selected="selected"]')), 1)
870+
871+
859872
def test_document_feed(self):
860873
doc = IndividualDraftFactory()
861874

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)