<!doctype html>
<head>
  <meta charset="utf-8">
  <title>{% block title %}Maternity Reminder{% endblock %}</title>
  <meta name="description" content="">
  <meta name="author" content="">

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

  <!-- Mobile viewport optimized: j.mp/bplateviewport -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Place favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
  <link rel="icon" type="image/x-icon" href="{{ STATIC_URL }}img/favicon.ico">

  <!-- CSS: implied media="all" -->
  {# load compress #}
  {# compress css #}
  <link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.css">
  <link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/smartmin_styles.css">
  <link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/styles.css">
  {% block extra-style %}{% endblock %}

  {# endcompress #}
</head>

<body>

  <div class="topbar">
    <div class="fill">
      <div class="container">
        <a class="brand" href="/">RapidSMS</a>
        <ul class="nav">
          {% if perms.mileage.car_list %}
          <li><a href="{% url mileage.car_list %}">Cars</a></li>
          {% endif %}

          {% if perms.mileage.mileagereport_list %}
          <li><a href="{% url mileage.mileagereport_list %}">Mileage Reports</a></li>
          {% endif %}

          {% if perms.rapidsms_httprouter.message_list %}
          <li><a href="/router/console">Console</a></li>
          {% endif %}

          {% if perms.nsms.text_list %}
          <li class="dropdown" data-dropdown="dropdown">
            <a href="#" class="dropdown-toggle">Configuration</a>
            <ul class="dropdown-menu">
              {% if perms.nsms.text_list %}
              <li><a href="{% url nsms.text_list %}">Translations</a></li>
              {% endif %}
              {% if perms.auth.user_list %}
              <li><a href="/users/user/">Users</a></li>
              {% endif %}
            </ul>
          </li>
          {% endif %}
        </ul>
        
        {% block login %}
        <div class="nav secondary-nav">          
          {% if request.user and request.user.is_authenticated %}
          <a href="{% url users.user_logout %}?go=/">{{ request.user.username }} | logout</a>
          {% else %}
          <a href="{% url users.user_login %}">Login</a>
          {% endif %}
        </div>
        {% endblock %}
      </div>
    </div>
  </div>
</div>

<div class="container">
  {% load smartmin %}
      
  {% block content-div %}
  <div class="content">
    {% block messages %}
    {% if messages %}
    {% for message in messages %}
    <div class="alert-message {{ message.tags }} fade in" data-alert="alert">
      <a class="close" href="#">×</a>
      <p>{{ message }}</p>
    </div>
    {% endfor %}
    {% endif %}
    {% endblock messages %}

    {% block pre-content %}
    {% endblock %}

    {% block content %}
    {% endblock %}

    {% block post-content %}
    {% endblock %}
  </div>
  {% endblock %}

  <footer>
    {% block footer %}
    <a href="http://www.nyaruka.com/"><div class="pull-right" id="footer"><img src="{{ STATIC_URL }}img/nyaruka.png" /></div></a>
    {% endblock %}
  </footer>
  
</div> <!-- /container -->

<!-- JavaScript at the bottom for fast page loading, conditional based on whether we are serving locally -->
<script>
  if (window.location.hostname == "localhost"){
  document.write(unescape('%3Cscript src="{{ STATIC_URL }}js/libs/jquery-1.5.0.js"%3E%3C/script%3E'));
  } else {
  document.write(unescape('%3Cscript src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"%3E%3C/script%3E'));
  }
</script>

{# compress js #}
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.pjax.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/scripts.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap-alerts.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap-dropdown.js"></script>

{# media associated with any form we are displaying #}
{% if form %}
{{ form.media }}
{% endif %}

{% block extra-script %}{% endblock %}
{% block script %}{% endblock %}
{# endcompress #}

<!-- mathiasbynens.be/notes/async-analytics-snippet Change UA-XXXXX-X to be your site's ID -->
<!--script type="text/javascript">
    var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
    (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
    g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
    s.parentNode.insertBefore(g,s)}(document,'script'));
    </script-->

</body>
</html>
