{% extends "shop/base.html" %}
{% load static %}

{% block title %}
  {{ product.name }}
{% endblock %}

{% block content %}
  <div class="product-detail">
    <img src="{% if product.image %}{{ product.image.url }}{% else %}{% static "img/no_image.png" %}{% endif %}">
    <h1>{{ product.name }}</h1>
    <h2><a href="{{ product.category.get_absolute_url }}">{{ product.category }}</a></h2>
    <p class="price">{{ product.price }}zł</p>
    <form action="{% url "cart:cart_add" product.id %}" method="post">
      {{ cart_product_form }}
      {% csrf_token %}
      <input type="submit" value="Dodaj do koszyka">
    </form>
    {{ product.description|linebreaks }}
  </div>
{% endblock %}