Browse files

Tweaked styles and language for current-doc-version hover.

Also fixed a weird Python 2.6-related bug in the doc version template tag.
  • Loading branch information...
1 parent c51b878 commit 5f7bdc6343c11d8da1a59ad7fd72181c77580d19 @jacobian jacobian committed Sep 29, 2011
View
20 django_website/docs/templates/docs/doc.html
@@ -18,12 +18,18 @@
{% load docs %}
{% get_all_doc_versions docurl as versions %}
<ul id="doc-versions">
- {% for v in versions reversed %}
+ {% for v in versions %}
{% if version != v %}
- <li class="other"><a href="{% url document-detail lang=lang, version=v, url=docurl %}">{{ v|upper }}</a></li>
+ <li class="other">
+ <a href="{% url document-detail lang=lang, version=v, url=docurl %}">{% if v == 'dev' %}latest{% else %}{{ v }}{% endif %}</a></li>
{% endif %}
{% endfor %}
- <li class="current" title="{% if version == 'dev' %}This document is for Django's development version, which can be significantly different from previous releases.{% else %}This document describes Django {{ version }}.{% endif %} Click on the links on the left to see other versions."><span>Version: <strong>{{ version|upper }}</strong></span></li>
+ <li class="current"
+ title="{% if version == 'dev' %}This document is for Django's development version, which can be significantly different from previous releases.{% else %}This document describes Django {{ version }}.{% endif %} Click on the links on the left to see other versions.">
+ <span>Documentation version:
+ <strong>{% if version == 'dev' %}latest{% else %}{{ version }}{% endif %}</strong>
+ </span>
+ </li>
</ul>
{{ doc.body|safe }}
{% endblock %}
@@ -109,13 +115,13 @@ <h2 id="comments">Questions/Feedback</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="{{ 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 }}):
- <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="{{ 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>
{% endif %}
<br>
View
12 django_website/docs/templatetags/docs.py
@@ -20,11 +20,11 @@ def search_form(context, search_form_id='sidebar_search'):
def get_all_doc_versions(parser, token):
"""
Get a list of all versions of this document to link to.
-
+
Usage: {% get_all_doc_versions <docurl> as "varname" %}
"""
return AllDocVersionsTag.handle(parser, token)
-
+
class AllDocVersionsTag(template.Node):
@classmethod
def handle(cls, parser, token):
@@ -39,15 +39,15 @@ def __init__(self, docurl, asvar):
self.asvar = asvar
# FIXME
self.lang = 'en'
-
+
def render(self, context):
try:
url = self.docurl.resolve(context)
except template.VariableDoesNotExist:
return ''
versions = []
-
+
# Look for each version of the docs.
for release in DocumentRelease.objects.all():
version_root = get_doc_root(release.lang, release.version)
@@ -57,6 +57,6 @@ def render(self, context):
versions.append(release.version)
# Save the versions into the context
- context[self.asvar] = reversed(sorted(versions))
+ context[self.asvar] = sorted(versions)
- return ''
+ return ''
View
6 media/css/base.css
@@ -494,14 +494,14 @@ div.admonition-behind-the-scenes {
padding: 0;
margin: 0 0 0 7px;
background-color: #E0FFB8;
- border: 4px #487858 solid;
+ border: 2px #487858 solid;
border-radius: 3px;
color: #234F32;
}
#doc-versions li.current {
- background: #E0FFB8 url(../img/site/arrow-head-left.gif) 7px center no-repeat;
- padding-left: 15px;
+ background: #E0FFB8 url(../img/site/arrow-head-left.gif) 6px center no-repeat;
+ padding-left: 13px;
}
#doc-versions li.current span {
View
BIN media/img/site/arrow-head-left.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5f7bdc6

Please sign in to comment.