Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactored template.

  • Loading branch information...
commit e4db22a03d0b9581845e1bfc79ba84bc48e49a7b 1 parent 5f17ee1
Aymeric Augustin aaugustin authored
9 django_website/docs/templates/docs/doc.html
View
@@ -113,17 +113,10 @@ <h2 id="comments">Questions/Feedback</h2>
{% if version != "1.1" and version != "1.0" %}
<h2>Download:</h2>
<p>
- {% if version == "dev" %}
- Offline (development version):
- <a href="{{ MEDIA_URL }}docs/django-docs-{{ version }}-{{ lang }}.zip">HTML</a> |
- <a href="http://media.readthedocs.org/pdf/django/latest/django.pdf">PDF</a> |
- <a href="http://media.readthedocs.org/epub/django/latest/django.epub">ePub</a>
- {% else %}
- Offline (Django {{ version }}):
+ Offline ({% if version == "dev" %}development version{% else %}Django {{ version }}{% endif %}):
<a href="{{ MEDIA_URL }}docs/django-docs-{{ version }}-{{ lang }}.zip">HTML</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>.
</p>
8 django_website/docs/views.py
View
@@ -31,6 +31,12 @@ def document(request, lang, version, url):
url.encode("ascii")
except UnicodeEncodeError:
raise Http404
+ if version == 'dev':
+ rtd_version = 'latest'
+ elif version >= '1.5':
+ rtd_version = version + '.x'
+ else:
+ rtd_version = version + '.X'
docroot = get_doc_root_or_404(lang, version)
doc_path = get_doc_path_or_404(docroot, url)
@@ -43,7 +49,7 @@ def document(request, lang, version, url):
'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'),
+ 'rtd_version': rtd_version,
'docurl': url,
'update_date': datetime.datetime.fromtimestamp(docroot.child('last_build').mtime()),
'home': urlresolvers.reverse('document-index', kwargs={'lang':lang, 'version':version}),
Please sign in to comment.
Something went wrong with that request. Please try again.