{% extends "persons/master.html" %}

{% block title %}Update Registration{% endblock %}

{% block content %}
<h2>Update Registration</h2>
<p>Please update details as required. Fields marked with a <strong class="fieldset">*</strong> are required.</p>
{% if form.has_errors %}
<div class="form-errors">
  <h3>Sorry, the following problems prevented your changes from being saved.</h3>
  <ul>{% for field in form.fields %}{% if field.error %}
    <li>{{ field.error }}</li>
  {% endif %}{% endfor %}</ul>
</div>
{% endif %}
<form action="." method="post" enctype="multipart/form-data">
  <fieldset>
    <legend>
      Login details
    </legend>

    <label for="noneditable_name">Login name</label><br />
    <p><span id="noneditable_name">{{ domainObject.name }}</span></p>
    <p class="desc">Please note that you can't change the login name after registration.</p>

    <label for="id_password">Password <strong>*</strong></label><br />
    {{ form.password }}
    <p class="desc">Leave this and the following field blank if you don&rsquo;t wish to change the password. If you do change the password, note that the new password must be at least 4 characters long.</p>

  </fieldset>
  <fieldset>
    <legend>
      Personal details
    </legend>

    <label for="id_fullname">Full name <strong>*</strong></label><br />
    {{ form.fullname }}

    <label for="id_email">Email address</label><br />
    {{ form.email }}

  </fieldset>

{% if domainObject.researcher %}
  <fieldset>
    <legend>
      Training details
    </legend>
    <label for="id_safetyTrainingCertificate">Safety training certificate</label>
    {{ form.safetyTrainingCertificate }}
    <p class="desc">
    Valid safety training is required to use the facility.
    </p>
  </fieldset>
{% endif %}

{% if form.role %}
  <fieldset>
    <legend>
      System details
    </legend>
 
    <label for="id_role">Role <strong>*</strong></label><br />
    {{ form.role }}
  
    <label for="id_researcher">Researcher</label><br />
    {{ form.researcher }}
    
  </fieldset>
{% endif %}

  Please check the details and <input type="submit" name="submission" value="Submit" />

</form>
{% endblock %}
