{% extends "fruit/mystore.html" %}
{% load static %}
{% load crispy_forms_tags %}

{% block header %}            
{% endblock %}

{% load django_bootstrap_breadcrumbs %}
{% block breadcrumbs %}
    {{ block.super }}
    {% breadcrumb "Products" "fruit:product_index" %}
{% endblock %}

{% block store_main %}
<a  class='btn btn-primary' href="{% url "fruit:product_create" %}">Create Product</a>
<hr>
<h2>
    Product Index</h2>
{% include "fruit/_searchcenter.html" %}
<hr>
<!--
    {{ products }} -->
<table class='table table-borded table-striped'>
    <thead>
        <tr><th>ID</th><th>Name</th><th>Price</th><th>Created At</th></tr>
    </thead>
    <tbody>
{% for p in page_obj %}
        <tr>
            <td><a href="{% url "fruit:product_edit" pk=p.pk %}">{{ p.id }}</a></td><td>{{ p.name }}</td><td>{% firstof p.price  "-" %}</td><td>{{ p.created_at }}</td>
        </tr>
{% endfor %}
    </tbody>
</table>
{% include "fruit/_paging.html" %}
{% endblock %}
