{% extends "common/base.html" %}
{% load static %}
{% load i18n %}
{% load crispy_forms_tags purchase %}
{% block extrahead %}
    <link rel="stylesheet" href="{% static "purchase/css/basket_form.css" %}">
{% endblock %}
{% block content %}
    {% if basket %}
        <h1>{{ basket }} <span class="badge bg-secondary">{{ basket.price|currency }}</span></h1>
        <p class="metadata">
            {{ basket.created_at }}
        </p>
        {% if not basket.payment_method %}
            <div class="alert alert-danger" role="alert">{% translate "Missing payment method." %}</div>
        {% endif %}
    {% else %}
        <h1>{% translate "New basket" %}</h1>
    {% endif %}
    {% crispy form %}
    {% if basket %}
        <a href="{% url "purchase:new" %}" class="btn btn-secondary">{% translate "New" %}</a>
    {% endif %}
{% endblock %}
