{% extends "!layout.html" %}

{%- if pagename == 'index' %}{% set theme_nosidebar = True %}{% endif -%}

{%- macro secondnav() %}
  {%- if prev -%}    &laquo;     <a href="{{ prev.link|e }}" title="{{ prev.title|e }}">previous</a> {{ reldelim2 }} {% endif %}
  {%- if parents -%}             <a href="{{ parents.0.link|e }}" title="{{ parents.0.title|e }}" accesskey="U">up</a>
  {%- else -%}                   <a href="{{ pathto('index') }}" title="{{ docstitle }}" accesskey="U">up</a>       {%- endif %}
  {%- if next %} {{ reldelim2 }} <a href="{{ next.link|e }}" title="{{ next.title|e }}">next</a> &raquo;            {%- endif -%}
{% endmacro %}

{% block extrahead %}{% if embedded %}<link rel="stylesheet" href="{{ pathto('_static/embedded.css', 1) }}" type="text/css" />{% endif %}{% endblock %}

{% block header %}{% if not embedded %}
  <div class="header"><a href="http://portableapps.com/"><img src="{{ pathto('_static/' + logo, 1) }}" alt="PortableApps.com - Your Digital Life, Anywhere" height="47" width="229"></a>
    <div id="global-nav" class="nav">
      <a title="Home page" href="{{ pathto('index') }}">Home</a> {{ reldelim2 }}
      <a title="Table of contents" href="{{ pathto('contents') }}">Table of contents</a> {{ reldelim2 }}
      <a title="Global index" href="{{ pathto('genindex') }}">Index</a> {{ reldelim2 }}
      <a title="Search" href="{{ pathto('search') }}">Search</a> {{ reldelim2 }}
      <a title="PortableApps.com" href="http://portableapps.com">PortableApps.com</a>
    </div>
  </div>
{% endif %}{% endblock %}

{% block document %}
  <div id="page-{{ pagename|replace('/', '-') }}" class="page {%- if not embedded %}{% if not theme_nosidebar|tobool %} withsidebar{% endif %}{% endif %}">
    {% block body %}{% endblock %}
  </div>
{% endblock %}

{% block footer %}{% if not embedded %}
  <div class="footer">
    <div class="nav">{{ secondnav() }}</div>
  </div>
{% endif %}{% endblock %}

{% block sidebarrel %}
  <h3>Browse</h3>
  <ul>
    {% if prev %}
      <li>Previous: <a href="{{ prev.link }}">{{ prev.title }}</a></li>
    {% endif %}
    {% if next %}
      <li>Next: <a href="{{ next.link }}">{{ next.title }}</a></li>
    {% endif %}
  </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 sidebarlogo %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
