{% extends "admin/base_site.html" %}
{% load i18n admin_urls static admin_modify pcart_core %}

{% block title %}{% trans "System info" %}{% endblock %}

{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}

{% block coltype %}colM{% endblock %}

{% block bodyclass %}{{ block.super }} dashboard app-{{ opts.app_label }} change-form{% endblock %}

{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; {% trans "System info" %}
</div>
{% endblock %}
{% endif %}

{% block content %}
<div id="content-main">
    <h1 style="font-size:28px !important;">{% trans "P-Cart 2 E-Commerce Platform" %}</h1>
    <h2>{% trans "General info" %}</h2>
    <table>
        <tr>
            <td>{% trans "Python version" %}</td>
            <td>{{python_version}}</td>
        </tr>
        <tr>
            <td>{% trans "Django version" %}</td>
            <td>{{django_version}}</td>
        </tr>
        <tr>
            <td>{% trans "Operating system" %}</td>
            <td>{{os_version}}</td>
        </tr>
        <tr>
            <td>{% trans "Virtual environment" %}</td>
            <td>{{virtualenv_dir}}</td>
        </tr>
        <tr>
            <td>{% trans "System user" %}</td>
            <td>{{system_user}}</td>
        </tr>
        <tr>
            <td>{% trans "Total memory" %}</td>
            <td>{{memory_stats.total}} {% trans "bytes" %}</td>
        </tr>
        <tr>
            <td>{% trans "Memory usage" %}</td>
            <td>{{memory_stats.percent}} % ({{memory_stats.used}} {% trans "bytes" %})</td>
        </tr>
        <tr>
            <td>{% trans "PID" %}</td>
            <td>{{pid}}</td>
        </tr>
        <tr>
            <td>{% trans "Process command line" %}</td>
            <td>{{current_process.cmdline|join:" "}}</td>
        </tr>
    </table>
    <h2>{% trans "Installed libraries" %}</h2>
    <table>
        <tr>
            <th>{% trans "Library" %}</th>
            <th>{% trans "Version" %}</th>
        </tr>
    {% for i in libraries %}
        <tr>
            {% if "pcart-" in i.key %}
            <td><strong>{{i.key}}</strong></td>
            {% else %}
            <td>{{i.key}}</td>
            {% endif %}
            <td>{{i.version}}</td>
        </tr>
    {% endfor %}
    </table>
</div>
<div id="content-related">
    <div class="module">
        <h2>{% trans "Actions" %}</h2>
        <a class="btn" href="{% url 'pcart_core:pcart-admin-clear-cache' %}">{% trans "Clear cache" %}</a>
    </div>
</div>
{% endblock %}
