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

{%- macro pybtex_toc() %}
    <a href="{{ url_root }}">Table of contents</a>
{%- endmacro %}

{%- macro pybtex_relbar() %}
<div class="relbar">
    <div class="left">
        <a href="{{ site_url }}">Pybtex</a> /
        {%- if pagename != master_doc %}
            <a href="{{ url_root }}">{{ shorttitle|e }}</a> /
            {%- for parent in parents %}
            <a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a> /
            {%- endfor %}
            {{ title }}
        {%- else %}
            {{ shorttitle|e }}
        {%- endif %}
    </div>
    &nbsp;
    <div class="right" role="search">
        <form class="search" action="{{ pathto('search') }}" method="get">
        <input type="text" name="q" placeholder="Enter search text..."/>
        <input type="submit" value="{{ _('Search') }}" />
        </form>
    </div>
</div>
{%- endmacro %}

{%- macro pybtex_prev_next() %}
<div class="prev-next">
    {%- if prev and prev != master_doc %}
    <div class="left">
        <a href="{{ prev.link }}">← {{ prev.title }}</a>
    </div>
    {%- endif %}

    <div class="middle">
    {%- if pagename != master_doc and next %}
        {{- pybtex_toc() }}
    {%- else %}
    &nbsp;
    {%- endif %}
    </div>

    <div class="right">
    {%- if next %}
        <a href="{{ next.link }}">{{ next.title }} →</a>
    {%- elif prev %}
        {{- pybtex_toc() }}
    {%- endif %}
    </div>
</div>
{%- endmacro %}

{%- block htmltitle %}
<title>{{ title|striptags|e }}{{ titlesuffix }} {% if not site %}({{ release }}){% endif %}</title>
{%- endblock %}

{%- block css %}
{# is is the right place for meta tags? #}
<meta name="viewport" content="width=device-width, initial-scale=1">
{{ super() }}
{%- endblock %}

{%- block scripts %}
{%- if not site %}{{ super() }}{% endif %}
{%- endblock %}

{%- block relbar1 %}
{%- if not site %}{{ pybtex_relbar() }}{% endif %}
{%- endblock %}

{%- block relbar2 %}
{%- if not site %}{{ pybtex_prev_next() }}{% endif %}
{%- endblock %}

{%- block footer %}
{%- if not site %}{{ super() }}{% endif %}
{%- endblock %}
