{#
    opendylan/layout.html
    ~~~~~~~~~~~~~~~~~

    :copyright: Copyright 2011 by the Dylan Hackers.
    :license: MIT.
#}
{% extends "basic/layout.html" %}
{% block doctype %}
<!DOCTYPE html>
{% endblock %}
{% set css_files = css_files + ['_static/opendylan.org/css/opendylan-docs.css'] -%}
{% set reldelim1 = '<span class="divider">&raquo;</span>' -%}
{% set navigation_bar = [
    ('index', 'Home'),
    ('about/index', 'About'),
    ('news/index', 'News'),
    ('documentation/index', 'Documentation'),
    ('community/index', 'Participate'),
    ('download/index', 'Download'),
] -%}
{% set active_page = 'documentation/index' -%}

{% block extrahead %}
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" type="text/css" />
    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
    <!--[if lt IE 9]>
      <script src="{{ pathto('_static/opendylan.org/js/html5shim/html5.js', 1) }}"></script>
    <![endif]-->
    <script>
      (function($) {
        $(function() {
          var int_sideheight = $(window).height() - $('.navbar').height() - 10;
          $('.pinned').css('height', int_sideheight+'px');
          $(window).scroll(function() {
            if ($(this).scrollTop() > 0) {
              $('.pinned').addClass('pin-set').css('height','100%');
            } else {
              var int_sideheight = $(window).height() - 10;
              $('.pinned').removeClass('pin-set').css('height', int_sideheight+'px');
            }
          });
        });
      })(jQuery);
    </script>
{% endblock %}

{% block header %}
   <div class="navbar">
     <div class="navbar-inner">
       <div class="container">
         <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
         </a>
         <img class="logo" src="{{ pathto('_static/opendylan.org/images/dylan-squares.png', 1) }}" alt="Dylan Logo" />
         <a class="brand" href="http://opendylan.org/">Open Dylan</a>
         <div class="nav-collapse">
           <ul class="nav">
           {% for page, caption in navigation_bar -%}
             <li{% if page == active_page %} class="active"{% endif %}><a href="http://opendylan.org/{{ page }}.html">{{ caption|e }}</a>
           {% endfor -%}
           </ul>
           <form class="navbar-search pull-right" action="{{ pathto('search') }}" method="get">
             <input type="text" name="q" class="search-query" placeholder="Search this document" />
             <input type="hidden" name="check_keywords" value="yes" />
             <input type="hidden" name="area" value="default" />
           </form>
         </div>
       </div>
     </div>
    </div>
{% endblock %}

{% block content %}
    <div class="container">
      <div class="row">
        <div class="content span8">
          <div class="related">
            <ul class="breadcrumb">
              {%- block rootrellink %}
              <li><a href="{{ pathto(master_doc) }}">{{ shorttitle|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>
          {%- block document %}
          {{ super() }}
          {%- endblock %}
        </div>
        <div class="doc-sidebar span3">
          <div class="pinned span3">
            <div class="related">
              <ul class="breadcrumb">
                <li>&nbsp</li>
              {%- for rellink in rellinks %}
                <li class="right">
                  <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
                   {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
                {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
              {%- endfor %}
              </ul>
            </div>
            {%- block sidebartoc %}
            <h3>{{ _('Table Of Contents') }}</h3>
            <ul style="margin-bottom: 0;">
                <li class="toctree-l1">
                    <a class="reference internal" href="{{ pathto('index') }}" 
                       style="background-color: #DDDDDD; border-color: #CCCCCC;">Front Page</a>
                </li>
            </ul>
            {{ toctree() }}
            {%- endblock %}
          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
{% endblock %}

{% block footer %}
    <footer class="container">
      <hr>
      <div class="pull-left">
        {%- if show_source and has_source and sourcename %}
          <a href="{{ pathto('_sources/' + sourcename, true)|e }}"
             rel="nofollow">{{ _('Show Source') }}</a>
        {%- endif %}
      </div>

      <div class="pull-right">
        {%- if show_copyright %}
          {%- if hasdoc('copyright') %}
            {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
          {%- else %}
            {% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
          {%- endif %}
        {%- endif %}
        {%- if last_updated %}
          {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
        {%- endif %}
        {%- if show_sphinx %}
          {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
        {%- endif %}
      </div>
      <div class="clearer"></div>
      <!-- Piwik -->
      <script type="text/javascript">
      var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.opendylan.org/" : "http://piwik.opendylan.org/");
      document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
      </script><script type="text/javascript">
      try {
      var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
      piwikTracker.trackPageView();
      piwikTracker.enableLinkTracking();
      } catch( err ) {}
      </script><noscript><p><img src="http://piwik.opendylan.org/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
      <!-- End Piwik Tracking Code -->
    </footer>
{% endblock %}

{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
