{% with tool.get_current_usage_event as current_usage_event %}
{% if current_usage_event.operator.id == customer.id %}
You are using this tool
{% else %}
{{ current_usage_event.operator }} is using this tool
{% endif %}
{% if current_usage_event.operator.id != current_usage_event.user.id %}
on behalf of {{ current_usage_event.user }}
{% endif %}
for the project named {{ current_usage_event.project.name }} since {{ current_usage_event.start }}.
{% endif %}
{% elif tool.delayed_logoff_in_progress %}
{% with tool.get_delayed_logoff_usage_event as delayed_logoff_event %}
{{ delayed_logoff_event.operator }} has finished using the {{ tool.name_or_child_in_use_name }} but delayed logoff is in effect. The tool will be available at {{ delayed_logoff_event.end|time }}.
{% endwith %}
{% elif not tool.operational or tool.required_resource_is_unavailable or tool.scheduled_outages %}
This tool is operational but not all resources are available.
{% else %}
This tool is operational and idle.
{% endif %}
{# dangers #}
{% if tool.unavailable_required_resources or tool.scheduled_outages %}
{# Display any unavailable required resources... #}
{% for r in tool.unavailable_required_resources %}
A required resource is unavailable: {{ r.name }} ({{ r.category }}){{ r.restriction_message }}
{% endfor %}
{# Display any resources scheduled outages... #}
{% for o in tool.scheduled_outages %}
{{ o.title }} ({{ o.resource.category }})
{% if o.details %}{{ o.details }}{% endif %}
{{ o.creator }} scheduled this outage from {{ o.start }} until {{ o.end }}.
{% endfor %}
{% endif %}
{# warnings #}
{% if tool.unavailable_nonrequired_resources or tool.scheduled_partial_outages or tool.problems %}
{# Display any unavailable non-required resources... #}
{% for r in tool.unavailable_nonrequired_resources %}
An optional resource is unavailable: {{ r.name }} ({{ r.category }}){{ r.restriction_message }}
{% endfor %}
{# Display any non-required resources scheduled outages... #}
{% for o in tool.scheduled_partial_outages %}
An optional resource has an outage: {{ o.resource.name }} ({{ o.resource.category }}){{ o.title }}{% if o.details %}: {{ o.details }}{% endif %}{{ o.creator }} scheduled this outage from {{ o.start }} until {{ o.end }}.
{% endfor %}
{% endif %}
{% if tool.problems %}
{# Display all problems and shutdowns... #}
{% for t in tool.problems %}
{% if t.problem_category %}{{ t.problem_category }}{% endif %}
{{ t.problem_description }}
{% if t.estimated_resolution_time %}Estimated resolution time is {{ t.estimated_resolution_time }}.{% endif %}
This task was created by {{ t.creator }} on {{ t.creation_time }}.
{% if t.force_shutdown %}
The tool will remain shut down until this task is resolved.
{% endif %}
{% if t.progress_description %}