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

{%- macro secondnav() %}
{%- endmacro %}

{% block extrahead %}
{# When building htmlhelp (CHM format) disable jQuery inclusion, #}
{# as it causes problems in compiled CHM files.                  #}
{% if builder != "htmlhelp" %}
{{ super() }}

<script type="text/javascript">
    $( document ).ready(function() {
        $("#doc-layout").css("min-height", $(window).height() - 121);
        $(window).resize(function() {
            $("#doc-layout").css("min-height", $(window).height() - 121);
        });
        $('a.reference, a.internal').on('click', function(e){
            var target = this.hash,
                element;
            if (target[0] === "#") {
                e.preventDefault();
                element = $('a[href=' + target + ']');
                $('html, body').animate({
                    scrollTop: element.offset().top - 60
                }, 500);
            }
        });
    });
</script>

{% endif %}
{% endblock %}

{% block document %}
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    {% if prev %}
                    <span class="icon-bar"></span>
                    {% endif %}
                    {% if next %}
                    <span class="icon-bar"></span>
                    {% endif %}
                </button>
                <a class="navbar-brand" href="http://jam-py.com/">Jam.py framework</a>
            </div>

            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li class="hidden">
                        <a href="http://jam-py.com/"></a>
                    </li>
                    <li>
                        <a href="{{ pathto('contents') }}">Table of contents</a>
                    </li>
                    {% if prev %}
                    <li>
                        <a href="{{ prev.link }}">Prev</a>
                    </li>
                    {% endif %}
                    {% if next %}
                    <li>
                        <a href="{{ next.link }}">Next</a>
                    </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <div id="doc-layout" class=".container-fluid">
        <div>
            <h3 class="title">Jam.py documentation</h3>
        </div>
        <div id="doc-content" class="row">
          {% if pagename != 'index' %}
          <div id="doc-body" class="col-md-9">
          {% else %}
          <div id="doc-body" class="col-md-12">
          {% endif %}
<!--
                <div id="dev-warning" class="small text-danger">Documentation is under development</div>
-->
                {% block body %}{% endblock %}
          </div>
          {% block sidebarwrapper %}
            {% if pagename != 'index' %}
              <div id="doc-sidebar" class="col-md-3" >
                {{ sidebar() }}
                {%- if last_updated %}
                  <h3>Last update:</h3>
                  <p class="topless">{{ last_updated }}</p>
                {%- endif %}
              </div>
            {% endif %}
          {% endblock %}
        </div>
    </div>

    <footer>
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    Copyright &copy; Andrew Yushev 2015-2016
                </div>
            </div>
        </div>
    </footer>

{% endblock %}

{% block sidebarrel %}
  <h3>Browse</h3>
  <ul>
    {% if prev %}
      <li>Prev: <a href="{{ prev.link }}">{{ prev.title }}</a></li>
    {% endif %}
    {% if next %}
      <li>Next: <a href="{{ next.link }}">{{ next.title }}</a></li>
    {% endif %}
    <li>
        <a href="{{ pathto('contents') }}">Table of contents</a>
    </li>
  </ul>
  <h3>You are here:</h3>
  <ul>
      <li>
        <a href="{{ pathto('index') }}">{{ docstitle }}</a>
        {% for p in parents %}
          <ul><li><a href="{{ p.link }}">{{ p.title }}</a>
        {% endfor %}
        <ul><li>{{ title }}</li></ul>
        {% for p in parents %}</li></ul>{% endfor %}
      </li>
  </ul>
{% endblock %}

{# Empty some default blocks out #}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}
{% block footer %}{% endblock %}
