{% extends "subjects/base.html" %} {% load i18n bootstrap4 auth utils %} {% block title %}{% translate "Subjects" %} · {{ block.super }}{% endblock %} {% block content %}
{% include 'utils/form_errors.html' with form=form %} {% csrf_token %} {% bootstrap_field form.search %}
{% if form.is_valid %} {% has_perm 'subjects.change_subject' user as can_change_subject %} {% has_perm 'subjects.view_subject' user as can_view_subject %}
{% if can_change_subject and form.cleaned_data.last_name %}
{% endif %}
{% if not can_view_subject %}

{% translate 'This list may be restricted based on your permissions.' %}

{% endif %}
    {% for subject, contact, participations, can_access in matches %}
  • {% if can_access %}
    {% if contact.title %}{{ contact.title }}{% endif %} {% if contact.first_name|lower == form.cleaned_data.first_name|lower %} {{ contact.first_name }} {% else %} {{ contact.first_name }} {% endif %} {% if contact.last_name|lower == form.cleaned_data.last_name|lower %} {{ contact.last_name }} {% else %} {{ contact.last_name }} {% endif %}
    {% if can_view_subject %}
    {% if contact.date_of_birth %}
    {{ contact.date_of_birth }}
    {% endif %} {% if contact.email %}
    {% if contact.email|lower == form.cleaned_data.email|lower %} {{ contact.email }} {% else %} {{ contact.email }} {% endif %}
    {% endif %}
    {% if subject.blocked %} {{ subject|verbose_name:'blocked' }} {% endif %} {% endif %} {% else %}

    {{ contact.full_name }}

    {% translate 'access denied' %}
    {% endif %}
    {% if can_view_subject %} {% if can_access %} {% translate 'Details' %} {% else %} {% endif %} {% endif %}
    {% if can_access %}
      {% for participation, can_recruit, can_conduct in participations %}
    • {{ participation.study }} {{ participation.study.contact_person }} {{ participation|display:'status' }} {% if participation.dropped_out %} {{ participation|verbose_name:'dropped_out' }} {% endif %}
      {% if can_recruit %} {% translate 'Recruitment' %} {% endif %} {% if can_conduct %} {% translate 'Execution' %} {% endif %}
    • {% endfor %}
    {% endif %}
  • {% empty %} {% endfor %}
{% if can_change_subject and form.cleaned_data.last_name %}
{% for error in privacy_level_form.non_field_errors %} {% endfor %} {% csrf_token %}
{% translate 'First name' %}
{{ form.cleaned_data.first_name }}
{% translate 'Last name' %}
{{ form.cleaned_data.last_name }}
{% bootstrap_field privacy_level_form.privacy_level %} {{ form.search.as_hidden }}
{% endif %}
{% endif %} {% endblock %}