{% load static %}

<!DOCTYPE html>
<html lang="en">

<head>

    <title>
        {% block title %}
            Default Title
        {% endblock %}
    </title>

<meta charset="utf-8">
<!--Set page width to device width and default zoom (more for mobile)-->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1 shrink-to-fit=no">

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Great+Vibes|Hammersmith+One|Montserrat:200,300" rel="stylesheet">
<!-- Our own CSS -->
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}" />

<!-- Favicons -->
{% if favicon|length > 0 %}
  <link rel="icon" type="image/vnd.microsoft.icon"
    sizes="32x32 48x48" href="{% static favicon %}?v=2">
{% else %}
  <link rel="icon" type="image/vnd.microsoft.icon"
    sizes="32x32 48x48" href="{% static 'images/favicons/favicon-heart.ico' %}?v=2">
{% endif %}

<style>
{% block style %}
{% endblock %}
</style>

</head>

{% load tz_detect %}
{% tz_detect %}

{% block navbar %}

<body class="base-font">
<!-- Navbar: fixed/always visible -->
<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container-fluid">

    <!-- Shows logo. Menu button visible only when on narrow screen-->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse"
        data-target="#myNavbar">
        <!-- Draws the 3 lines for the menu button-->
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/">{{gride.first_initial}}&#x2764;{{broom.first_initial}}</a>
    </div>

    <div id="myNavbar" class="collapse navbar-collapse">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="{% url 'story' %}">Our Story</a></li>
        {% if access.wedding or access.events or access.traditions or access.team %}
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown"
            href="#">The Wedding<span class="caret"></span></a>
          <ul class="dropdown-menu">
            {% if access.wedding %}
            <li><a href="{% url 'wedding' %}">Ceremony & Reception</a></li>
            {% endif %}
            {% if access.events %}
            <li><a href="{% url 'events' %}">Weekend Events</a></li>
            {% endif %}
            {% if access.traditions %}
            <li><a href="{% url 'traditions' %}">Wedding Traditions</a></li>
            {% endif %}
            {% if access.team %}
            <li><a href="{% url 'team' %}">Meet the Team</a></li>
            {% endif %}
          </ul>
        </li> <!--end wedding weekend dropdown-->
        {% endif %}
        {% if access.travel or access.explore %}
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown"
            href="#">Travel<span class="caret"></span></a>
          <ul class="dropdown-menu">
            {% if access.travel %}
            <li><a href="{% url 'travel' %}">Travel & Lodging</a></li>
            {% endif %}
            {% if access.explore %}
            <li><a href="{% url 'explore' %}">Explore the Area</a></li>
            {% endif %}
          </ul>
        </li> <!--end travel dropdown-->
        {% endif %}
        {% if access.rsvp %}
        <li><a href="{% url 'rsvp' %}">RSVP</a></li>
        {% endif %}
        {% if access.gifts %}
        <li><a href="{% url 'gifts' %}">Gifts</a></li>
        {% endif %}
        {% if access.contact %}
        <li><a href="{% url 'contact' %}">Contact</a></li>
        {% endif %}
        <li>
            {% if user.is_authenticated %}
                <a href="{% url 'logout' %}">Log Out</a>
            {% else %}
                <a href="{% url 'login' %}?next={% url 'index' %}">Log In</a>
            {% endif %}
        </li>
      </ul>
    </div>
  </div>
</nav>

{% endblock %}

<!-- Content, expected to be overwritten -->
<div class="content">
  {% block content %}
  {% endblock %}
</div>

<!-- footer -->
<div class="footer-container">
  <footer class="footer">
    <div class="row text-muted">
      <div class="col-xs-8">
        <p class="footer-credit">
          <span class="nowrap">This site built using <a href="https://github.com/dpipemazo/django-wedsite">wedsite.io</a>, the simple open-source wedding website</a></span>
        </p>
      </div>
      <div class="col-xs-4">
        <p class="footer-help">
          <span class="nowrap">Site trouble?</span> <span class="nowrap"><a href="mailto:{% static admin_email %}">Get Help</a></span>
        </p>
      </div>
    </div>
  </footer>
</div>

{% block bootstrap %}

<!-- Close off body and HTML doc -->
</body>
</html>

<!-- Bootstrap scripts -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

{% endblock %}
