Browse files

Fixes #16933 -- Made the version of the doc always visible in the bot…

…tom left corner. Also made it possible to easily switch to other versions (inspiration from RTD).
  • Loading branch information...
1 parent 1a3e1ce commit 51539688a774686d5355fc3ba34d5398b4c5329e @jphalip jphalip committed Sep 29, 2011
View
25 django_website/docs/templates/docs/doc.html
@@ -17,21 +17,14 @@
{% block body %}
{% load docs %}
{% get_all_doc_versions docurl as versions %}
- <h2 class="deck">
- {% if version == "dev" %}
- This document is for Django's development version, which can be
- significantly different from previous releases. Get older docs here:
- {% for version in versions %}
- {% if version != "dev" %}
- <a href="{% url document-detail lang=lang, version=version, url=docurl %}">
- {{ version }}</a>{% if forloop.last %}.{% else %},{% endif %}
+ <ul id="doc-versions">
+ {% for v in versions reversed %}
+ {% if version != v %}
+ <li class="other"><a href="{% url document-detail lang=lang, version=v, url=docurl %}">{{ v|upper }}</a></li>
{% endif %}
{% endfor %}
- {% else %}
- This document describes Django {{ version }}. For development docs,
- <a href="{% url document-detail lang=lang, version="dev", url=docurl %}">go here</a>.
- {% endif %}
- </h2>
+ <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>
+ </ul>
{{ doc.body|safe }}
{% endblock %}
@@ -40,7 +33,7 @@ <h2 id="comments">Questions/Feedback</h2>
<p>Having trouble? We'd like to help!</p>
<ul>
<li>
- Try the <a href="{% url document-detail lang=lang, version=version, url="faq" %}">FAQ</a>
+ Try the <a href="{% url document-detail lang=lang, version=version, url="faq" %}">FAQ</a>
— it's got answers to many common questions.
</li>
<li>
@@ -95,7 +88,7 @@ <h2 id="comments">Questions/Feedback</h2>
{% endblock %}
</ul>
{% endblock %}
-
+
{% block breadcrumbs-wrapper %}
<h2>You are here:</h2>
<ul>
@@ -111,7 +104,7 @@ <h2 id="comments">Questions/Feedback</h2>
{% endblock %}
</ul>
{% endblock %}
-
+
{% block last-update-wrapper %}
<h3>Last update:</h3>
<div>{{ update_date|date:"F j, Y, P" }} (<a href="http://www.timeanddate.com/worldclock/city.html?n=64">{{ update_date|date:"T" }}</a>)</div>
View
54 media/css/base.css
@@ -461,6 +461,54 @@ div.admonition-behind-the-scenes {
/* DOCS */
+#doc-versions {
+ position: fixed;
+ display: block;
+ padding: 0;
+ margin: 0;
+ bottom: 5px;
+ right: 5px;
+}
+
+#doc-versions:hover {
+ background: transparent url(../img/site/invisible.gif) repeat; /* IE7 hack */
+ border-radius: 3px;
+}
+
+#doc-versions li.other {
+ display: none;
+}
+
+#doc-versions li.other a {
+ display: block;
+ padding: 5px;
+}
+
+#doc-versions:hover li.other {
+ display: block;
+}
+
+#doc-versions li {
+ display: block;
+ float: left;
+ padding: 0;
+ margin: 0 0 0 7px;
+ background-color: #E0FFB8;
+ border: 4px #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;
+}
+
+#doc-versions li.current span {
+ display: block;
+ padding: 5px;
+}
+
#documentation h2,
#documentation h3,
#documentation h4 {
@@ -492,17 +540,17 @@ table.docutils td p {
}
div.versionadded,
div.versionchanged {
- font-size: 92%;
+ font-size: 92%;
color:#555;
}
div.versionadded span.title,
-div.versionchanged span.title {
+div.versionchanged span.title {
font-style: italic;
}
/* Verdana bold is too bold; lighten it to compensate */
#documentation #content-main p > strong,
#documentation #content-main p > b {
- color: #555;
+ color: #555;
}
/* Sphinx-specific fixes */
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.
View
BIN media/img/site/invisible.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 5153968

Please sign in to comment.