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 @@ ...@@ -8,7 +8,7 @@
<link href="{{ base_url }}/img/favicon.ico" rel="icon" type="image/x-icon"> <link href="{{ base_url }}/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="{{ canonical_url }}" /> <link rel="canonical" href="{{ canonical_url }}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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"> <meta name="author" content="Tom Christie">
<!-- Le styles --> <!-- Le styles -->
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
} }
</style> </style>
</head> </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"> <div class="wrapper">
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<div id="table-of-contents"> <div id="table-of-contents">
<ul class="nav nav-list side-nav well sidebar-nav-fixed"> <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"> <li class="main">
<a href="#">Django REST framework</a> <a href="#">Django REST framework</a>
</li> </li>
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
{% for toc_item in toc %} {% 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> <a href="{{ toc_item.url }}">{{ toc_item.title }}</a>
</li> </li>
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
{% endfor %} {% endfor %}
{% if current_page.is_homepage %} {% if current_page and current_page.is_homepage %}
<div class="promo"> <div class="promo">
<hr/> <hr/>
<script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script> <script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script>
...@@ -137,15 +137,21 @@ ...@@ -137,15 +137,21 @@
</div> </div>
<div id="main-content" class="span9"> <div id="main-content" class="span9">
{% if meta.source %}
{% for filename in meta.source %} {% block content %}
<a class="github" href="https://github.com/tomchristie/django-rest-framework/tree/master/rest_framework/{{ filename }}">
<span class="label label-info">{{ filename }}</span> {% if meta.source %}
</a> {% for filename in meta.source %}
{% endfor %} <a class="github" href="https://github.com/tomchristie/django-rest-framework/tree/master/rest_framework/{{ filename }}">
{% endif %} <span class="label label-info">{{ filename }}</span>
</a>
{{ content }} {% endfor %}
{% endif %}
{{ content }}
{% endblock %}
</div> </div>
<!--/span--> <!--/span-->
</div> </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