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

{% block title %}
  {% if domainObject %}
{% firstof domainObject.fullname domainObject.name %}
  {% else %}
No User!
  {% endif %}
{% endblock %}

{% block content %}
<h2>
{% firstof domainObject.fullname domainObject.name %}
</h2>

  <form>
  <fieldset>
    <legend>
      details
    </legend>
    <ul id="attributes">
    
    <li>
    <label>
    Full name:
    </label><br />
    <p><b>
    {{ domainObject.fullname }}&nbsp;
    </b></p>
    </li>

    <li>
    <label>
    Email:
    </label><br />
    <p><b>
    <a href="mailto:{{domainObject.email}}">{{ domainObject.email }}</a>&nbsp;
    </b></p>
    </li>

    <li>
    <label>
    Role:
    </label><br />
    <p><b>
    {{ domainObject.role.name }}&nbsp;
    </b></p>
    </li>

    <li>
    <label>
    Researcher:
    </label><br />
    <p><b>
    <a href="{{ uriPrefix }}/researchers/{{ domainObject.researcher.getRegisterKeyValue }}/">{{ domainObject.researcher.getLabelValue }}</a>&nbsp;
    </b></p>
    </li>

  {% if view.isViewerAdministrator %}
    <li>
    <label>
    State:
    </label><br />
    <p><b>
    {{ domainObject.state.name }}&nbsp;
    </b></p>
    </li>

    <li>
    <label>
    Date Created:
    </label><br />
    <p><b>
    {{ domainObject.dateCreated }}&nbsp;
    </b></p>
    </li>
  {% endif %}

    </ul>
  </fieldset>
  {% if domainObject.researcher %}
    {% if domainObject.researcher.getSafetyTrainingCertificateId %}
  <fieldset>
    <legend>
      certificate
    </legend>
    <img src="{{uriPrefix}}/certificates/{{domainObject.researcher.getSafetyTrainingCertificateId}}/"/>
  </fieldset>
    {% endif %}
  {% endif %}
  </form>

  {% if domainObject.isActive and view.canUpdatePerson %}
<form action="{{uriPrefix}}/persons/{{domainObject.name}}/update/" method="post">
  <strong>Do you wish to update the registeration?</strong><br />
  <p>
    <input type="submit" value="Update registration &raquo;" />
  </p>
</form>
  {% endif %}
  {% if domainObject.isPending and view.canApprovePerson %}
<form action="{{uriPrefix}}/persons/{{domainObject.name}}/approve/" method="post">
  <strong>Do you wish to approve the registration?</strong><br />
  <p>
    <input type="submit" value="Approve registration &raquo;" />
  </p>
</form>
  {% endif %}
  {% if view.canDeletePerson %}
<form action="{{uriPrefix}}/persons/{{domainObject.name}}/delete/" method="post">
  <strong>Do you wish to delete the registration?</strong><br />
  <p>
    <input type="submit" value="Delete registration &raquo;" />
  </p>
</form>
  {% endif %}

{% endblock %}

