{% for doc in documents %}
<tr>
    <td>
        {% if doc.document.url %}
            <a href="{{ doc.document.url }}" target="_blank">{{ doc.get_document_type_display }}</a>
        {% else %}
            {{ doc.get_document_type_display }}
        {% endif %}
    </td>
    <td>{{ doc.notes|default:"-" }}</td>
    <td>{{ doc.document.name|default:"-" }}</td>
    <td>
        {% if doc.document.url %}
            <a href="{{ doc.document.url }}" target="_blank" class="btn btn-sm btn-outline-primary">
                <i class="bi bi-eye"></i> View
            </a>
        {% else %}
            <span class="text-muted">No File</span>
        {% endif %}
    </td>
</tr>
{% empty %}
<tr>
    <td colspan="4" class="text-center text-muted">No documents found.</td>
</tr>
{% endfor %}
