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

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

{% block content %}
<h2>Approve Registration</h2>
<p>Please check registered details. 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 the user from being approved.</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>
      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>

  <fieldset>
    <legend>
      User 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.</p>

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

  </fieldset>

  <fieldset>
    <legend>
      Researcher details
    </legend>
 
    {% if isRoleInference %}
    <p class="desc">Please note: Roles will be inferred for domain objects that are associated with researchers. For example, if a researcher is a principal of a group, then the 'Principal Investigator' role is inferred in respect of that group. Similarly, if a researcher is an ordinary member of the group, the 'Researcher' role will be inferred.</p>
    {% endif %}
    <label for="id_requestedRole">Requested Group Role</label><br />
    {{ form.requestedRole }}
    <p class="desc">The requested group role determines group associations. Requesting a 'Principal Investigator' group role means the reseacher will become a principal of the requested group (below). Requesting a 'Researcher' group role means the researchers will become a normal member of the requested group. Requesting any other group role currently will not cause the researcher to be associated with a group. Of course, you can adjust all group memberships after registration.</p>
    
    <p class="desc">Please note: 
    If the requested group role is 'Principal Investigator', and no requested group (below) is selected, the researcher user will have a new group created in their name, and they will become a principal of the new group.</p>
    
    <label for="id_requestedGroup">Requested Group</label><br />
    {{ form.requestedGroup }}
    <p class="desc">Selecting a group means the researcher will be associated with that group. If the requested group role (above) is 'Researcher', the researcher will be made a normal member of the group. Alternatively, if the requested group role is 'Principal Investigator', the researcher will be made a principal of the group.</p>
    
    <label for="id_role">System Role <strong>*</strong></label><br />
    {{ form.role }}
    <p class="desc">Please note: The system role determines site-wide access rights.
    Admistrators are able to do anything with everything.
    Visitors aren't able to do very much at all.
    Staff can read most things to do with the schedule.
    Researchers can also create scanning sessions, and update most records to do with the registered studies (to include groups, projects, accounts, approvals, and scanning sessions).
    Principal Investigators are also generally able to create, read, and update things to do with the registered studies.</p>
    </p>
    <p class="desc">Please use the default selected option when approving all researchers. Change to Administrator when creating new imaging administrators.
    </p>
    
  </fieldset>

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

</form>
{% endblock %}
