{% extends "openassessmentblock/peer/oa_peer_assessment.html" %}
{% load i18n %}

{% block list_item %}
<li
    id="openassessment__peer-assessment"
    class="openassessment__steps__step step--peer-assessment ui-toggle-visibility is--complete"
    data-submission-uuid="{{ peer_submission.uuid }}"
>
{% endblock %}

{% block title %}
<span class="step__status">
  <span class="step__status__label">{% trans "This step's status" %}:</span>
  <span class="step__status__value">
    <i class="icon fa fa-check" aria-hidden="true"></i>
    <span class="copy">
      {% with graded_string=graded|stringformat:"s" %}
      {% blocktrans with num_graded='<span class="step__status__value--completed">'|safe|add:graded_string|add:'</span>'|safe %}
        Complete ({{ num_graded }})
      {% endblocktrans %}
      {% endwith %}
    </span>
  </span>
</span>
{% endblock %}

{% block body %}
<div class="ui-toggle-visibility__content">
    <div class="wrapper--step__content">

        <div class="step__message message message--complete">
            <h3 class="message__title">{% trans "Peer Assessments Complete" %}</h3>
            <div class="message__content">{% trans "You have successfully completed all of the required peer assessments for this assignment. You may assess additional peer responses if you want to. Completing additional assessments will not affect your final grade." %}</div>
        </div>

        <div class="step__instruction">
            <p>{% trans "Read and assess the following response from one of your peers." %}</p>
        </div>

        <div class="step__content">
            <ul class="list--peer-assessments">
                <li class="list--peer-assessments__item">
                    <article class="peer-assessment" id="peer-assessment--001">
                        <div class="peer-assessment__display">
                            <header class="peer-assessment__display__header">
                                <h3 class="peer-assessment__display__title">{% trans "Assessment #" %}
                                    <span class="peer-assessment__number--current">{{ review_num }}</span> of
                                    <span class="peer-assessment__number--required">{{ must_grade }}</span>
                                </h3>
                            </header>

                            {% trans "Your peer's response to the question above:" as translated_label %}
                            {% include "openassessmentblock/oa_submission_answer.html" with answer=peer_submission.answer answer_text_label=translated_label %}

                            {% trans "Associated File" as translated_header %}
                            {% include "openassessmentblock/oa_uploaded_file.html" with file_upload_type=file_upload_type file_url=peer_file_url header=translated_header class_prefix="peer-assessment" show_warning="true" %}
                        </div>

                        <form id="peer-assessment--001__assessment" class="peer-assessment__assessment" method="post">
                            {% include "openassessmentblock/oa_rubric.html" with rubric_type="peer" %}
                        </form>
                    </article>
                </li>
            </ul>
        </div>

        <div class="step__actions">
            <div class="message message--inline message--error message--error-server">
                <h3 class="message__title">{% trans "We could not submit your assessment" %}</h3>
            </div>

            <ul class="list list--actions">
                <li class="list--actions__item">
                    <button type="submit" id="peer-assessment--001__assessment__submit" class="action action--submit is--disabled">
                        <span class="copy">{{ submit_button_text }}</span>
                    </button>
                </li>
            </ul>
        </div>
    </div>
</div>
{% endblock %}
