{% extends 'base.html.j2' %}

{% block title %}Software{% endblock %}
{% block content_header_icon %}{% endblock %}

{% block content %}

<input type="button" value="New Software" onclick="window.location='{% url 'ITAM:_software_add' %}';">
<table class="data">
    <tr>
        <th>Name</th>
        <th>Publisher</th>
        <th>Category</th>
        <th>Organization</th>
        <th>&nbsp;</th>
    </tr>
    {% for software in softwares %}
    <tr>
        <td><a href="{% url 'ITAM:_software_view' pk=software.id %}">{{ software.name }}</a></td>
        <td>
        {% if software.publisher %}
            <a href="{% url 'Settings:_manufacturer_view' pk=software.publisher.id %}">{{ software.publisher }}</a>
        {% else %}
            -
        {% endif %}
        </td>
        <td>{{ software.category }}</td>
        <td>{% if software.is_global %}Global{% else %}{{ software.organization }}{% endif %}</td>
        <td>&nbsp;</td>
    </tr>
    {% endfor %}

</table>

<div class="pagination">
    <span class="step-links">
        {% if page_obj.has_previous %}
            <a href="?page=1">&laquo; first</a>
            <a href="?page={{ page_obj.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
        </span>

        {% if page_obj.has_next %}
            <a href="?page={{ page_obj.next_page_number }}">next</a>
            <a href="?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
        {% endif %}
    </span>
</div>

{% endblock %}