{% load i18n %}
{% load tz %}
{% spaceless %}
{% block list_item %}
<li id="openassessment__self-assessment__{{ xblock_id }}"
    class="openassessment__steps__step step--self-assessment is--showing is--in-progress ui-slidable__container {% if allow_latex %}allow--latex{%endif%}"
    tabindex="-1">
{% endblock %}

    <header class="step__header ui-slidable__control">
        <span>
            {% block button %}
                <button class="ui-slidable" aria-expanded="true" id="oa_self_{{ xblock_id }}" aria-controls="oa_self_{{ xblock_id }}_content" aria-labeledby="oa_step_title_self">
                    <span class="icon fa fa-caret-right" aria-hidden="false"/>
                </button>
            {% endblock %}
        </span>

        <span>
            <h4 class="step__title">
                <span class="step__counter"></span>
                <span class="wrapper--copy">
                    <span id="oa_step_title_self" class="step__label" aria-describedby="oa_step_status_self oa_step_deadline_self">{% trans "Assess Your Response" %}</span>
                </span>
            </h4>
        </span>

       {% if self_start %}
       <span class="step__deadline">
           {# Translators: This string displays a date to the user, then tells them the time until that date.  Example: "available August 13th, 2014 (in 5 days and 45 minutes)" #}
           {% blocktrans with start_date=self_start|timezone:"UTC"|date:"c" time_until=self_start|timeuntil %}
               <span id="oa_step_deadline_self" class="date ora-datetime" data-datetime="{{ start_date }}" data-string="available {date} (in {{ time_until }})" data-timezone="{{ user_timezone }}" data-language="{{ user_language }}"></span>
           {% endblocktrans %}
       </span>
       {% elif self_due %}
       <span class="step__deadline">
           {# Translators: This string displays a date to the user, then tells them the time until that date.  Example: "due August 13th, 2014 (in 5 days and 45 minutes)" #}
           {% blocktrans with due_date=self_due|timezone:"UTC"|date:"c" time_until=self_due|timeuntil %}
               <span id="oa_step_deadline_self" class="date ora-datetime" data-datetime="{{ due_date }}" data-string="due {date} (in {{ time_until }})" data-timezone="{{ user_timezone }}" data-language="{{ user_language }}"></span>
           {% endblocktrans %}
       </span>
       {% endif %}
       {% block title %}
       <span class="step__status">
         <span id="oa_step_status_self" class="step__status__value">
             <span class="copy">{% trans "In Progress" %}</span>
         </span>
       </span>
       {% endblock %}
    </header>

    {% block body %}
    <div class="ui-slidable__content" aria-labelledby="oa_self_{{ xblock_id }}" id="oa_self_{{ xblock_id }}_content">
        <div class="wrapper--step__content">
            <div class="step__content">
                <article class="self-assessment__display">
                    {% trans "Your response" as translated_label %}
                    {% include "openassessmentblock/oa_submission_answer.html" with answer=self_submission.answer answer_text_label=translated_label %}

                    {% trans "Associated Files" as translated_header %}
                    {% include "openassessmentblock/oa_uploaded_file.html" with file_upload_type=file_upload_type file_urls=self_file_urls header=translated_header class_prefix="self-assessment" including_template="self_assessment" xblock_id=xblock_id %}
                </article>

                <form class="self-assessment--001__assessment self-assessment__assessment" method="post">
                    {% include "openassessmentblock/oa_rubric.html" with rubric_type="self" submission=self_submission %}
                </form>
            </div>

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

                <ul class="list list--actions">
                    <li class="list--actions__item">
                        <button type="submit" class="self-assessment--001__assessment__submit action action--submit" disabled>
                            {% trans "Submit your assessment" %}
                        </button>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    {% endblock %}
</li>
{% endspaceless %}
