{% load i18n %}
{% load static %}
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>{% block title %}{% trans "Mój sklep" %}{% endblock %}</title>
    <link href="{% static "css/base.css" %}" rel="stylesheet">
  </head>
  <body>
    <div id="header">
      <a href="/" class="logo">{% trans "Mój sklep" %}</a>
      {% get_current_language as LANGUAGE_CODE %}
      {% get_available_languages as LANGUAGES %}
      {% get_language_info_list for LANGUAGES as languages %}
      <div class="languages">
        <p>{% trans "Język" %}:</p>
        <ul class="languages">
          {% for language in languages %}
            <li>
              <a href="/{{ language.code }}/"
              {% if language.code == LANGUAGE_CODE %} class="selected"{% endif %}>
                {{ language.name_local }}
              </a>
            </li>
          {% endfor %}
        </ul>
      </div>
    </div>

    <div id="subheader">
      <div class="cart">
        {% with total_items=cart|length %}
          {% if total_items > 0 %}
            {% trans "Koszyk" %}:
            <a href="{% url "cart:cart_detail" %}">
              {% blocktrans with total=cart.get_total_price count items=total_items %}
                {{ items }} produkt, {{ total }} zł
              {% plural %}
                {{ items }} produktów, {{ total }} zł
              {% endblocktrans %}
            </a>
          {% elif not order %}
            {% trans "Twój koszyk jest pusty." %}
          {% endif %}
        {% endwith %}
      </div>
    </div>
    <div id="content">
      {% block content %}
      {% endblock %}
    </div>
  </body>
</html>