<table class="table table-responsive table-hover">
    {% for attachment in attachments %}
        <tr>
            <td style="width:120px;">
                <div class="btn-group btn-group-xs">
                    <a href="{{ route('attachments.edit', attachment.id) }}" class="btn btn-default"><span
                                class="fa fa-pencil"></span></a>
                    <a href="{{ route('attachments.delete', attachment.id) }}" class="btn btn-danger"><span
                                class="fa fa-trash"></span></a>
                    {% if attachment.file_exists %}
                        <a href="{{ route('attachments.download', attachment.id) }}" class="btn btn-default"><span
                                    class="fa fa-download"></span></a>
                    {% endif %}
                    {% if not attachment.file_exists %}
                        <a href="#" class="btn btn-danger"><span class="fa fa-exclamation-triangle"></span></a>
                    {% endif %}
                </div>
            </td>
            <td>
                {% if attachment.file_exists %}
                    <span class="fa {{ attachment.mime|mimeIcon }}"></span>
                    <a href="{{ route('attachments.view', attachment.id) }}" title="{{ attachment.filename }}">
                        {% if attachment.title %}
                            {{ attachment.title }}
                        {% else %}
                            {{ attachment.filename }}
                        {% endif %}
                    </a>
                    ({{ attachment.size|filesize }})
                    {% if null != attachment.notes_text  and '' != attachment.notes_text %}
                        {{ attachment.notes_text|default('')|markdown }}
                    {% endif %}
                {% endif %}
                {% if not attachment.file_exists %}
                    <span class="fa fa-fw fa-exclamation-triangle"></span>
                    {% if attachment.title %}
                        {{ attachment.title }}
                    {% else %}
                        {{ attachment.filename }}
                    {% endif %}
                    <br>
                    <span class="text-danger">{{ 'attachment_not_found'|_ }}</span>
                {% endif %}
            </td>
        </tr>
    {% endfor %}
</table>
