{% extends 'base_refresh.html' %} {% block content %}

{{ _("Machines status") }}

{% set ns = namespace(cpt=0) %} {% for mac in machines %} {% if (ns.cpt % 3) == 0 %}
{% endif %}
{% if mac.active_user() != None %}
{% set text = gettext("IN USE") %} {% elif mac.blocked %}
{% set text = gettext("BLOCKED") %} {% elif mac.maintenance_needed %}
{% set text = gettext("MAINTENANCE") %} {% elif not mac.isOnline() %}
{% set text = gettext("OFFLINE") %} {% else %}
{% set text = gettext("FREE") %} {% endif %}

{{ gettext("Machine status") }}: {{ text }}
{% if mac.active_user() != None %} {{ gettext("In use by:") }} {{ mac.active_user().name }}

{% endif %}

{% if mac.active_board() != None %}

Board IP: {{ mac.active_board().ip_address }}

{% endif %}
{% set ns.cpt = ns.cpt + 1 %} {% if ns.cpt % 3 == 0 %}
{% endif %} {% endfor %} {% if ns.cpt % 3 != 0 %}
{% endif %} {% endblock %}