{% extends "page.html" %}
{% block page_content %}
<div class="card">
    <div class="card-header"><h2>Паспорта объектов</h2></div>
    <div class="table-wrap"><table><thead><tr><th>Объект</th><th>Автор</th><th>Object Index</th><th>Risk Score</th><th>SLA Price</th><th>Дата</th></tr></thead>
        <tbody>{% for p in passports %}<tr>
            <td>{{ p.object.name if p.object else '' }}</td>
            <td>{{ p.creator.full_name if p.creator else '' }}</td>
            <td><strong>{{ "%.2f"|format(p.object_index) if p.object_index else '—' }}</strong></td>
            <td><span class="badge badge-{{ 'critical' if (p.risk_score or 0) > 70 else 'medium' if (p.risk_score or 0) > 40 else 'low' }}">{{ "%.2f"|format(p.risk_score) if p.risk_score else '—' }}</span></td>
            <td>{{ "%.2f"|format(p.sla_price_monthly) if p.sla_price_monthly else '—' }} ₽</td>
            <td><small>{{ p.created_at.strftime('%d.%m.%Y') if p.created_at else '' }}</small></td>
        </tr>{% endfor %}</tbody></table>
    </div>
</div>
{% endblock %}
