{% extends "!layout.html" %}

#Strip out the default script files we provide, but keep some, like mathjax.
{% set script_files = script_files[3:] %}

{% block htmltitle %}
{{ super() }}
<!-- RTD <head> -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}javascript/underscore.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}javascript/doctools.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}javascript/searchtools.js"></script>
{% if using_theme %}
  <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
{% endif %}
  <script type="text/javascript">
    var doc_version = "{{ current_version }}";
    var doc_slug = "{{ slug }}";
  </script>
  <script type="text/javascript" src="{{ MEDIA_URL }}javascript/rtd.js"></script>
<!-- end RTD <head> -->
{% endblock %}

{% block sidebarlogo %}
{{ super() }}
{% if using_theme %}
{% if versions %}
    <h3>Project Versions</h3>
    <ul id="sidebar_versions">
{% for slug, url in versions %}
  <li><a href="//readthedocs.org{{ url }}">{{ slug }}</a></li>
{% endfor %}
    </ul>
{% endif %}
<div id="searchbox" style="">
  <h3>RTD Search</h3>
    <form class="search" action="//readthedocs.org/search/project/" method="get">
      <input type="text" name="q" size="18">
      <input type="submit" value="Go">
      <input type="hidden" name="selected_facets" value="project:{{ name }}">
    </form>
    <p class="searchtip" style="font-size: 90%">
        Full-text doc search.
    </p>
</div>
{% endif %}
{% endblock %}

{% block footer %}
{{ super() }}
 <!-- End original user content -->
{# Keep this here, so that the RTD logo doesn't stomp on the bottom of the theme. #}
{% if not using_theme %}
<br>
<br>
<br>
{% endif %}

<style type="text/css">
  .badge {
    position: fixed;
    display: block;
    bottom: 5px;
    height: 40px;
    text-indent: -9999em;
    border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  }
  #version_menu {
    position: fixed;
    display: none;
    bottom: 11px;
    right: 166px;
    list-style-type: none;
    margin: 0;
  }
  .footer_popout:hover #version_menu {
    display: block;
  }
  #version_menu li {
    display: block;
    float: right;
  }
  #version_menu li a {
    display: block;
    padding: 6px 10px 4px 10px;
    margin: 7px 7px 0 0;
    font-weight: bold;
    font-size: 14px;
    height: 20px;
    line-height: 17px;
    text-decoration: none;
    color: #fff;
    background: #8ca1af url(../images/gradient-light.png) bottom left repeat-x;
    border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    box-shadow: 0 1px 1px #465158;
    -moz-box-shadow: 0 1px 1px #465158;
    -webkit-box-shadow: 0 1px 1px #465158;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  }
  #version_menu li a:hover {
    text-decoration: none;
    background-color: #697983;
    box-shadow: 0 1px 0px #465158;
    -moz-box-shadow: 0 1px 0px #465158;
    -webkit-box-shadow: 0 1px 0px #465158;
  }
  .badge.rtd {
    background: #257597 url(//media.readthedocs.org/images/badge-rtd-sm.png) top left no-repeat;
    border: 1px solid #282E32;
    width: 41px;
    right: 5px;
  }
  .footer_popout:hover .badge.rtd {
    background: #257597 url(//media.readthedocs.org/images/badge-rtd.png) top left no-repeat;
    width: 160px;
  }
  .badge.revsys { background: #465158 url(//media.readthedocs.org/images/badge-revsys.png) top left no-repeat;
    border: 1px solid #1C5871;
    width: 290px;
    right: 173px;
  }
  .badge.revsys-inline-sponsored {
    position: inherit;
    margin-left: auto;
    margin-right: 175px;
    margin-bottom: 5px;
    background: #465158 url(//media.readthedocs.org/images/badge-revsys.png) top left no-repeat;
    border: 1px solid #1C5871;
    width: 290px;
    right: 173px;
  }
  .badge.revsys-inline {
    position: inherit;
    margin-left: auto;
    margin-right: 175px;
    margin-bottom: 5px;
    background: #465158 url(//media.readthedocs.org/images/badge-revsys-sm.png) top left no-repeat;
    border: 1px solid #1C5871;
    width: 205px;
    right: 173px;
  }
{% if using_theme %}
.rtd_doc_footer { background-color: #465158;}
{% endif %}
</style>
<div class="rtd_doc_footer">
  <div class="footer_popout">
    <a href="//readthedocs.org/projects/{{ slug }}/?fromdocs={{ slug }}" class="badge rtd"> TEST Brought to you by Read the Docs</a>
    <ul id="version_menu">
      {% for slug, url in versions %}
        <li><a href="//readthedocs.org{{ url }}">{{ slug }}</a></li>
      {% endfor %}
    </ul>
  </div>
</div>
<!-- RTD Analytics Code -->
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17997319-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>

{% if analytics_code %}
<!-- User Analytics Code -->
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '{{ analytics_code }}']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
{% endif %}

{% endblock %}

