{% extends "soc/base.html" %}
{% comment %}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}
{% load forms_helpers %}

{% block body %}
{% block instructions %}
Use this page to manage the Student Project. You can (re)assign Mentors here and check the status of the evaluations.
{% endblock %}

<p>
<table>
  {% readonly_field_as_table_row "Student Name" entity.student.name %}
  {% readonly_field_as_table_row "Mentor Name" entity.mentor.name %}
  {% readonly_field_as_table_row entity.fields.title.label entity.title %}
  {% readonly_field_as_table_row entity.fields.abstract.label entity.abstract %}
</table>
</p>

{% ifequal entity.status "accepted" %}
  <p>
  <b>Primary Mentor</b><br />
  In this section you can assign a new Primary Mentor.
  Note that if you select a co-Mentor from this list that Mentor will be removed from the co-Mentors.
  <form method="POST">
    <table>
      {% as_table mentor_edit_form %}
    </table>
    <table>
    <tr>
     <td colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td> 
        <input style="font-weight: bold" type="submit" value="Submit" name="set_mentor"/></span>
      </td>
      <td>
        <input type="button" value="Back to Previous Page" onClick="javascript: history.go(-1)">
      </td>
    </tr>
   </table>
  </form>
  </p>
  
  <p>
  <b>Co-Mentors</b><br/>
  In this section you can add/remove co-mentors for this project.
  Co-mentors usually play a vital role in the success of a project, however they are not responsible for taking evaluations.
  <table>
    {% for mentor in additional_mentors %}
      <tr>
        <td>
          {{ mentor.name }}
        </td>
        <td>
          <input type="button" onclick="location.href='?remove={{ mentor.link_id }}'" value="Remove"/>
        </td>
    {% endfor %}
  </table>
  
  <form method="POST">
    <table>
      {% as_table additional_mentor_form %}
    </table>
    <table>
    <tr>
     <td colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td> 
        <input style="font-weight: bold" type="submit" value="Add" name="add_additional_mentor"/></span>
      </td>
      <td>
        <input type="button" value="Back to Previous Page" onClick="javascript: history.go(-1)">
      </td>
    </tr>
   </table>
  </form>
  </p>
{% endifequal %}

<p>
<b>Evaluations</b><br />
This section contains the Mentor and Student Evaluations.
From here you can view the Mentor and Student Evaluations and if possible (re)take the evaluations given by your Mentor.

{% with evaluation_list as list %}
  {% for list_number in list.lists %}
    <p>
      {% include list.nextList %}
    </p>
  {% endfor %}
{% endwith %}
</p>
{% endblock %}
