{% extends "eultheme/site_base.html" %}
{% load static widget_tweaks feincms_page_tags %}

{% block metadata %}
  <meta property="og:site_name" content="Readux"/>
  <meta property="og:type" content="website" />
  <meta property="og:url" content="{{request.build_absolute_uri}}"/>

  <meta name="twitter:domain" content="{{request.get_host}}" />
{% endblock %}

{% block favicon %}
    {% if ENABLE_BETA_WARNING %}
      <link id="siteFavIcon" rel="shortcut icon" type="image/x-icon" href="{% static 'img/favicon-beta.ico' %}" />
    {% elif debug %}
        <link id="siteFavIcon" rel="shortcut icon" type="image/x-icon" href="{% static 'img/favicon-dev.ico' %}" />
    {% else %}
      <link id="siteFavIcon" rel="shortcut icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}" />
    {% endif %}
  {% endblock %}

{% block css %}
  {{ block.super }}
  <link href='//fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css' />
  <link rel="stylesheet" type="text/css" href="{% static 'css/readux.css' %}" />
{% endblock %}

{% block javascript %}
    <script type="text/javascript" src="{% static 'ext/isotope.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/local.js' %}"></script>
{% endblock %}

{% block head_extras %}
   <meta name="google-site-verification" content="WWdn3okWneQob5r6S1Svxtf87zwE1FHre0bRMvUzPvQ" />
{% endblock %}

{% block xs-nav-title %}
  <img src="{% static 'img/readux-inverse.png' %}"/><span>Readux</span>
{% endblock %}

{% block nav-title %}
  <div class="logo">
    <img src="{% static 'img/readux.png' %}"/>
    <span class="site-title">Readux</span>
  </div>
{% endblock %}

{# The <title> for the page  #}
{% block page-title %}{% block page-subtitle %}{% endblock %}Readux{% endblock %}

{% block nav_class %}navbar-inverse navbar-fixed-top{% endblock %}

{% block navlinks %}
{# NOTE: suppressed for now because collection browse is site home page #}
{# <li><a href="{% url 'collection:browse' %}">Collections</a></li> #}
  {% if feincms_page %} {# feincms nav only works if a page is laoded (should be set via context processor) #}
  {% feincms_nav feincms_page level=1 as nav %}
  {% endif %}
  {% for page in nav %}
     <li><a href="{{ page.get_absolute_url }}">{{ page.title }}</a></li>
  {% endfor %}

{% endblock %}

{% block admin-navlink %} {# override eultheme default #}{% endblock %}


{% block navbar-extra %}
{% if search_form %}
<div class="navbar-right">
<form id="nav-search" class="form-inline navbar-form" role="form" method="GET" action="{% url 'books:search' %}">
   <div class="form-group">
      <div class="input-group">
      <label class="sr-only" for="{{ search_form.keyword.name }}">{{ search_form.keyword.label }}</label>
      {% render_field search_form.keyword class+="form-control" placeholder="Search all volumes" autocomplete="false" data-toggle="tooltip" data-original-title=search_form.keyword.help_text|striptags data-placement="bottom" %}
      {# TODO: help text #}

      <span class="input-group-btn">
        <button type="submit" class="btn btn-primary">
            <span class="glyphicon glyphicon-search"></span>
        </button>
      </span>
    </div>
  </div>
</form>
</div>
{% endif %}
  {% include 'snippets/login.html' %}
{% endblock %}

{% block content %}

{% endblock %}

{% block footer-content %}
<script>
var error_images = {
    thumbnail: "{% static 'img/notfound_thumbnail.png' %}",
    single_page: "{% static 'img/notfound_page.png' %}",
    mini_thumbnail: "{% static 'notfound_mini_thumbnail_page.png' %}",
    cover_mini_thumb: "{% static 'img/cover_unavailable_minithumb.png' %}",
};
</script>
  {% if not debug %} {# google analytics tracking code #}
    {% include 'snippets/google_analytics.html' %}
  {% endif %}
{% endblock %}
