Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #19613 -- Link to PDF version of the docs.

  • Loading branch information...
commit 5f17ee1c431cc6d8d3d6d7c387d80b7328c6114d 1 parent 0c8d5bd
@aaugustin aaugustin authored
View
4 django_website/docs/templates/docs/doc.html
@@ -121,8 +121,8 @@ <h2 id="comments">Questions/Feedback</h2>
{% else %}
Offline (Django {{ version }}):
<a href="{{ MEDIA_URL }}docs/django-docs-{{ version }}-{{ lang }}.zip">HTML</a> |
- <a href="http://media.readthedocs.org/pdf/django/{{ version }}.X/django.pdf">PDF</a> |
- <a href="http://media.readthedocs.org/epub/django/{{ version }}.X/django.epub">ePub</a>
+ <a href="http://media.readthedocs.org/pdf/django/{{ rtd_version }}/django.pdf">PDF</a> |
+ <a href="http://media.readthedocs.org/epub/django/{{ rtd_version }}/django.epub">ePub</a>
{% endif %}
<br>
<span class="quiet">Provided by <a href="http://readthedocs.org/">Read the Docs</a>.
View
13 django_website/docs/views.py
@@ -18,7 +18,7 @@
def index(request):
return redirect(DocumentRelease.objects.default())
-
+
def language(request, lang):
return redirect(DocumentRelease.objects.default())
@@ -37,12 +37,13 @@ def document(request, lang, version, url):
template_names = [
'docs/%s.html' % docroot.rel_path_to(doc_path).replace(doc_path.ext, ''),
'docs/doc.html',
- ]
+ ]
return render_to_response(template_names, RequestContext(request, {
'doc': simplejson.load(open(doc_path, 'rb')),
'env': simplejson.load(open(docroot.child('globalcontext.json'), 'rb')),
'lang': lang,
'version': version,
+ 'rtd_version': '%s.%s' % (version, 'x' if version >= '1.5' else 'X'),
'docurl': url,
'update_date': datetime.datetime.fromtimestamp(docroot.child('last_build').mtime()),
'home': urlresolvers.reverse('document-index', kwargs={'lang':lang, 'version':version}),
@@ -58,14 +59,14 @@ def __init__(self, subpath):
def __call__(self, request, lang, version, path):
return django.views.static.serve(
- request,
+ request,
document_root = get_doc_root_or_404(lang, version).child(self.subpath),
path = path,
)
def objects_inventory(request, lang, version):
response = django.views.static.serve(
- request,
+ request,
document_root = get_doc_root_or_404(lang, version),
path = "objects.inv",
)
@@ -84,7 +85,7 @@ def __init__(self, **kwargs):
'load_all': False,
})
super(DocSearchView, self).__init__(**kwargs)
-
+
def extra_context(self):
# Constuct a context that matches the rest of the doc page views.
default_release = DocumentRelease.objects.default()
@@ -93,4 +94,4 @@ def extra_context(self):
'version': default_release.version,
'release': default_release,
}
-
+
Please sign in to comment.
Something went wrong with that request. Please try again.