{% extends '_base_list.html' %}
{% load i18n %}
{% load common_tags %}
{% block content_left_head %}
    <a href="{% url 'assets:asset-create' %}" class="btn btn-sm btn-primary "> {% trans "Create asset" %} </a>
{% endblock %}

{% block table_head %}
    <th class="text-center">
        <input type="checkbox" id="check_all" onclick="checkAll('check_all', 'checked')">
    </th>
    <th class="text-center"><a href="{% url 'assets:asset-list' %}?sort=hostname">{% trans 'Hostname' %}</a></th>
    <th class="text-center"><a href="{% url 'assets:asset-list' %}?sort=username">{% trans 'IP' %}</a></th>
    <th class="text-center">{% trans 'Port' %}</th>
    <th class="text-center">{% trans 'Type' %}</th>
    <th class="text-center">{% trans 'Hardware' %}</th>
    <th class="text-center">{% trans 'Valid' %}</th>
    <th class="text-center"></th>
{% endblock %}

{% block table_body %}
     {% for asset in asset_list %}
         <tr class="gradeX">
             <td class="text-center">
                 <input type="checkbox" name="checked" value="{{ asset.id }}">
             </td>
             <td class="text-center">
                 <a href="{% url 'assets:asset-detail' pk=user.id %}">
                     {{ asset.hostname }}
                 </a>
             </td>
             <td class="text-center">{{ asset.ip }}</td>
             <td class="text-center">{{ asset.port }}</td>
             <td class="text-center">{{ asset.type }}</td>
             <td class="text-center">{{ asset.cpu }} {{ asset.memory }} {{ asset.disk }} </td>
             <td class="text-center">
                 {% if asset.is_valid.0 %}
                     <i class="fa fa-check text-navy"></i>
                 {% else %}
                     <i class="fa fa-times text-danger"></i>
                 {% endif %}
             </td>
             <td class="text-center">
                 <a href="{% url 'assets:asset-update' pk=asset.id %}" class="btn btn-xs btn-info">{% trans 'Update' %}</a>
                 <a href="{% url 'assets:asset-delete' pk=asset.id %}" class="btn btn-xs btn-danger del">{% trans 'Delete' %}</a>-
{#                 <a href="{% url '' %}">{% trans 'Delete' %}</a>#}
             </td>
         </tr>
     {% endfor %}
{% endblock %}

{% block content_bottom_left %}
    <form id="" method="get" action="" class=" mail-search">
        <div class="input-group">
            <select class="form-control m-b" style="width: auto">
                <option>{% trans 'Delete selected' %}</option>
                <option>{% trans 'Update selected' %}</option>
                <option>{% trans 'Deactive selected' %}</option>
                <option>{% trans 'Export selected' %}</option>
            </select>

            <div class="input-group-btn pull-left" style="padding-left: 5px;">
                <button id='search_btn' type="submit" style="height: 32px;"  class="btn btn-sm btn-primary">
                 {% trans 'Submit' %}
                </button>
            </div>

        </div>
   </form>
{% endblock %}

