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

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

{% block content %}

{% if domainObject %}

<h2>Thanks for completing registration</h2>
<p>You registration is pending approval by the service administrators.</p>

{{comment}}
<p>If you registered an email address, notification by email will be sent when the registration is approved.</p>
{{endcomment}}

{% else %}

<h2>Registration</h2>
<p>To register with this service, please fill out the form below.
</p><p>
Fields marked with <strong style="color: red">*</strong> are required.</p>
    {% if form.has_errors %}
<div class="form-errors">
  <h3>Sorry, the following problems prevented your registration from being completed.</h3>
  <ul>{% for field in form.fields %}{% if field.error %}
    <li>{{ field.error }}</li>
  {% endif %}{% endfor %}</ul>
</div>
    {% endif %}
<form action="." method="post" id="login_form" enctype="multipart/form-data">
  
  <fieldset>
    <legend>
      Personal details
    </legend>
    <label for="id_fullname">Full name <strong>*</strong></label> 
    {{ form.fullname }}
    <label for="id_email">Email address <strong>*</strong></label> 
    {{ form.email }}
    <label for="id_emailconfirmation">Email address confirmation <strong>*</strong></label> 
    {{ form.emailconfirmation }}
    <p class="desc">Please enter the email again, just to make sure you typed it correctly.</p>
  </fieldset>
  <fieldset>
    <legend>
      Login details
    </legend>
    <label for="id_name">Desired login name <strong>*</strong></label> 
    {{ form.name }}
    <p class="desc">Your login name must only contain alphanumerics, underscores, hyphens, and dots.</p><br />
    <label for="id_password">Password <strong>*</strong></label> 
    {{ form.password }}
    <p class="desc">Your password must be at least 4 characters long.</p><br />
    <label for="id_passwordconfirmation">Password confirmation <strong>*</strong></label> 
    {{ form.passwordconfirmation }}
    <p class="desc">Please enter the desired password again, just to make sure you typed it correctly.</p>
  </fieldset>
  <fieldset>
    <legend>
      Researcher details
    </legend>
    <label for="requestedRole">Requested role<strong>*</strong></label>
    <p class="desc">
    If you are a normal member of a research group, please select the 'Researcher' option here, and then select the group you belong to below.
    Alternatively, if you are responsible for a group of researchers, please select the 'Principal Investigator' option instead.
    </p>
    <ul id="attributes">
     {% for option in form.requestedRole.field_list %}
      <li>
       {{ option.label }}
       {% if form.requestedRole.error_list %}
         <div class="field-with-error">
       {% endif %}
         {{ option.field }}
       {% if form.requestedRole.error_list %}
         </div>
       {% endif %}
      </li>
     {% endfor %}
    </ul>
    <p class="desc"></p>

    <label for="id_requestedGroup">Your research group</label> 
    {{ form.requestedGroup }}
    <p class="desc">
    You may select a group you wish to join. If you select 'Principal Investigator' above and you do not select a group here, a new group will be created for you when your registration is approved.
    </p>
  </fieldset>
  
  <fieldset>
    <legend>
      Training details
    </legend>
    <label for="id_safetyTrainingCertificate">Safety training certificate</label> 
    {{ form.safetyTrainingCertificate }}
    <p class="desc">
    You may optionally provide a certificate of safety training now, or after registration. A valid safety training certificate is required to use the facility.
    </p>
  </fieldset>
  
    {% if isCaptchaEnabled %}
  <fieldset>
    <legend>
      Captcha
    </legend>
    {{ form.captchahash }}
    <label for="id_captcha">Perceived text <strong>*</strong></label> 
    <p class=""><img src="{{ captchaUrl }}" border=0/></p>
    {{ form.captcha }}
    <p class="desc">Please enter the characters you see above.</p>
  </fieldset>
    {% endif %}
  Please check the details and <input type="submit" name="submission" value="Submit" />
  <input type="hidden" name="returnPath" value="{{ returnPath }}" />
</form>

{% endif %}
{% endblock %}

{% block primarysidebar %}
{% endblock %}
