{% load static %}
{% load compress %}
{% load account %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="chrome=1" http-equiv="X-UA-Compatible">
    <title>{% block head_title %}{% endblock %} Port Townsend Coffee</title>

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Eczar:wght@400;700&family=Inter:wght@100;400;700&display=swap" rel="stylesheet">

    {% compress css %}
    <link rel="stylesheet" type="text/css" href="{% static "styles/main.css" %}">
    {% endcompress %}

    <script type="module" defer src="{% static 'scripts/initializers/timezone.js' %}"></script>

    {% block head %}
    {% endblock %}
</head>
<body>
<header class="site__header">
    <div>
        <h1><a class="site__logo" href="{% url 'storefront:product-list' %}">Port Townsend Coffee</a></h1>
    {% if user.is_authenticated %}
        <p>
            Hi <a href="{% url 'storefront:customer-detail' user.pk %}">{{user.first_name}} {{user.last_name}}</a>!
        </p>
        {% if user.is_staff %}
            <p><a href="{% url 'dashboard:home' %}">DASHBOARD</a></p>
        {% endif %}
        <p><a href="{% url 'account_logout' %}">Log Out</a></p>
    {% else %}
        <p>
            <a href="{% url 'account_login' %}">Log In</a>&emsp;|&emsp;<a href="{% url 'account_signup' %}">Sign Up</a>
        </p>
    {% endif %}
    </div>
    <nav>
        <a href="{% url 'storefront:product-list' %}">Shop</a>
        <a href="">Wholesale</a>
        <a href="">Subscribe</a>
        <a href="">Cafe</a>
        <a href="">Enjoy</a>
        <a href="{% url 'storefront:about' %}">About</a>
        <a href="">Contact</a>
        <a class="site__cart" href="{% url 'storefront:cart-detail' %}">
            <span class="cart__length">{{cart|length}}</span>
            <img class="cart__icon" src="{% static 'images/shopping_cart.svg' %}" alt="Shopping cart">
        </a>
    </nav>
</header>

<aside>
    {% block aside %}
    {% endblock %}
</aside>
<main> 
{% block content %}
{% endblock content %}
</main>
<footer>
    <div class="keep_calm">
        <figure>
            <img class="keep_calm__img" src="{% static 'images/keep_calm.jpg' %}" alt="Keep calm and drink coffee">
        </figure>
        <div>
            <h4>Problem with your order?<br>Have a question?</h4>
            <p>Please contact us, we’re happy to help you over the phone at <a href="tel:+13603855856">(360) 385-5856</a> between 8:00 am and 10:00 pm Pacific Time.</p>
            {% block footer %}
            {% endblock footer %}
        </div>
    </div>
    <div class="site__copyright">
        <p>
            <small>Copyright © 2016-{% now "Y" %} Better Living Food Company Inc.</small><br>
            <small>Fair Trade&nbsp;|&nbsp;Organic&nbsp;|&nbsp;Port Townsend, WA 98368</small><br><br>
            <img src="{% static 'images/fair_trade_stamp.png' %}" alt="">
        </p>
    </div>
</footer>
</body>
</html>
