summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Spaulding <benjamin.spaulding@lionbridge.com>2015-07-12 15:16:27 -0500
committerTim Graham <timograham@gmail.com>2015-07-13 12:44:37 -0400
commit915ef79b08862680e82d6a772d6ead22735e9a2f (patch)
treecf31513467a384c02fbd934a05c89f1d978ab740
parent23529fb19594ffcc6ba6d716356b828157200288 (diff)
Fixed #25115 -- Made admindocs view bookmarklet reverse the URL rather than hardcode it.
-rw-r--r--django/contrib/admindocs/templates/admin_doc/bookmarklets.html2
-rw-r--r--tests/admin_docs/tests.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/admindocs/templates/admin_doc/bookmarklets.html b/django/contrib/admindocs/templates/admin_doc/bookmarklets.html
index 937b0e2bc5..bb5e8b442d 100644
--- a/django/contrib/admindocs/templates/admin_doc/bookmarklets.html
+++ b/django/contrib/admindocs/templates/admin_doc/bookmarklets.html
@@ -19,7 +19,7 @@ select the bookmarklet from any page in the site.</p>
{% endblocktrans %}
<div id="content-main">
- <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=='undefined'){alert('No view found for this page');}document.location='{{ admin_url|escapejs }}doc/views/'+view+'/';})()">{% trans "Documentation for this page" %}</a></h3>
+ <h3><a href="javascript:(function(){if(typeof ActiveXObject!='undefined'){x=new ActiveXObject('Microsoft.XMLHTTP')}else if(typeof XMLHttpRequest!='undefined'){x=new XMLHttpRequest()}else{return;}x.open('HEAD',location.href,false);x.send(null);try{view=x.getResponseHeader('x-view');}catch(e){alert('No view found for this page');return;}if(view=='undefined'){alert('No view found for this page');}document.location='{% url 'django-admindocs-views-index' %}'+view+'/';})()">{% trans "Documentation for this page" %}</a></h3>
<p>{% trans "Jumps you from any page to the documentation for the view that generates that page." %}</p>
</div>
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py
index 51d03ebd77..b48d33301f 100644
--- a/tests/admin_docs/tests.py
+++ b/tests/admin_docs/tests.py
@@ -74,7 +74,7 @@ class AdminDocViewTests(TestDataMixin, AdminDocsTestCase):
def test_bookmarklets(self):
response = self.client.get(reverse('django-admindocs-bookmarklets'))
- self.assertContains(response, 'http://testserver/admin/doc/views/')
+ self.assertContains(response, '/admindocs/views/')
def test_templatetag_index(self):
response = self.client.get(reverse('django-admindocs-tags'))