layout.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {% extends "basic/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. {# When building htmlhelp (CHM format) disable jQuery inclusion, #}
  19. {# as it causes problems in compiled CHM files. #}
  20. {% if builder != "htmlhelp" %}
  21. {{ super() }}
  22. <script src="{{ pathto('templatebuiltins.js', 1) }}"></script>
  23. <script>
  24. (function($) {
  25. if (!django_template_builtins) {
  26. // templatebuiltins.js missing, do nothing.
  27. return;
  28. }
  29. $(document).ready(function() {
  30. // Hyperlink Django template tags and filters
  31. var base = "{{ pathto('ref/templates/builtins') }}";
  32. if (base == "#") {
  33. // Special case for builtins.html itself
  34. base = "";
  35. }
  36. // Tags are keywords, class '.k'
  37. $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
  38. var tagname = $(elem).text();
  39. if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
  40. var fragment = tagname.replace(/_/, '-');
  41. $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
  42. }
  43. });
  44. // Filters are functions, class '.nf'
  45. $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
  46. var filtername = $(elem).text();
  47. if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
  48. var fragment = filtername.replace(/_/, '-');
  49. $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
  50. }
  51. });
  52. });
  53. })(jQuery);
  54. {%- if include_console_assets -%}
  55. (function($) {
  56. $(document).ready(function() {
  57. $(".c-tab-unix").on("click", function() {
  58. $("section.c-content-unix").show();
  59. $("section.c-content-win").hide();
  60. $(".c-tab-unix").prop("checked", true);
  61. });
  62. $(".c-tab-win").on("click", function() {
  63. $("section.c-content-win").show();
  64. $("section.c-content-unix").hide();
  65. $(".c-tab-win").prop("checked", true);
  66. });
  67. });
  68. })(jQuery);
  69. {%- endif -%}
  70. </script>
  71. {% endif %}
  72. {%- if include_console_assets -%}
  73. <link rel="stylesheet" href="{{ pathto('_static/console-tabs.css', 1) }}">
  74. {%- endif -%}
  75. {% endblock %}
  76. {% block document %}
  77. <div id="custom-doc" class="{% block bodyclass %}{{ 'yui-t6' if pagename != 'index' else '' }}{% endblock %}">
  78. <div id="hd">
  79. <h1><a href="{{ pathto('index') }}">{{ docstitle }}</a></h1>
  80. <div id="global-nav">
  81. <a title="Home page" href="{{ pathto('index') }}">Home</a> {{ reldelim2 }}
  82. <a title="Table of contents" href="{{ pathto('contents') }}">Table of contents</a> {{ reldelim2 }}
  83. <a title="Global index" href="{{ pathto('genindex') }}">Index</a> {{ reldelim2 }}
  84. <a title="Module index" href="{{ pathto('py-modindex') }}">Modules</a>
  85. </div>
  86. <div class="nav">{{ secondnav() }}</div>
  87. </div>
  88. <div id="bd">
  89. <div id="yui-main">
  90. <div class="yui-b">
  91. <div class="yui-g" id="{{ pagename|replace('/', '-') }}">
  92. {% block body %}{% endblock %}
  93. </div>
  94. </div>
  95. </div>
  96. {% block sidebarwrapper %}
  97. {% if pagename != 'index' %}
  98. <div class="yui-b" id="sidebar">
  99. {{ sidebar() }}
  100. {%- if last_updated %}
  101. <h3>Last update:</h3>
  102. <p class="topless">{{ last_updated }}</p>
  103. {%- endif %}
  104. </div>
  105. {% endif %}
  106. {% endblock %}
  107. </div>
  108. <div id="ft">
  109. <div class="nav">{{ secondnav() }}</div>
  110. </div>
  111. </div>
  112. {% endblock %}
  113. {% block sidebarrel %}
  114. <h3>Browse</h3>
  115. <ul>
  116. {% if prev %}
  117. <li>Prev: <a href="{{ prev.link }}">{{ prev.title }}</a></li>
  118. {% endif %}
  119. {% if next %}
  120. <li>Next: <a href="{{ next.link }}">{{ next.title }}</a></li>
  121. {% endif %}
  122. </ul>
  123. <h3>You are here:</h3>
  124. <ul>
  125. <li>
  126. <a href="{{ pathto('index') }}">{{ docstitle }}</a>
  127. {% for p in parents %}
  128. <ul><li><a href="{{ p.link }}">{{ p.title }}</a>
  129. {% endfor %}
  130. <ul><li>{{ title }}</li></ul>
  131. {% for p in parents %}</li></ul>{% endfor %}
  132. </li>
  133. </ul>
  134. {% endblock %}
  135. {# Empty some default blocks out #}
  136. {% block relbar1 %}{% endblock %}
  137. {% block relbar2 %}{% endblock %}
  138. {% block sidebar1 %}{% endblock %}
  139. {% block sidebar2 %}{% endblock %}
  140. {% block footer %}{% endblock %}