{% extends "base.html" %}
{% load i18n %}

{% block title %}{{ object }}{% endblock %}

{% block main %}
    <h1>{{ object }}</h1>
    <h2>{% trans "Review for:" %} {{ object.reviewed_item }} ({{ object.creation_date|date:"SHORT_DATETIME_FORMAT" }})</h2>
    {% if object.content %}
        <h3>{{ object.get_user }} {% trans "wrote" %}:</h3>
        <p>{{ object.content }}</p>
    {% else %}
        <p>{% blocktrans with user=object.get_user %}{{ user }} reviewed without description.{% endblocktrans %}</p>
    {% endif %}
    {% if object.ratings.all %}
        <h3>{% trans "Ratings" %}{% if object.get_average_rating %} ({{ object.get_average_rating }} {% trans "of" %} 5){% endif %}</h3>
        <ul>
            {% for rating in object.ratings.all %}
                <li>{{ rating.category }}: {{ rating.get_value_display }} {% trans "of" %} 5</li>
            {% endfor %}
        </ul>
    {% endif %}
    {% if object.user == request.user and object.is_editable %}
        <p>{% trans "This is your own review." %} <a href="{% url "review_update" pk=review.pk %}">{% trans "Change it." %}</a></p>
    {% endif %}
{% endblock %}
