<%! from django.utils.translation import ugettext as _ %>
<%! from django.core.urlresolvers import reverse %>
<%inherit file="../main.html" />
<%block name="bodyclass">midcourse-reverification-process step-dash register</%block>
<%block name="pagetitle">${_("Reverification Status")}</%block>

<%block name="content">
<div class="container">
  <section class="wrapper">
    <div class="wrapper-content-main">
      <article class="content-main">

        <h2 class="title">${_("You are in the ID Verified track")}</h2>

        <div class="copy">

          % if reverifications["must_reverify"]: # If you have reverifications to do
            % if len(reverifications["must_reverify"]) > 1: # If you have >1 reverifications
              <div class="wrapper-reverify-open">
                <h3 class="title">${_("You currently need to re-verify for the following courses:")}</h3>
                <ul class="reverification-list">
                % for item in reverifications["must_reverify"]: # for 1st
                  <li class="item">
                    <div class="course-info">
                      <h3 class="course-name">${item.course_name} (${item.course_number})</h3>
                      <p class="deadline">${_('Re-verify by {date}').format(date="<strong>" + item.date + "</strong>")}</p>
                    </div>
                    <p class="reverify-status"><a class="btn action-primary action-reverify" href="${reverse('verify_student_midcourse_reverify', kwargs={'course_id': item.course_id.to_deprecated_string()})}">
			${_("Re-verify for {course_number}").format(course_number=item.course_number)}
		    </a></p>
                  </li>
                % endfor
                </ul>
              </div>

            % else: # You only have one reverification
              <div class="wrapper-reverify-open">
                <h3 class="title">${_("You currently need to re-verify for the following course:")}</h3>

                <ul class="reverification-list">
                % for item in reverifications["must_reverify"]:
                  <li class="item">
                    <div class="course-info">
                      <h3 class="course-name">${item.course_name} (${item.course_number})</h3>
                      <p class="deadline">${_('Re-verify by {date}').format(date="<strong>" + item.date + "</strong>")}</p>
                    </div>
                    <p class="reverify-status"><a class="btn action-primary action-reverify" href="${reverse('verify_student_midcourse_reverify', kwargs={'course_id': item.course_id.to_deprecated_string()})}">
			${_("Re-verify for {course_number}").format(course_number=item.course_number)}
		    </a></p>
                  </li>
                % endfor
                </ul>
              </div>
          %endif
        % else:
        <div class="wrapper-reverify-open">
          <p class="title">${_("You have no re-verifications at present.")}</p>
          </div>
        %endif

          % if reverifications["pending"] or reverifications["approved"] or reverifications["denied"]:
            <div class="wrapper-reverify-status">
              <h3 class="title">${_("The status of your submitted re-verifications:")}</h3>
              <ul class="reverification-list reverification-status">

              % for item in reverifications["pending"]:
                <li class="item pending">
                  <div class="course-info">
                    <h3 class="course-name">${item.course_name} (${item.course_number})</h3>
                    <p class="deadline">${_('Re-verify by {date}').format(date="<strong>" + item.date + "</strong>")}</p>
                  </div>
                  <p class="reverify-status pending">${_("Pending")}</p>
                </li>
              % endfor

              % for item in reverifications["approved"]:
                <li class="item complete">
                  <div class="course-info">
                    <h3 class="course-name">${item.course_name} (${item.course_number})</h3>
                    <p class="deadline">${_('Re-verify by {date}').format(date="<strong>" + item.date + "</strong>")}</p>
                  </div>
                  <p class="reverify-status complete">${_("Complete")}</p>
                </li>
              % endfor

              % for item in reverifications["denied"]:
                <li class="item failed">
                  <div class="course-info">
                    <h3 class="course-name">${item.course_name} (${item.course_number})</h3>
                    <p class="deadline">${_('Re-verify by {date}').format(date="<strong>" + item.date + "</strong>")}</p>
                  </div>
                  <p class="reverify-status">${_("Failed")}</p>
                </li>
              % endfor

              </ul>
            </div>
          % endif

          % if reverifications["must_reverify"]:
            <p class="support">${_("Don't want to re-verify right now?") + u" {a_start}{text}{a_end}".format(
	        text=_("Return to where you left off"),
                a_start='<a href="{url}">'.format(url=referer),
                a_end="</a>",
              )}</p>
          % else:
          <p class="support">${u"{a_start}{text}{a_end}".format(
	        text=_("Return to where you left off"),
                a_start='<a href="{url}">'.format(url=referer),
                a_end="</a>",
              )}</p>
          % endif

        </div>

        <div class="wrapper-reverification-help list-faq">

          <div class="faq-item">
            <h3 class="title faq-question">${_("Why do I need to re-verify?")}</h3>
            <div class="copy faq-answer">

              <p>${_("At key points in a course, the professor will ask you to re-verify your identity by submitting a new photo of your face. We will send the new photo to be matched up with the photo of the original ID you submitted when you signed up for the course. If you are taking multiple courses, you may need to re-verify multiple times, once for every important point in each course you are taking as a verified student.")}</p>
            </div>
          </div>

          <div class="faq-item">
            <h3 class="title faq-question">${_("What will I need to re-verify?")}</h3>
            <div class="copy faq-answer">

              <p>${_("Because you are just confirming that you are still you, the only thing you will need to do to re-verify is to <b>submit a new photo of your face with your webcam</b>. The process is quick and you will be brought back to where you left off so you can keep on learning.")}</p>

              <p>${_("If you changed your name during the semester and it no longer matches the original ID you submitted, you will need to re-edit your name to match as well.")}</p>
            </div>
          </div>

          <div class="faq-item">
            <h3 class="title faq-question">${_("What if I have trouble with my re-verification?")}</h3>
            <div class="copy faq-answer">
              <p>${_('Because of the short time that re-verification is open, you <strong>will not be able to correct a failed verification</strong>. If you think there was an error in the review, please contact us at {email}').format(email='<a class="contact-link" href="mailto:{email}"">{email}</a>.'.format(email=billing_email))}</p>
            </div>
          </div>
        </div>

      </article>
    </div> <!-- /wrapper-content-main -->

  </section>
</div>
</%block>
