{% if html_theme == 'sphinx_rtd_theme' %}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
    <span class="rst-current-version" data-toggle="rst-current-version">
        <span class="fa fa-book"> Other Versions</span>
        v: {{ current_version }}
        <span class="fa fa-caret-down"></span>
    </span>
    <div class="rst-other-versions">
        {%- if versions.tags %}
        <dl>
            <dt>Tags</dt>
            {%- for name, url, pdf_url in versions.tags %}
            <dd><a href="{{ url }}">{{ name }}</a></dd>
            {%- endfor %}
        </dl>
        {%- endif %}
        {%- if versions.branches %}
        <dl>
            <dt>Branches</dt>
            {%- for name, url, pdf_url in versions.branches %}
            <dd><a href="{{ url }}">{{ name }}</a></dd>
            {%- endfor %}
        </dl>
        {%- endif %}
        {%- if versions.pdf_file %}
        <dl>
            <dt>PDF</dt>
            {%- for name, url, pdf_url in versions.tags %}
            <dd><a href="{{ pdf_url }}" download>{{ name }}</a></dd>
            {%- endfor %}
            {%- for name, url, pdf_url in versions.branches %}
            <dd><a href="{{ pdf_url }}" download>{{ name }}</a></dd>
            {%- endfor %}
        </dl>
        {%- endif %}
    </div>
</div>
{% elif html_theme == 'rasabaster' %}
<div class="versions">
    <p class="caption">Versions</p>
    <div class="versions-content">
      <div>
        <span class="current-version">
          viewing: {{ current_version }}
        </span>
      </div>
      <div class="other-versions">
          {%- if versions.tags %}
          <p>tags</p>
          <div class="dropdown-content">
            {%- for name, url, pdf_url in versions.tags %}
              <a href="{{ url }}">{{ name }}</a>
            {%- endfor %}
          </div>
          {%- endif %}
          {%- if versions.branches %}
          <p>branches</p>
          <div class="dropdown-content">
            {%- for name, url, pdf_url in versions.branches %}
              <a href="{{ url }}">{{ name }}</a>
            {%- endfor %}
          </div>
          {%- endif %}
      </div>
    </div>
</div>

{% else %}
<h3>{{ _('Versions') }}</h3>
<ul>
    {%- for name, url in versions %}
    <li><a href="{{ url }}">{{ name }}</a></li>
    {%- endfor %}
</ul>
{%- endif %}
