{% extends 'base.html' %} {% load humanize %} {% block title %}Safe deactivation{% endblock %} {% block content %}

Safe deactivation for {{ user_to_deactivate }}

{% if warning %}
{{ warning }}
{% endif %}
{% csrf_token %} {% if reservations %}

Upcoming reservations

{% if reservations|length == 1 %} There is one reservation for {{ user_to_deactivate.first_name }} that is upcoming or in progress. {% else %} There are {{ reservations|length|apnumber }} reservations for {{ user_to_deactivate.first_name }} that are upcoming or in progress. {% endif %}
{% for r in reservations %} {% endfor %}
Tool Project Start End
{{ r.tool }} {{ r.project }} {{ r.start }} {{ r.end }}
{% endif %} {% if tool_usage %}

Tool usage

{{ user_to_deactivate.first_name }} is using {{ tool_usage|length|apnumber }} tool{{ tool_usage|length|pluralize }}.
{% for t in tool_usage %} {% endfor %}
Tool Project Start
{{ t.tool }} {{ t.project }} {{ t.start }}
{% endif %} {% if user_to_deactivate.in_area %}

Area access

{{ user_to_deactivate.first_name }} is currently in the {{ user_to_deactivate.area_access_record.area }}.
{% endif %} {% if staff_charges %}

Staff charges

{% for s in staff_charges %} {{ s.staff_member }} is working on the project named "{{ s.project }}" for {{ s.customer }} since {{ s.start }}.
{% endfor %} {% if user_to_deactivate.charging_staff_time %} {% with user_to_deactivate.get_staff_charge as s %} {{ s.staff_member }} is working on the project named "{{ s.project }}" for {{ s.customer }} since {{ s.start }}.
{% endwith %} {% endif %}
{% endif %} {% if not reservations and not tool_usage and not user_to_deactivate.in_area and not staff_charges %}

This user has no future reservations, is not using any tools, is not in a billable area, and has no staff charges in progress. It is safe to proceed.

{% endif %}
{% endblock %}