Skip to content

Commit

Permalink
Fixed #20678 - Refer to the zip file correctly. Fixes a regression in…
Browse files Browse the repository at this point in the history
…troduced in 89b5cc5 and 89b5cc5.
  • Loading branch information
jezdez committed Jul 8, 2013
1 parent 4a39ac0 commit cbe6e5b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions django_docs/settings.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'django.core.context_processors.debug', 'django.core.context_processors.debug',
'django.core.context_processors.i18n', 'django.core.context_processors.i18n',
'django.core.context_processors.static', 'django.core.context_processors.static',
'django.core.context_processors.media',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'docs.context_processors.docs_version', 'docs.context_processors.docs_version',
'django.core.context_processors.request', 'django.core.context_processors.request',
Expand Down
4 changes: 2 additions & 2 deletions docs/management/commands/update_docs.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ def handle_noargs(self, **kwargs):


# #
# Create a zip file of the HTML build for offline reading. # Create a zip file of the HTML build for offline reading.
# This gets moved into STATIC_ROOT for downloading. # This gets moved into MEDIA_ROOT for downloading.
# #
html_build_dir = parent_build_dir.child('_build', 'html') html_build_dir = parent_build_dir.child('_build', 'html')
zipfile_name = 'django-docs-%s-%s.zip' % (release.version, release.lang) zipfile_name = 'django-docs-%s-%s.zip' % (release.version, release.lang)
zipfile_path = Path(settings.STATIC_ROOT).child('docs', zipfile_name) zipfile_path = Path(settings.MEDIA_ROOT).child('docs', zipfile_name)
if not zipfile_path.parent.exists(): if not zipfile_path.parent.exists():
zipfile_path.parent.mkdir(parents=True) zipfile_path.parent.mkdir(parents=True)
if verbosity >= 2: if verbosity >= 2:
Expand Down
2 changes: 1 addition & 1 deletion docs/templates/docs/doc.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h2>{% trans "Download:" %}</h2>
<p> <p>
{% if version == "dev" %}{% trans "Offline (development version):" %} {% if version == "dev" %}{% trans "Offline (development version):" %}
{% else %}{% blocktrans %}Offline (Django {{ version }}):{% endblocktrans %}{% endif %} {% else %}{% blocktrans %}Offline (Django {{ version }}):{% endblocktrans %}{% endif %}
<a href="{% static zipfile_path %}">HTML</a> | <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/pdf/django/{{ rtd_version }}/django.pdf">PDF</a> |
<a href="http://media.readthedocs.org/epub/django/{{ rtd_version }}/django.epub">ePub</a> <a href="http://media.readthedocs.org/epub/django/{{ rtd_version }}/django.epub">ePub</a>
<br> <br>
Expand Down
1 change: 0 additions & 1 deletion docs/views.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def document(request, lang, version, url):
'env': json.load(open(docroot.child('globalcontext.json'), 'rb')), 'env': json.load(open(docroot.child('globalcontext.json'), 'rb')),
'lang': lang, 'lang': lang,
'version': version, 'version': version,
'zipfile_path': 'docs/django-docs-%s-%s.zip' % (version, lang),
'rtd_version': rtd_version, 'rtd_version': rtd_version,
'docurl': url, 'docurl': url,
'update_date': datetime.datetime.fromtimestamp(docroot.child('last_build').mtime()), 'update_date': datetime.datetime.fromtimestamp(docroot.child('last_build').mtime()),
Expand Down

0 comments on commit cbe6e5b

Please sign in to comment.