{% extends 'base.html' %} {% block title %}{{ product["name"] }}{% endblock %} {% block main %} {% if message != None %}
{{ message }}

{% endif %}

{{ product["name"] }}

By {{ supplier["name"] }}


{% if rating["stars"] == None %}

No reviews yet

{% else %}

{{ rating["stars"] }} / 5    ({{ rating["reviews"] }} Review(s))

{% endif %} {% if session.get("user_type") == "customer" %}

Availability: {{ "In stock" if product["quantity"] > 0 else "Out of Stock" }}

{% elif session.get("user_type") == "supplier" and session.get("user_id") == product["supplierID"] %}

In Stock: {{ product["quantity"] }}

{% elif session.get("user_type") == "admin" %}

In Stock: {{ product["quantity"] }}

{% else %}

Availability: {{ "In stock" if product["quantity"] > 0 else "Out of Stock" }}

{% endif %}

Price: $ {{ product["price"] }}

{{ (product["product_description"] + " ") * 2 }}

{% if session.get("user_type") == "customer" %}

In Cart: {{ in_cart }}

{% else %}
{% endif %} {% if session.get("user_type") == "customer" or session.get("user_type") == None %}
{% elif session.get("user_type") == "supplier" and session.get("user_id") == product["supplierID"] %}




{% else %}


{% endif %} {% if reviews != [] %}

Reviews


{% for start, end in [[0, 2], [2, 4], [4, 6]] %}
{% for review in reviews[start:end] %}

{{ review["name"] }}

{{ review["rating"] }} / 5

{{ review["review_date"] }}

{% if review["content"] != "" %}

{{ review["content"][:250] }} ...

{% endif %}
{% endfor %}
{% endfor %} {% endif %} {% if prev != None and not reviewed %} {% if reviews == [] %}

Drop a review


{% endif %}

You ordered this product on {{ prev["order_date"] }}. Rate the product out of 5!

{% endif %} {% if more != [] %}

More from {{ supplier["name"] }}


{% for product in more %}

{{ product["name"] }}

{% if product["rating"] == None %}

No ratings yet

{% else %}

{{ product["rating"] }} / 5

{% endif %}

Price: $ {{ product["price"] }}

{{ product["product_description"][:250] }} ...

{% endfor %}
{% endif %} {% endblock %}