{% extends "base.html" %}

{% block content %}
<div class="container mt-4">
    <h1 class="mb-4">Assessment Credits by Consultant</h1>
    <p class="text-muted">Free assessments are unlimited. Paid assessments show approved, assigned, and remaining credits.</p>
    <table class="table table-sm table-striped">
        <thead>
            <tr>
                <th>Consultant</th>
                <th>Assessment</th>
                <th>Type</th>
                <th class="text-right">Approved</th>
                <th class="text-right">Assigned</th>
                <th class="text-right">Remaining</th>
            </tr>
        </thead>
        <tbody>
            {% for row in credits %}
            <tr>
                <td>{{ row.consultant.username }}</td>
                <td>{{ row.assessment.name }}</td>
                <td>{{ 'Free' if row.is_free else 'Paid' }}</td>
                <td class="text-right">{{ row.approved if row.approved is not none else '-' }}</td>
                <td class="text-right">{{ row.assigned if row.assigned is not none else '-' }}</td>
                <td class="text-right">{{ row.remaining if row.remaining is not none else 'Unlimited' }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}