{% load i18n crud_tags %}
{% block preitemrow %}{% endblock preitemrow %}
{% block itemrow %}
<tr>
    {% for field in view.list_display %}
        <td>{% if actions|length %}{% if forloop.first %}<input class="item-selection-checkbox" type="checkbox" id="id_select_{{ rowindex }}" data-pk="{{ object.pk }}"></input>&nbsp;&nbsp;{% endif %}{% endif %}{% eval_field view field object %}</td>
    {% endfor %}
    {% if item_actions|length or allow_edit or allow_delete %}
    <td class="text-center">
        {% if item_editable %}
        <a onclick="editItemThunk({{object.pk}});" href="javascript:void(0);">{% trans "Edit" %}</a>&nbsp;
        {% endif %}
        {% if item_deletable %}
        <a onclick="deleteItemThunk({{object.pk}}, '{{ object }}');" href="javascript:void(0);">{% trans "Delete" %}</a><br/>
        {% endif %}
        {% for action in item_actions %}
        <a onclick="javascript:invokeCustomItemAction('{{action.key}}', '{{object.pk}}');" title="{{action.title}}" {%if not action.url%}onclick="invokeCustomItemAction('{{action.key}}', {{object.pk}});"{%endif%} href="javascript:void(0);"><span class="{{action.css}}"></span></a>
        {% endfor %}
        {% comment %}
        <div class="btn-group" role="group">
        {% for action in item_actions %}
        <button type="button" class="btn btn-primary {{btn_class}}" onclick="javascript:invokeCustomItemAction('{{action.key}}', '{{object.pk}}');" title="{{action.title}}" {%if not action.url%}onclick="invokeCustomItemAction('{{action.key}}', {{object.pk}});"{%endif%}><span class="{{action.css}}"></span></a>
        {% endfor %}
        </div>
        <div class="btn-group" role="group">
        {% if item_editable %}
        <button type="button" class="btn btn-success {{btn_class}}" title="{% trans 'Edit' %}" onclick="editItemThunk({{object.pk}});"><span class="glyphicon glyphicon-pencil"></span></a>
        {% else %}
        <button type="button" class="btn btn-success {{btn_class}} disabled" disabled title="{% trans 'Edit' %}" onclick="javascript:void(0);"><span class="glyphicon glyphicon-pencil"></span></a>
        {% endif %}
        {% if item_deletable %}
        <button type="button" class="btn btn-danger {{btn_class}}" title="{% trans 'Delete' %}" onclick="deleteItemThunk({{object.pk}}, '{{ object }}');"><span class="glyphicon glyphicon-trash"></span></a>
        {% else %}
        <button type="button" class="btn btn-danger {{btn_class}} disabled" disabled title="{% trans 'Delete' %}" onclick="javascript:void(0);"><span class="glyphicon glyphicon-trash"></span></a>
        {% endif %}
        </div>
        {% endcomment %}
    </td>
    {% endif %}
</tr>
{% endblock itemrow %}
{% block postitemrow %}{% endblock postitemrow %}
