Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Improved the dev doc warning after feedback from IRC. Refs #20518.

  • Loading branch information...
commit 50bfb57e9e4a97fd95fa1abab9a1ad8d0f89f178 1 parent 720b325
Jannis Leidel authored June 20, 2013
35  docs/templates/docs/doc.html
@@ -4,6 +4,19 @@
4 4
 
5 5
 {% block title %}{{ doc.title|striptags|safe }} | {% trans "Django documentation" %}{% endblock %}
6 6
 
  7
+{% block extrabody %}
  8
+{% if version == 'dev' %}
  9
+  <div class="dev-warning">
  10
+   {% trans "This document is for Django's development version, which can be significantly different from previous releases. Use the version selector in the bottom right corner for older releases." %}
  11
+  </div>
  12
+  <style type="text/css" media="screen">
  13
+  body {
  14
+    margin-top: 2em;
  15
+  }
  16
+  </style>
  17
+  {% endif %}
  18
+{% endblock extrabody %}
  19
+
7 20
 {% block extrahead %}
8 21
   {{ block.super }}
9 22
   <link rel="stylesheet" href="{% static "css/docs/docs.css" %}" type="text/css" />
@@ -18,22 +31,6 @@
18 31
 
19 32
 {% block body %}
20 33
   {% load docs %}
21  
-  {% if version == 'dev' %}
22  
-  <style type="text/css" media="screen">
23  
-    #content-main {
24  
-      background-size: 50px 50px;
25  
-      background-color: #fff;
26  
-      background-image: -webkit-linear-gradient(-45deg, rgba(0, 0, 0, .02) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .02) 50%, rgba(0, 0, 0, .02) 75%, transparent 75%, transparent);
27  
-      background-image: -moz-linear-gradient(-45deg, rgba(0, 0, 0, .02) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .02) 50%, rgba(0, 0, 0, .02) 75%, transparent 75%, transparent);
28  
-      background-image: linear-gradient(135deg, rgba(0, 0, 0, .02) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .02) 50%, rgba(0, 0, 0, .02) 75%, transparent 75%, transparent);
29  
-  }
30  
-  </style>
31  
-  <div class="admonition warning">
32  
-    <p>{% trans "This document is for Django's in-development version, which can be significantly different from previous releases." %}</p>
33  
-    <p>{% trans "Use the version selector in the bottom right corner to see older versions." %}</p>
34  
-  </div>
35  
-
36  
-  {% endif %}
37 34
   {% get_all_doc_versions docurl as versions %}
38 35
   <ul id="doc-versions">
39 36
       {% for v in versions %}
@@ -47,10 +44,12 @@
47 44
           </li>
48 45
         {% endif %}
49 46
       {% endfor %}
50  
-      <li class="current"
  47
+      <li class="current{% if version == 'dev' %} dev{% endif %}"
51 48
           title="{% if version == 'dev' %}{% trans "This document is for Django's development version, which can be significantly different from previous releases." %}{% else %}{% blocktrans %}This document describes Django {{ version }}.{% endblocktrans %}{% endif %} {% trans "Click on the links on the left to see other versions." %}">
52 49
         <span>{% trans "Documentation version:" %}
53  
-          <strong>{{ version }}</strong>
  50
+          <strong>{% if version == 'dev' %}
  51
+            development{% else %}{{ version }}
  52
+          {% endif %}</strong>
54 53
         </span>
55 54
       </li>
56 55
   </ul>
16  static/css/base.css
@@ -531,6 +531,22 @@ div.admonition.warning {
531 531
     padding: 5px;
532 532
 }
533 533
 
  534
+.dev-warning {
  535
+  position:fixed;
  536
+  top: 0;
  537
+  width: 100%;
  538
+  padding: 5px 7px;
  539
+  background-size: 50px 50px;
  540
+  background-color: #ffe761;
  541
+  color: #000;
  542
+  border-bottom: 2px solid #ae9e49;
  543
+  font-size: 12px;
  544
+  background-image: -webkit-linear-gradient(-45deg, rgba(0, 0, 0, .04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .04) 50%, rgba(0, 0, 0, .04) 75%, transparent 75%, transparent);
  545
+  background-image: -moz-linear-gradient(-45deg, rgba(0, 0, 0, .04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .04) 50%, rgba(0, 0, 0, .04) 75%, transparent 75%, transparent);
  546
+  background-image: linear-gradient(135deg, rgba(0, 0, 0, .04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .04) 50%, rgba(0, 0, 0, .04) 75%, transparent 75%, transparent);
  547
+}
  548
+
  549
+
534 550
 #documentation h2,
535 551
 #documentation h3,
536 552
 #documentation h4 {
1  templates/base.html
@@ -49,6 +49,7 @@ <h1 id="logo"><a href="https://www.djangoproject.com/"><img src="{% static "img/
49 49
     <!-- END #footer -->
50 50
   </div>
51 51
   <!-- END #container -->
  52
+  {% block extrabody %}{% endblock extrabody %}
52 53
   </body>
53 54
 </html>
54 55
 

0 notes on commit 50bfb57

Trey Hunner

I've never noticed this selector and it took me a while to find it. I kept scrolling up and down looking for it because I didn't notice it was floating.

Maybe the wording could be improved.

I suggest:

For older releases, use the version selector floating in the bottom right corner of this page.

Jannis Leidel

Sure, don't hesitate to send a pull request..

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