{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}
{% load wger_extras %}

{% block title %}{% trans "Ingredient weight units" %}{% endblock %}


{% block content %}

<table class="table">
<thead>
<tr>
    <th>{% trans "Actions" %}</th>
    <th>{% trans "Name" %}</th>
</tr>
</thead>
<tbody>
{% for unit in unit_list %}
<tr>
    <td class="no-hover">
        <a href="{% url 'nutrition:weight_unit:delete' unit.id %}"
           class="wger-modal-dialog">
            <img src="{% static 'images/icons/trash.svg' %}"
                 width="22"
                 height="22"
                 alt="{% trans 'Delete' %}"
                 title="{% trans 'Delete' %}">
        </a>
        <a href="{% url 'nutrition:weight_unit:edit' unit.id %}"
           class="wger-modal-dialog">
            <img src="{% static 'images/icons/edit.svg' %}"
                 width="22"
                 height="22"
                 alt="{% trans 'Edit' %}"
                 title="{% trans 'Edit' %}">
        </a>
    </td>
    <td>{{unit.name}}</td>
</tr>
{% empty %}
<tr>
    <td colspan="2">{% trans "Nothing found" %}</td>
</tr>
{% endfor %}
</tbody>

</table>
<div style="padding-top:3em;"></div>
{% pagination paginator page_obj %}
{% endblock %}




{% block sidebar %}
{% if perms.exercises %}
<h4>{% trans "Options" %}</h4>
<p>
       <a href="{% url 'nutrition:weight_unit:add' %}"
          {% auto_link_css flavour "wger-modal-dialog" %}>
       <img src="{% static 'images/icons/new.svg' %}"
            width="32"
            height="32"
            alt="{% trans 'Add new weight unit' %}"
            title="{% trans 'Add new weight unit' %}">
       {% trans "Add new weight unit" %}
       </a>
</p>
{% endif %}
{% endblock %}
