{% load i18n l10n fontawesome_5 %}
<div id="compensations" class="card">
    <div class="card-header rlp-r">
        <div class="row">
            <div class="col-sm-6">
                <h5>
                    <span class="badge badge-light">{{compensations.count}}</span>
                    {% trans 'Compensations' %}
                </h5>
            </div>
            <div class="col-sm-6">
                <div class="d-flex justify-content-end">
                    {% if is_default_member and is_entry_shared  %}
                    <a href="{% url 'compensation:new' obj.id %}" title="{% trans 'Add new compensation' %}">
                        <button class="btn btn-outline-default">
                            {% fa5_icon 'plus' %}
                            {% fa5_icon 'leaf' %}
                        </button>
                    </a>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
    <div class="card-body {% if tables_scrollable %}scroll-300{% endif %} p-2">
        <table class="table table-hover">
            <thead>
            <tr>
                <th class="w-25" scope="col">
                    {% trans 'Identifier' %}
                </th>
                <th scope="col">
                    {% trans 'Title' %}
                </th>
                {% if is_default_member and is_entry_shared %}
                    <th class="w-10" scope="col">
                        <span class="float-right">
                            {% trans 'Action' %}
                        </span>
                    </th>
                {% endif %}
            </tr>
            </thead>
            <tbody>
            {% for comp in compensations %}
            <tr>
                <td class="align-middle">
                    <a href="{% url 'compensation:detail' comp.id %}">
                        {{ comp.identifier }}
                    </a>
                </td>
                <td class="align-middle">{{ comp.title }}</td>
                <td>
                {% if is_default_member and is_entry_shared %}
                    <button data-form-url="{% url 'intervention:remove-compensation' obj.id comp.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove compensation' %}">
                        {% fa5_icon 'trash' %}
                    </button>
                {% endif %}
                </td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>