Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 2bedb31a04017f7693f2710be0c4dd933a6a7a51 2 parents a28aac0 + 5153968
Julien Phalip authored September 29, 2011 jacobian committed September 29, 2011
23  django_website/docs/templates/docs/doc.html
@@ -17,21 +17,14 @@
17 17
 {% block body %}
18 18
   {% load docs %}
19 19
   {% get_all_doc_versions docurl as versions %}
20  
-  <h2 class="deck">
21  
-    {% if version == "dev" %}
22  
-      This document is for Django's development version, which can be
23  
-      significantly different from previous releases. Get older docs here:
24  
-      {% for version in versions %}
25  
-        {% if version != "dev" %}
26  
-          <a href="{% url document-detail lang=lang, version=version, url=docurl %}">
27  
-            {{ version }}</a>{% if forloop.last %}.{% else %},{% endif %}
  20
+  <ul id="doc-versions">
  21
+      {% for v in versions reversed %}
  22
+        {% if version != v %}
  23
+          <li class="other"><a href="{% url document-detail lang=lang, version=v, url=docurl %}">{{ v|upper }}</a></li>
28 24
         {% endif %}
29 25
       {% endfor %}
30  
-    {% else %}
31  
-      This document describes Django {{ version }}. For development docs, 
32  
-      <a href="{% url document-detail lang=lang, version="dev", url=docurl %}">go here</a>.
33  
-    {% endif %}
34  
-  </h2>
  26
+      <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>
  27
+  </ul>
35 28
   {{ doc.body|safe }}
36 29
 {% endblock %}
37 30
 
@@ -40,7 +33,7 @@ <h2 id="comments">Questions/Feedback</h2>
40 33
   <p>Having trouble? We'd like to help!</p>
41 34
   <ul>
42 35
     <li>
43  
-      Try the <a href="{% url document-detail lang=lang, version=version, url="faq" %}">FAQ</a> 
  36
+      Try the <a href="{% url document-detail lang=lang, version=version, url="faq" %}">FAQ</a>
44 37
       — it's got answers to many common questions.
45 38
     </li>
46 39
     <li>
@@ -95,7 +88,7 @@ <h2 id="comments">Questions/Feedback</h2>
95 88
       {% endblock %}
96 89
     </ul>
97 90
   {% endblock %}
98  
-  
  91
+
99 92
   {% block breadcrumbs-wrapper %}
100 93
     <h2>You are here:</h2>
101 94
     <ul>
54  media/css/base.css
@@ -461,6 +461,54 @@ div.admonition-behind-the-scenes {
461 461
 
462 462
 /* DOCS */
463 463
 
  464
+#doc-versions {
  465
+    position: fixed;
  466
+    display: block;
  467
+    padding: 0;
  468
+    margin: 0;
  469
+    bottom: 5px;
  470
+    right: 5px;
  471
+}
  472
+
  473
+#doc-versions:hover {
  474
+    background: transparent url(../img/site/invisible.gif) repeat; /* IE7 hack */
  475
+    border-radius: 3px;
  476
+}
  477
+
  478
+#doc-versions li.other {
  479
+    display: none;
  480
+}
  481
+
  482
+#doc-versions li.other a {
  483
+    display: block;
  484
+    padding: 5px;
  485
+}
  486
+
  487
+#doc-versions:hover li.other {
  488
+    display: block;
  489
+}
  490
+
  491
+#doc-versions li {
  492
+    display: block;
  493
+    float: left;
  494
+    padding: 0;
  495
+    margin: 0 0 0 7px;
  496
+    background-color: #E0FFB8;
  497
+    border: 4px #487858 solid;
  498
+    border-radius: 3px;
  499
+    color: #234F32;
  500
+}
  501
+
  502
+#doc-versions li.current {
  503
+    background: #E0FFB8 url(../img/site/arrow-head-left.gif) 7px center no-repeat;
  504
+    padding-left: 15px;
  505
+}
  506
+
  507
+#doc-versions li.current span {
  508
+    display: block;
  509
+    padding: 5px;
  510
+}
  511
+
464 512
 #documentation h2,
465 513
 #documentation h3,
466 514
 #documentation h4 {
@@ -492,17 +540,17 @@ table.docutils td p {
492 540
 }
493 541
 div.versionadded,
494 542
 div.versionchanged {
495  
-    font-size: 92%; 
  543
+    font-size: 92%;
496 544
     color:#555;
497 545
 }
498 546
 div.versionadded span.title,
499  
-div.versionchanged span.title { 
  547
+div.versionchanged span.title {
500 548
     font-style: italic;
501 549
 }
502 550
 /* Verdana bold is too bold; lighten it to compensate */
503 551
 #documentation #content-main p > strong,
504 552
 #documentation #content-main p > b {
505  
-    color: #555; 
  553
+    color: #555;
506 554
 }
507 555
 
508 556
 /* Sphinx-specific fixes */
BIN  media/img/site/arrow-head-left.gif
BIN  media/img/site/invisible.gif

0 notes on commit 2bedb31

Please sign in to comment.
Something went wrong with that request. Please try again.