{% extends "basic/layout.html" %}

{%- macro sidebar2() %}
      {%- if builder != 'htmlhelp' %}
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
          {%- block sidebarlogo %}
          {%- if logo %}
            <p class="logo"><img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/></p>
          {%- endif %}
          {%- endblock %}
          {%- block sidebartoc %}
          {%- if display_toc %}
            <h3>Table Of Contents</h3>
            {{ toc }}
          {%- endif %}
          {%- endblock %}
          {%- block changelog %}
          <h3>Changelog</h3>
          <p class="topless"><a href="{{ pathto('changes/changelog') }}">Latest releases</a></p>
          {%- endblock %}
          {%- block sidebarrel %}
          {%- if prev %}
            <h4>Previous topic</h4>
            <p class="topless"><a href="{{ prev.link|e }}" title="previous chapter">{{ prev.title }}</a></p>
          {%- endif %}
          {%- if next %}
            <h4>Next topic</h4>
            <p class="topless"><a href="{{ next.link|e }}" title="next chapter">{{ next.title }}</a></p>
          {%- endif %}
          {%- endblock %}
          {%- if sourcename %}
            <!--<h3>This Page</h3>
            <ul class="this-page-menu">
            {%- if builder == 'web' %}
              <li><a href="#comments">Comments ({{ comments|length }} so far)</a></li>
              <li><a href="{{ pathto('@edit/' + sourcename)|e }}">Suggest Change</a></li>
              <li><a href="{{ pathto('@source/' + sourcename)|e }}">Show Source</a></li>
            {%- elif builder == 'html' %}
              <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">Show Source</a></li>
            {%- endif %}
            </ul>-->
          {%- endif %}
          {%- if customsidebar %}
          {{ rendertemplate(customsidebar) }}
          {%- endif %}
          {%- block sidebarsearch %}
          {%- if pagename != "search" %}
            <h3>{{ builder == 'web' and 'Keyword' or 'Quick' }} search</h3>
            <form class="search" action="{{ pathto('search') }}" method="get">
              <input type="text" name="q" size="18" /> <input type="submit" value="Go" />
              <input type="hidden" name="check_keywords" value="yes" />
              <input type="hidden" name="area" value="default" />
            </form>
            {%- if builder == 'web' %}
            <p style="font-size: 90%">Enter a module, class or function name.</p>
            {%- endif %}
          {%- endif %}
          {%- endblock %}
        </div>
      </div>
      {%- endif %}
{%- endmacro -%}

{%- block extrahead %}
<!--[if lte IE 6]>
<link rel="stylesheet" href="{{ pathto('_static/ie6.css', 1) }}" type="text/css" media="screen" charset="utf-8" />
<![endif]-->
{%- if theme_favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/'+theme_favicon, 1) }}"/>
{%- endif %}

{%- if theme_canonical_url %}
<link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html"/>
{%- endif %}
{% endblock %}

{% block header %}

{% if theme_in_progress|tobool %}
    <div id="dev-warning"><a href="{{ latest_url }}" class="btn btn-large btn-danger"><strong>&gt;</strong> This is an on-going documentation. Read the latest stable version of this page</a></div>
{% endif %}

{% if theme_outdated|tobool %}
    <div style="bottom: 60px; right: 20px;position: fixed;"><a href="{{ latest_url }}" class="btn btn-large btn-danger"><strong>&gt;</strong> Read the latest version of this page</a></div>
{% endif %}

<div class="header-small">
	{%- if theme_logo %}
	{% set img, ext = theme_logo.split('.', -1) %}
	<div class="logo-small">
		<a href="{{ pathto(master_doc) }}">
      		<img class="logo" src="{{ pathto('_static/%s-small.%s' % (img, ext), 1)}}" alt="Logo"/>
		</a>
  	</div>
  	{%- endif %}
</div>
{% endblock %}

{%- macro relbar() %}
<div class="related">
	<h3>{{ _('Navigation') }}</h3>
	<ul>
		{%- for rellink in rellinks %}
		<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
			<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
			{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
			{%- if not loop.first %}{{ reldelim2 }}{% endif %}
		</li>
		{%- endfor %}
    	{%- block rootrellink %}
    	<li><a href="{{ pathto(master_doc) }}">{{ docstitle|e }}</a>{{ reldelim1 }}</li>
    	{%- endblock %}
    	{%- for parent in parents %}
          <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
        {%- endfor %}
        {%- block relbaritems %} {% endblock %}
  	</ul>
</div>
{%- endmacro %}

{%- block sidebarsourcelink %}{%- endblock %}

{%- block sidebar2 %}{{ sidebar2() }}{% endblock %}
