{% extends "base_generic.html" %}
{% load tags %}

{% block content %}

<div class="container-fluid">

<h3 style="margin-top: 10px">Liste</h3>

<!-- ----------------------------------------------------------------------- -->


{% if product_list %}

<div class="container-fluid">

  {% for product in product_list %}

    {% if forloop.first %}
      <div class="row">

        <div class="col-sm-2">&nbsp;</div>
        <div class="col-sm-2">{% field_name product 'name' %}</div>
        <div class="col-sm-2">{% field_name product 'claim' %}</div>
        <div class="col-sm-2">{% field_name product 'status' %}</div>
        <div class="col-sm-2">{% field_name product 'adresse' %}</div>
        <div class="col-sm-2">{% field_name product 'website' %}</div>
      </div>

      <div class="row">
        <div class="col-sm-12" style="background-color: #FFF;">
          <hr class="division-color">
        </div>
      </div>
    {% endif %}


  <div class="row">
    <div class="col-sm-2"><img src="{{  product.media_set.first.image_small.url  }}?v={{ product.media_set.first.pk }}" width="50" height="50" alt="{{ product.pk }}"> </div>
    <div class="col-sm-2"><a href="{% url 'product-detail-type' type=product.type pk=product.pk  %}"> {{product.name|upper }} </a></div>
    <div class="col-sm-2"> <span>{{product.claim }}</span></div>
    <div class="col-sm-2"> <span>{{product.get_status_display }}</span></div>
    <div class="col-sm-2"> <span>{{product.adresse }}, {{product.plz }} {{product.adresse_zusatz }} </span> </div>
    <div class="col-sm-2"><a href="{{ product.website }}"><i class="fas fa-link"></i> {{ product.website }}</a> </div>
  </div>
  <div class="row">
    <div class="col-sm-12" style="background-color: #FFF;">
      <hr class="division-color">
    </div>
  </div>
  {% endfor %}

</div>

{% else %}

  <div class="">
    Es gibt keine Produkte.
  </div>

{% endif %}

<!-- --------------------------------------------------------------- -->


{% endblock %}
