{% load static %}
{% load inventree_extras %}
{% load i18n %}

<table class='table table-striped table-condensed'>
    <col width='25'>

    <tr>
        <td colspan="3"><b>{% trans "Server" %}</b></td>
    </tr>
    <tr>
        <td><span class='fas fa-server'></span></td>
        <td>{% trans "Instance Name" %}</td>
        <td>{% inventree_instance_name %}</td>
    </tr>
    {% if user.is_staff %}
    <tr>
        <td><span class='fas fa-server'></span></td>
        <td>{% trans "Server status" %}</td>
        <td>
            {% if system_healthy %}
            <span class='label label-green'>{% trans "Healthy" %}</span>
            {% else %}
            <span class='label label-red'>{% trans "Issues detected" %}</span>
            {% endif %}
        </td>
    </tr>
    {% if not django_q_running %}
    <tr>
        <td><span class='fas fa-tasks'></span></td>
        <td>{% trans "Background Worker" %}</td>
        <td>
            <a href='https://inventree.readthedocs.io/en/latest/admin/tasks'>
                <span class='label label-red'>{% trans "Background worker not running" %}</span>
            </a>
        </td>
    </tr>
    {% endif %}
    {% if not email_configured %}
    <tr>
        <td><span class='fas fa-envelope'></span></td>
        <td>{% trans "Email Settings" %}</td>
        <td>
            <a href='https://inventree.readthedocs.io/en/latest/admin/email'>
                <span class='label label-red'>{% trans "Email settings not configured" %}</span>
            </a>
        </td>
    </tr>
    {% endif %}
    {% endif %}

    {% if not system_healthy %}
    {% for issue in system_issues %}
    <!-- TODO - Enumerate system issues here! -->
    {% endfor %}
    {% endif %}

    <tr>
        <td colspan='3'><b>{% trans "Parts" %}</b></td>
    </tr>
    <tr>
        <td><span class='fas fa-sitemap'></span></td>
        <td>{% trans "Part Categories" %}</td>
        <td>{{ part_cat_count }}</td>
    </tr>
    <tr>
        <td><span class='fas fa-shapes'></span></td>
        <td>{% trans "Parts" %}</td>
        <td>{{ part_count }}</td>
    </tr>
    <tr>
        <td colspan="3"><b>{% trans "Stock Items" %}</b></td>
    </tr>
    <tr>
        <td><span class='fas fa-map-marker-alt'></span></td>
        <td>{% trans "Stock Locations" %}</td>
        <td>{{ stock_loc_count }}</td>
    </tr>
    <tr>
        <td><span class='fas fa-boxes'></span></td>
        <td>{% trans "Stock Items" %}</td>
        <td>{{ stock_item_count }}</td>
    </tr>
</table>