| 1 |
{# |
| 2 |
cloud/layout.html |
| 3 |
~~~~~~~~~~~~~~~~~ |
| 4 |
|
| 5 |
Sphinx layout template for the cloud theme. |
| 6 |
|
| 7 |
:copyright: Copyright 2009-2011 Assurance Technologies LLC |
| 8 |
:license: BSD |
| 9 |
|
| 10 |
roottarget - optional target for root link (default to toc) |
| 11 |
logotarget - optional target for logo link (defaults to root target) |
| 12 |
googleanalytics_id - if set, enabled google analytics snippet & footer |
| 13 |
googleanalytics_path - optional subpatch for GA cookie |
| 14 |
|
| 15 |
#} |
| 16 |
|
| 17 |
{% extends "basic/layout.html" %} |
| 18 |
|
| 19 |
{% set reldelim2 = reldim2 is not defined and ' ' or reldelim2 %} |
| 20 |
|
| 21 |
{# compat hack for sphinx < 1.8 #} |
| 22 |
{% macro compat_js_tag(asset) %} |
| 23 |
{% if js_tag is undefined %} {# sphinx 1.6 / 1.7 #} |
| 24 |
<script type="text/javascript" src="{{ pathto(asset, 1) }}"></script> |
| 25 |
{% else %} {# sphinx >= 1.8.0 #} |
| 26 |
{{ js_tag(asset) }} |
| 27 |
{% endif %} |
| 28 |
{% endmacro %} |
| 29 |
|
| 30 |
{%- block scripts %} |
| 31 |
{{ super() }} |
| 32 |
|
| 33 |
{# add script file to instrument collapsable sections and other features #} |
| 34 |
{{ compat_js_tag("_static/jquery.cookie.js") }} |
| 35 |
{{ compat_js_tag("_static/cloud.base.js") }} |
| 36 |
{{ compat_js_tag("_static/cloud.js") }} |
| 37 |
|
| 38 |
{%- endblock %} |
| 39 |
|
| 40 |
{# add font stylesheets #} |
| 41 |
{% set css_files = css_files + [theme_fontcssurl] %} |
| 42 |
|
| 43 |
{# make root link redirectable #} |
| 44 |
{%- set theme_roottarget = (theme_roottarget == "<toc>" and master_doc or theme_roottarget) %} |
| 45 |
{% block rootrellink %} |
| 46 |
<li><a href="{{ pathto(theme_roottarget) }}">{{shorttitle|e}}</a>{{reldelim1}}</li> |
| 47 |
{% endblock %} |
| 48 |
|
| 49 |
{# make logo link redirectable #} |
| 50 |
{%- set theme_logotarget = (theme_logotarget == "<root>" and theme_roottarget or (theme_logotarget == "<toc>" and master_doc or theme_logotarget)) %} |
| 51 |
{%- block sidebarlogo %} |
| 52 |
{%- if logo %} |
| 53 |
<p class="logo"><a href="{{ pathto(theme_logotarget) }}" title="{{ theme_logotarget }}"> |
| 54 |
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> |
| 55 |
</a></p> |
| 56 |
{%- endif %} |
| 57 |
{%- endblock %} |
| 58 |
|
| 59 |
{# wrap relbars in distinct classes to make themeing easier #} |
| 60 |
{%- block relbar1 %} |
| 61 |
<div class="relbar-top"> |
| 62 |
{{ super() }} |
| 63 |
</div> |
| 64 |
{% endblock %} |
| 65 |
|
| 66 |
{%- block relbar2 %} |
| 67 |
<div class="relbar-bottom"> |
| 68 |
{{ super() }} |
| 69 |
</div> |
| 70 |
{% endblock %} |
| 71 |
|
| 72 |
{% block extrahead -%} |
| 73 |
{{ super() }} |
| 74 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 75 |
{%- if theme_googleanalytics_id -%} |
| 76 |
<script type="text/javascript"> |
| 77 |
var ga_enabled = !$.cookie('disable-ga'); |
| 78 |
if(ga_enabled){ |
| 79 |
var _gaq = _gaq || []; |
| 80 |
_gaq.push(['_setAccount', '{{ theme_googleanalytics_id }}']); |
| 81 |
_gaq.push(['_setCookiePath', '{{ theme_googleanalytics_path }}']); |
| 82 |
_gaq.push(['_setDetectFlash', false]); |
| 83 |
_gaq.push(['_trackPageview']); |
| 84 |
(function() { |
| 85 |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
| 86 |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
| 87 |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
| 88 |
})(); |
| 89 |
} |
| 90 |
</script> |
| 91 |
{%- endif %} |
| 92 |
{%- endblock %} |
| 93 |
|
| 94 |
{% block body -%} |
| 95 |
{# hack to insert lang=en in scope of div.body #} |
| 96 |
{% if theme_hyphenation_langage %} |
| 97 |
<div lang="{{ theme_hyphenation_language }}">{{ super() }}</div> |
| 98 |
{% endif %} |
| 99 |
{%- endblock %} |
| 100 |
|
| 101 |
{% block sidebar2 -%} |
| 102 |
{{ super() }} |
| 103 |
{# insert markup for sidebar toggle button #} |
| 104 |
{% block sidebartoggle %} |
| 105 |
<div class="sidebar-toggle-group no-js"> |
| 106 |
{% set right = theme_rightsidebar|tobool %} |
| 107 |
<button class="sidebar-toggle" id="sidebar-hide" title="Hide the sidebar menu"> |
| 108 |
{% if not right %} «{% endif %} |
| 109 |
<span class="show-for-small">hide menu</span> |
| 110 |
{% if right %} »{% endif %} |
| 111 |
</button> |
| 112 |
<button class="sidebar-toggle" id="sidebar-show" title="Show the sidebar menu"> |
| 113 |
{% if right %} «{% endif %} |
| 114 |
<span class="show-for-small">menu</span> |
| 115 |
<span class="hide-for-small">sidebar</span> |
| 116 |
{% if not right %} »{% endif %} |
| 117 |
</button> |
| 118 |
</div> |
| 119 |
{% endblock %} |
| 120 |
{%- endblock %} |
| 121 |
|
| 122 |
{% block footer -%} |
| 123 |
{{ super() }} |
| 124 |
{%- if theme_googleanalytics_id -%} |
| 125 |
<script type="text/javascript"> |
| 126 |
if(ga_enabled){ |
| 127 |
document.write("<div class=\"footer\">This page uses <a href=\"http://analytics.google.com\">Google Analytics</a> to collect statistics. "); |
| 128 |
document.write("Click <button title=\"set cookie to disable analytics for this site\" class=\"link\" onclick=\"$.cookie('disable-ga', 'true', {expires: 3650, path: '{{ theme_googleanalytics_path }}'}); window.location.reload(); return false; \">here</button> to disable analytics for this site."); |
| 129 |
document.write("</div>"); |
| 130 |
}else{ |
| 131 |
document.write("<div class=\"footer\">Google Analytics has been disabled. "); |
| 132 |
document.write("Click <button title=\"set cookie to re-enable analytics for this site\" class=\"link\" onclick=\"$.cookie('disable-ga', null, {path: '{{ theme_googleanalytics_path }}'}); window.location.reload(); return false; \">here</button> to re-enable analytics for this site."); |
| 133 |
}; |
| 134 |
</script> |
| 135 |
{%- endif %} |
| 136 |
<!-- cloud_sptheme 1.4 --> |
| 137 |
{%- endblock %} |