Added new version of bootstrap theme
[e_cidadania.git] / docs / _templates / bootstrap / layout.html
blob8bc387f2e4e501ef3a1575c9028bd3f387dd1441
1 {% extends "basic/layout.html" %}
2 {% set script_files = script_files + ['_static/bootstrap.js'] %}
3 {% set css_files = ['_static/bootstrap.css', '_static/bootstrap-sphinx.css'] + css_files %}
5 {# Sidebar: Rework into our Boostrap nav section. #}
6 {% macro navBar() %}
7 <div id="navbar" class="navbar navbar-fixed-top">
8 <div class="navbar-inner">
9 <div class="container-fluid">
10 <a class="brand" href="{{ pathto(master_doc) }}">{{ project|e }}</a>
11 <span class="navbar-text pull-left"><b>{{ version|e }}</b></span>
12 <ul class="nav">
13 <li class="divider-vertical"></li>
14 {% block sidebartoc %}
15 {% include "globaltoc.html" %}
16 {% include "localtoc.html" %}
17 {% endblock %}
18 {% block sidebarrel %}
19 {% include "relations.html" %}
20 {% endblock %}
21 {% block sidebarsourcelink %}
22 {% include "sourcelink.html" %}
23 {% endblock %}
24 </ul>
25 {% block sidebarsearch %}
26 {% include "searchbox.html" %}
27 {% endblock %}
28 </ul>
29 </div>
30 </div>
31 </div>
32 </div>
33 {% endmacro %}
35 {%- block extrahead %}
36 <script type="text/javascript">
37 (function () {
38 /**
39 * Patch TOC list.
41 * Will mutate the underlying span to have a correct ul for nav.
43 * @param $span: Span containing nested UL's to mutate.
44 * @param minLevel: Starting level for nested lists. (1: global, 2: local).
46 var patchToc = function ($ul, minLevel) {
47 var findA;
49 // Find all a "internal" tags, traversing recursively.
50 findA = function ($elem, level) {
51 var level = level || 0,
52 $items = $elem.find("> li > a.internal, > ul, > li > ul");
54 // Iterate everything in order.
55 $items.each(function (index, item) {
56 var $item = $(item),
57 tag = item.tagName.toLowerCase(),
58 pad = 15 + ((level - minLevel) * 10);
60 if (tag === 'a' && level >= minLevel) {
61 // Add to existing padding.
62 $item.css('padding-left', pad + "px");
63 console.log(level, $item, 'padding-left', pad + "px");
64 } else if (tag === 'ul') {
65 // Recurse.
66 findA($item, level + 1);
68 });
71 console.log("HERE");
72 findA($ul);
75 $(document).ready(function () {
76 // Add styling, structure to TOC's.
77 $(".dropdown-menu").each(function () {
78 $(this).find("ul").each(function (index, item){
79 var $item = $(item);
80 $item.addClass('unstyled');
81 });
82 $(this).find("li").each(function () {
83 $(this).parent().append(this);
84 });
85 });
87 // Patch in level.
88 patchToc($("ul.globaltoc"), 2);
89 patchToc($("ul.localtoc"), 2);
91 // Enable dropdown.
92 $('.dropdown-toggle').dropdown();
93 });
94 }());
95 </script>
96 {% endblock %}
98 {% block header %}{{ navBar() }}{% endblock %}
100 {# Silence the sidebar's, relbar's #}
101 {% block sidebar1 %}{% endblock %}
102 {% block sidebar2 %}{% endblock %}
103 {% block relbar1 %}{% endblock %}
104 {% block relbar2 %}{% endblock %}
106 {%- block content %}
107 <div class="container">
108 {% block body %} {% endblock %}
109 </div>
110 {%- endblock %}
112 {%- block footer %}
113 <footer class="footer">
114 <div class="container">
115 <p class="pull-right"><a href="#">Back to top</a></p>
117 {%- if show_copyright %}
118 {%- if hasdoc('copyright') %}
119 {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}<br/>
120 {%- else %}
121 {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}<br/>
122 {%- endif %}
123 {%- endif %}
124 {%- if last_updated %}
125 {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/>
126 {%- endif %}
127 {%- if show_sphinx %}
128 {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}<br/>
129 {%- endif %}
130 </p>
131 </div>
132 </footer>
133 {%- endblock %}