{% extends 'base.html' %}
{% load crispy_forms_tags %}

{% block content %}
{% for review in reviews %}

<article class="media content-section">
    <img class="rounded-circle article-img" src="{{ review.reviewer_photo }}">
    <div class="media-body">
        <div class="article-metadata">
            <span class="mr-2"><b>{{ review.reviewer_name }}</b></span>
            <small class="text-muted">{{ review.update_time|date:"F d, Y" }}</small>
            <small class="text-muted"> at <b>{{ review.location.care_name }}</b></small>
            <span style="color: #a41515; float: right">{% for star in "x"|ljust:review.star_rating %} &#9733; {% endfor %}</span>
        </div>
        {% if review.comment %}
            <a class="article-link" href="{% url 'predict' review.review_id %}" style="text-decoration: none; color: #232a31">
                <p class="article-content">{{ review.comment }}</p>
            </a>
        {% endif %}
        <form method="post" class="form" action="{% url 'un-replied-review' %}">
            {% csrf_token %}
                {{ form|crispy }}
            <input type="hidden" value="{{ review.review_id }}" name="review_id">
            <input class="btn btn-primary ml-2" style="float: right" type="submit", value="Submit"/>
        </form>
        </div>

</article>
{% endfor %}
{% endblock %}
