Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Dog-fooding staticfiles' static template tag.

  • Loading branch information...
commit 89b5cc54cbd1ad4ea512428197d1b788bfc3547a 1 parent ea90c98
Jannis Leidel jezdez authored
7 docs/templates/docs/doc.html
View
@@ -1,12 +1,13 @@
{% extends "base_docs.html" %}
{% load i18n %}
+{% load staticfiles %}
{% block title %}{{ doc.title|striptags|safe }} | {% trans "Django documentation" %}{% endblock %}
{% block extrahead %}
{{ block.super }}
- <link rel="stylesheet" href="{{ STATIC_URL }}css/docs/docs.css" type="text/css" />
- <link rel="stylesheet" href="{{ STATIC_URL }}css/pygments.css" type="text/css" />
+ <link rel="stylesheet" href="{% static "css/docs/docs.css" %}" type="text/css" />
+ <link rel="stylesheet" href="{% static "css/pygments.css" %}" type="text/css" />
{% endblock %}
{% block billboard %}
@@ -128,7 +129,7 @@ <h2 id="comments">{% trans "Questions/Feedback" %}</h2>
<p>
{% if version == "dev" %}{% trans "Offline (development version):" %}
{% else %}{% blocktrans %}Offline (Django {{ version }}):{% endblocktrans %}{% endif %}
- <a href="{{ STATIC_URL }}docs/django-docs-{{ version }}-{{ lang }}.zip">HTML</a> |
+ <a href="{% static zipfile_path %}">HTML</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>
<br>
3  docs/templates/docs/index.html
View
@@ -1,8 +1,9 @@
{% extends "docs/doc.html" %}
+{% load staticfiles %}
{% block extrahead %}
{{ block.super }}
- <link rel="stylesheet" href="{{ STATIC_URL }}css/docs/index.css" type="text/css" charset="utf-8">
+ <link rel="stylesheet" href="{% static "css/docs/index.css" %}" type="text/css" charset="utf-8">
{% endblock %}
{% block toc-wrapper %}{% endblock %}
3  docs/views.py
View
@@ -60,10 +60,11 @@ def document(request, lang, version, url):
'env': json.load(open(docroot.child('globalcontext.json'), 'rb')),
'lang': lang,
'version': version,
+ 'zipfile_path': 'docs/django-docs-%s-%s.zip' % (version, lang),
'rtd_version': rtd_version,
'docurl': url,
'update_date': datetime.datetime.fromtimestamp(docroot.child('last_build').mtime()),
- 'home': urlresolvers.reverse('document-index', kwargs={'lang':lang, 'version':version}),
+ 'home': urlresolvers.reverse('document-index', kwargs={'lang': lang, 'version': version}),
'redirect_from': request.GET.get('from', None),
}))
10 templates/base.html
View
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+{% load staticfiles %}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
@@ -11,14 +11,16 @@
<meta name="Copyright" content="Django Software Foundation" />
<meta name="keywords" content="Python, Django, framework, open-source" />
<meta name="description" content="Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design." />
- <link href="{{ STATIC_URL }}css/{% block cssid %}base{% endblock %}.css" rel="stylesheet" type="text/css" media="screen" />
- <link href="{{ STATIC_URL }}css/print.css" rel="stylesheet" type="text/css" media="print" />
+ {% block basecss %}
+ <link href="{% static "css/base.css" %}" rel="stylesheet" type="text/css" media="screen" />
+ {% endblock basecss %}
+ <link href="{% static "css/print.css" %}" rel="stylesheet" type="text/css" media="print" />
{% block extrahead %}{% endblock %}
</head>
<body id="{% block sectionid %}generic{% endblock %}" class="{% block coltype %}default{% endblock %}">
<div id="container">
<div id="header">
- <h1 id="logo"><a href="https://www.djangoproject.com/"><img src="{{ STATIC_URL }}img/site/hdr_logo.gif" alt="Django" /></a></h1>
+ <h1 id="logo"><a href="https://www.djangoproject.com/"><img src="{% static "img/site/hdr_logo.gif" %}" alt="Django" /></a></h1>
<ul id="nav-global">
<li id="nav-homepage"><a href="https://www.djangoproject.com/">Home</a></li>
<li id="nav-download"><a href="https://www.djangoproject.com/download/">Download</a></li>
3  templates/base_code.html
View
@@ -1,7 +1,8 @@
{% extends "base_2col.html" %}
+{% load staticfiles %}
{% block sectionid %}code{% endblock %}
{% block title %}Code{% endblock %}
-{% block billboard %}<h2><a href="https://code.djangoproject.com/"><img src="{{ STATIC_URL }}img/site/bbd_code.gif" alt="Django source code" /></a></h2>{% endblock %}
+{% block billboard %}<h2><a href="https://code.djangoproject.com/"><img src="{% static "img/site/bbd_code.gif" %}" alt="Django source code" /></a></h2>{% endblock %}
5 templates/homepage.html
View
@@ -1,6 +1,9 @@
{% extends "base_3col.html" %}
+{% load staticfiles %}
-{% block cssid %}homepage{% endblock %}
+{% block basecss %}
+<link href="{% static "css/homepage.css" %}" rel="stylesheet" type="text/css" media="screen" />
+{% endblock basecss %}
{% block sectionid %}homepage{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.