{% load i18n %}
{% load staticfiles %}
{% load cache %}
{% load pipeline %}
<!DOCTYPE html>
<html lang="{{lang}}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" type="image/png" href="{% static "dashboard/img/favicon.png" %}"/>
    {% block extra_link %}{% endblock %}

    <title>{% block title %}{% block title-page %}{% endblock %} | {% block title-site %}CIRCLE{% endblock %}{% endblock %}</title>

    {% stylesheet 'all' %}

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->


    {% block extra_css %}{% endblock %}
  </head>

  <body>
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-header">
        {% block navbar-brand %}
          <a class="navbar-brand" href="{% url "dashboard.index" %}" style="padding: 10px 15px;">
            {% include "branding.html" %}
          </a>
        {% endblock %}

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
      </div><!-- .navbar-header -->
      <div class="collapse navbar-collapse">
        {% block navbar %}{% endblock %}
      </div><!-- .collapse .navbar-collapse -->
    </div><!-- navbar navbar-inverse navbar-fixed-top -->

    <div class="container">
      {% block broadcast_messages %}
        {% cache 30 broadcast_messages %}
          <div id="broadcast-messages">
            {% for message in broadcast_messages %}
              <div data-id={{ message.id }} class="alert alert-{{ message.effect }}
                  text-center broadcast-message">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
                {{ message.message|safe }}
              </div>
            {% endfor %}
          </div>
        {% endcache %}
      {% endblock broadcast_messages %}

      {% block messages %}
        <div class="messagelist">
        {% if messages %}
          {% for message in messages %}
            <div class="alert
              {% if message.tags %} alert-{% if message.tags == "error" %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}">
          {{ message|safe }}
            </div>
          {% endfor %}
        {% endif %}
        </div>
      {% endblock messages %}
      {% block content %}
        <h1 class="alert alert-error">Please override "content" block.</h1>
      {% endblock %}
    </div> <!-- /container -->

    <footer>
      <a href="{% url "info.legal" %}">{% trans "Legal notice" %}</a> |
      <a href="{% url "info.policy" %}">{% trans "Policy" %}</a> |
      <a href="{% url "info.help" %}">{% trans "Help" %}</a> |
      <a href="{% url "info.support" %}">{% trans "Support" %}</a>
      <span class="pull-right">{{ COMPANY_NAME }}</span>
    </footer>

  <script src="{% static "jquery/dist/jquery.min.js" %}"></script>
  <script src="{{ STATIC_URL }}jsi18n/{{ LANGUAGE_CODE }}/djangojs.js"></script>
  {% javascript 'all' %}

  {% block extra_script %}
  {% endblock %}

  {% block extra_js %}
  {% endblock %}

  {% block extra_etc %}
  {% endblock %}
  </body>
</html>
