{% extends "base.html" %}
{% load static %}

{% block title %}Workshops{% endblock %}

{% block header_bar %}
    Inventory management - Workshops
{% endblock %}

{% block content %}
    <table class="list">
        <tbody>
        {% for workshop in object_list %}
            <tr>
                <td>
                    <a href="{% url 'workshop-detail' workshop.id %}" title="{{ workshop.description }}">{{ workshop.name }}</a>
                </td>
                <td>
                {% if user.is_staff %}
                    <a class="edit" href="{% url "admin:inventory_workshop_change" object_id=workshop.pk %}"><img class="icon" src="{% static 'inventory/img/edit.svg' %}"></a>
                {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {% if user.is_staff %}
        <p><a href="{% url "admin:inventory_workshop_add" %}?layout=1">Create new workshop...</a></p>
    {% endif %}


{% endblock %}