Show diff controls for a bis -00 document. Fixes #2846. Commit ready for merge.
- Legacy-Id: 17147
This commit is contained in:
parent
cbe8da6a71
commit
18b8a795ad
|
@ -855,7 +855,20 @@ class DocTestCase(TestCase):
|
|||
r = self.client.get(url)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
self.assertContains(r, e.desc)
|
||||
|
||||
|
||||
def test_history_bis_00(self):
|
||||
rfcname='rfc9090'
|
||||
rfc = WgRfcFactory(alias2=rfcname)
|
||||
bis_draft = WgDraftFactory(name='draft-ietf-{}-{}bis'.format(rfc.group.acronym,rfcname))
|
||||
|
||||
url = urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=bis_draft.name))
|
||||
r = self.client.get(url)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
q = PyQuery(unicontent(r))
|
||||
attr1='value="{}"'.format(rfcname)
|
||||
self.assertEqual(len(q('option['+attr1+'][selected="selected"]')), 1)
|
||||
|
||||
|
||||
def test_document_feed(self):
|
||||
doc = IndividualDraftFactory()
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{% origin %}
|
||||
{{ top|safe }}
|
||||
|
||||
{% if diff_revisions and diff_revisions|length > 1 %}
|
||||
{% if diff_revisions and diff_revisions|length > 1 or doc.name|rfcbis %}
|
||||
<h2>Revision differences</h2>
|
||||
|
||||
<form class="form-horizontal diff-form" action="{{rfcdiff_base_url}}" method="get" target="_blank">
|
||||
|
@ -31,13 +31,13 @@
|
|||
<div class="col-sm-10">
|
||||
<select class="form-control" id="url1" name="url1">
|
||||
{% for name, rev, time, url in diff_revisions %}
|
||||
<option value="{{ url }}" {% if forloop.counter == 2 %} selected="selected" {% endif %}>
|
||||
<option value="{{ url }}" {% if diff_revisions|length > 1 and forloop.counter == 2 %} selected="selected" {% endif %}>
|
||||
{{ name }}{% if rev %}-{{ rev }}{% endif %}
|
||||
({{ time|date:"Y-m-d" }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% if doc.name|rfcbis %}
|
||||
<option value="{{ doc.name|rfcbis }}">
|
||||
<option value="{{ doc.name|rfcbis }}"{% if diff_revisions and diff_revisions|length == 1 %} selected="selected"{% endif %}>
|
||||
{{ doc.name|rfcbis }}
|
||||
</option>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue