{#
    sphinx-rigado-theme/layout.html
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Sphinx layout template for the Rigado theme.

    :copyright: Copyright 2017 by Rigado
    :license: All rights reserved
#}
{% extends "classic/layout.html" %}

{% set css_files = css_files + ['_static/css/rigado.css'] %}
{%- block linktags %}
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,400italic,600italic" rel="stylesheet" type="text/css">
  {{ super() }}
{%- endblock %}

{%- block extrahead %}
  <meta name="google" value="notranslate">
  {# this block is after the one using html_favicon from conf.py, so it safely overwrites it #}
  <link rel="shortcut icon" href="{{ pathto('_static/images/favicon.png', 1) }}"/>
{% endblock %}

{# remove breadcrumbs from relbar, overwrite logo #}
{%- block relbar1 %}
<div class="related" role="navigation" aria-label="related navigation">
  <h3>{{ _('Navigation') }}</h3>
  <ul>
    <li class="right"><a href="{{ pathto(master_doc) }}" title="Top">Top</a></li>
    {%- for rellink in rellinks %}
    <li class="right">
      <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
         {{ accesskey(rellink[2]) }}>{{ rellink[3]|capitalize }}</a>
      {{ reldelim2 }}</li>
    {%- endfor %}
    <li class="nav-item nav-item-0">
      <a href="/"><img class="logo" src="{{ pathto('_static/images/logo.png', 1) }}" alt="{{ shorttitle|e }}"/></a>
    </li>
    {%- if theme_display_legacy_link %}
    <li id="legacyportalbutton" class="nav-item">
      <a class="button" href="https://developer.rigado.com" title="Legacy DeviceOps Documentation">Legacy DeviceOps Documentation</a>
    </li>
    {%- endif %}
  </ul>
</div>
{%- endblock %}

{# no relbar2 please! #}
{%- block relbar2 %}{%- endblock %}

{# reformat the search form a little #}
{# had to copy in the entire sidebar because it was just going to include the files and the sidebarsearch block was defined in the layout, not in the included file #}
{%- block sidebar2 %}
  {%- if render_sidebar %}
  <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
    <div class="sphinxsidebarwrapper">
      {%- if sidebars != None %}
        {#- new style sidebar: explicitly include/exclude templates #}
        {%- for sidebartemplate in sidebars %}
          {%- include sidebartemplate %}
        {%- endfor %}
      {%- else %}
        {%- block sidebarsearch %}
          {%- include "searchbar.html" %}
        {%- endblock %}
        {%- if theme_use_global_toc %}
          {%- include "globaltoc.html" %}
        {%- endif %}
        {%- block sidebartoc %}
          {%- include "localtoc.html" %}
        {%- endblock %}
        {%- block sidebarsourcelink %}
          {%- include "sourcelink.html" %}
        {%- endblock %}
      {%- endif %}
    </div>
  </div>
  {%- endif %}
{%- endblock %}

{%- block footer %}
  <div class="footer" role="contentinfo">
    {%- if show_copyright %}
      {%- if hasdoc('copyright') %}
        {% trans path=pathto('copyright'), copyright=copyright|e %}
          &#169; <a href="{{ path }}">Copyright</a> {{ copyright }}.
        {% endtrans %}
      {%- else %}
        {% trans copyright=copyright|e %}
          &#169; Copyright {{ copyright }}.
        {% endtrans %}
      {%- endif %}
      <br />
    {%- endif %}
    Release {{ release|e }}.
    {%- if last_updated %}
      {% trans last_updated=last_updated|e %}
        Last updated on {{ last_updated }}.
      {% endtrans %}
    {%- endif %}
    {%- if commit %}
      {% trans commit=commit %}
        Revision <code>{{ commit }}</code>.
      {% endtrans %}
    {%- endif %}
    <br />
    {%- if show_sphinx %}
      {% trans sphinx_version=sphinx_version|e %}
        Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.
      {% endtrans %}
    {%- endif %}
  </div>
  <script type="text/javascript">
    $(document).ready(function() {
        $("a[href^='http']").attr('target','_blank');
    });
  </script>
{%- endblock %}
