Commit 64523f1e by Dougal Matthews

Update the Documentation 404.html template to subclass base.html

This allows us to delete lots of code and avoid hard-coding the
navigation. This does mean that {{ current_page }} isn't always
available and needs to be conditionally used.
parent 24855f70
......@@ -8,7 +8,7 @@
<link href="{{ base_url }}/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="{{ canonical_url }}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Django, API, REST, {{ current_page.title }}">
<meta name="description" content="Django, API, REST{% if current_page %}, {{ current_page.title }}{% endif %}">
<meta name="author" content="Tom Christie">
<!-- Le styles -->
......@@ -54,7 +54,7 @@
}
</style>
</head>
<body onload="prettyPrint()" class="{% if current_page.is_homepage %}index{% endif %}-page">
<body onload="prettyPrint()" class="{% if current_page and current_page.is_homepage %}index{% endif %}-page">
<div class="wrapper">
......@@ -104,7 +104,7 @@
<div id="table-of-contents">
<ul class="nav nav-list side-nav well sidebar-nav-fixed">
{% if current_page.is_homepage %}
{% if current_page and current_page.is_homepage %}
<li class="main">
<a href="#">Django REST framework</a>
</li>
......@@ -112,7 +112,7 @@
{% for toc_item in toc %}
<li class="{% if not current_page.is_homepage %}main{% endif %}">
<li class="{% if current_page and not current_page.is_homepage %}main{% endif %}">
<a href="{{ toc_item.url }}">{{ toc_item.title }}</a>
</li>
......@@ -124,7 +124,7 @@
{% endfor %}
{% if current_page.is_homepage %}
{% if current_page and current_page.is_homepage %}
<div class="promo">
<hr/>
<script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script>
......@@ -137,6 +137,9 @@
</div>
<div id="main-content" class="span9">
{% block content %}
{% if meta.source %}
{% for filename in meta.source %}
<a class="github" href="https://github.com/tomchristie/django-rest-framework/tree/master/rest_framework/{{ filename }}">
......@@ -146,6 +149,9 @@
{% endif %}
{{ content }}
{% endblock %}
</div>
<!--/span-->
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment