Changeset 8470
- Timestamp:
- 08/22/08 15:08:26 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
djangoproject.com/djangodocs/templates/docs/doc.html
r8454 r8470 50 50 <li>Next: <a href="{{ doc.next.link }}">{{ doc.next.title }}</a></li> 51 51 {% endif %} 52 <li><a href="{{ home }}contents/">Table of contents</a></li> 52 53 {% for doc, title, accesskey, shorttitle in env.rellinks %} 53 54 <li><a href="{{ home }}{{ doc }}/">{{ title }}</a></li> djangoproject.com/djangodocs/views.py
r8452 r8470 32 32 33 33 # First look for <bits>/index.fpickle, then for <bits>.fpickle 34 bits = url.strip('/').split('/') 35 doc = docroot.child(* (bits+['index.fpickle']))34 bits = url.strip('/').split('/') + ['index.fpickle'] 35 doc = docroot.child(*bits) 36 36 if not doc.exists(): 37 doc = docroot.child(*bits[:-1] + ["%s.fpickle" % bits[-1]]) 37 bits = bits[:-2] + ['%s.fpickle' % bits[-2]] 38 doc = docroot.child(*bits) 38 39 if not doc.exists(): 39 40 raise Http404("'%s' does not exist" % doc) 40 41 # Build up a list of templates to search for so that if the page is 42 # "ref/models", the list will be ["docs/ref/models.html", "docs/ref.html"] 41 43 42 bits[-1] = bits[-1].replace('.fpickle', '') 44 templates = ["docs/%s.html" % "/".join(bits[:-i+1]) for i in range(len(bits))] 45 return render_to_response(templates + ['docs/doc.html'], { 43 template_names = [ 44 'docs/%s.html' % '-'.join([b for b in bits if b]), 45 'docs/doc.html' 46 ] 47 return render_to_response(template_names, { 46 48 'doc': pickle.load(open(doc)), 47 49 'env': pickle.load(open(docroot.child('globalcontext.pickle'))),
