layout.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. {% extends "!layout.html" %}
  2. {%- macro secondnav() %}
  3. {%- if prev %}
  4. &laquo; <a href="{{ prev.link|e }}" title="{{ prev.title|e }}">previous</a>
  5. {{ reldelim2 }}
  6. {%- endif %}
  7. {%- if parents %}
  8. <a href="{{ parents.0.link|e }}" title="{{ parents.0.title|e }}" accesskey="U">up</a>
  9. {%- else %}
  10. <a title="{{ docstitle }}" href="{{ pathto('index') }}" accesskey="U">up</a>
  11. {%- endif %}
  12. {%- if next %}
  13. {{ reldelim2 }}
  14. <a href="{{ next.link|e }}" title="{{ next.title|e }}">next</a> &raquo;
  15. {%- endif %}
  16. {%- endmacro %}
  17. {% block extrahead %}
  18. {{ super() }}
  19. <script type="text/javascript" src="{{ pathto('templatebuiltins.js', 1) }}"></script>
  20. <script type="text/javascript">
  21. (function($) {
  22. if (!django_template_builtins) {
  23. // templatebuiltins.js missing, do nothing.
  24. return;
  25. }
  26. $(document).ready(function() {
  27. // Hyperlink Django template tags and filters
  28. var base = "{{ pathto('ref/templates/builtins') }}";
  29. if (base == "#") {
  30. // Special case for builtins.html itself
  31. base = "";
  32. }
  33. // Tags are keywords, class '.k'
  34. $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
  35. var tagname = $(elem).text();
  36. if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
  37. var fragment = tagname.replace(/_/, '-');
  38. $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
  39. }
  40. });
  41. // Filters are functions, class '.nf'
  42. $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
  43. var filtername = $(elem).text();
  44. if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
  45. var fragment = filtername.replace(/_/, '-');
  46. $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
  47. }
  48. });
  49. });
  50. })(jQuery);
  51. </script>
  52. {% endblock %}
  53. {% block document %}
  54. <div id="custom-doc" class="{% block bodyclass %}{{ 'yui-t6' if pagename != 'index' else '' }}{% endblock %}">
  55. <div id="hd">
  56. <h1><a href="{{ pathto('index') }}">{{ docstitle }}</a></h1>
  57. <div id="global-nav">
  58. <a title="Home page" href="{{ pathto('index') }}">Home</a> {{ reldelim2 }}
  59. <a title="Table of contents" href="{{ pathto('contents') }}">Table of contents</a> {{ reldelim2 }}
  60. <a title="Global index" href="{{ pathto('genindex') }}">Index</a> {{ reldelim2 }}
  61. <a title="Module index" href="{{ pathto('modindex') }}">Modules</a>
  62. </div>
  63. <div class="nav">{{ secondnav() }}</div>
  64. </div>
  65. <div id="bd">
  66. <div id="yui-main">
  67. <div class="yui-b">
  68. <div class="yui-g" id="{{ pagename|replace('/', '-') }}">
  69. {% block body %}{% endblock %}
  70. </div>
  71. </div>
  72. </div>
  73. {% block sidebarwrapper %}
  74. {% if pagename != 'index' %}
  75. <div class="yui-b" id="sidebar">
  76. {{ sidebar() }}
  77. {%- if last_updated %}
  78. <h3>Last update:</h3>
  79. <p class="topless">{{ last_updated }}</p>
  80. {%- endif %}
  81. </div>
  82. {% endif %}
  83. {% endblock %}
  84. </div>
  85. <div id="ft">
  86. <div class="nav">{{ secondnav() }}</div>
  87. </div>
  88. </div>
  89. {% endblock %}
  90. {% block sidebarrel %}
  91. <h3>Browse</h3>
  92. <ul>
  93. {% if prev %}
  94. <li>Prev: <a href="{{ prev.link }}">{{ prev.title }}</a></li>
  95. {% endif %}
  96. {% if next %}
  97. <li>Next: <a href="{{ next.link }}">{{ next.title }}</a></li>
  98. {% endif %}
  99. </ul>
  100. <h3>You are here:</h3>
  101. <ul>
  102. <li>
  103. <a href="{{ pathto('index') }}">{{ docstitle }}</a>
  104. {% for p in parents %}
  105. <ul><li><a href="{{ p.link }}">{{ p.title }}</a>
  106. {% endfor %}
  107. <ul><li>{{ title }}</li></ul>
  108. {% for p in parents %}</li></ul>{% endfor %}
  109. </li>
  110. </ul>
  111. {% endblock %}
  112. {# Empty some default blocks out #}
  113. {% block relbar1 %}{% endblock %}
  114. {% block relbar2 %}{% endblock %}
  115. {% block sidebar1 %}{% endblock %}
  116. {% block sidebar2 %}{% endblock %}
  117. {% block footer %}{% endblock %}