{% extends "base.html" %} {% from "components/empty_state.html" import empty_state %} {% block title %}Student Verifications · Admin{% endblock %} {% macro kpi(label, value, icon, color) %}
{{ value }}
{{ label }}
{% endmacro %} {# A university name links to its Campus Overview page. #} {% macro uni_link(name) %} {{ name }} {% endmacro %} {# Rank medal for the top three, plain number afterwards. #} {% set medals = {1: 'πŸ₯‡', 2: 'πŸ₯ˆ', 3: 'πŸ₯‰'} %} {% set action_tone = {'submitted': 'info', 'updated': 'warning', 'approved': 'success', 'rejected': 'danger'} %} {% block content %}
{# ---------- Dashboard statistics (all computed in the service) ---------- #}
{{ kpi('Pending Verification', "{:,}".format(dashboard.pending), 'bi-hourglass-split', 'warning') }} {{ kpi('Verified Students', "{:,}".format(dashboard.verified), 'bi-patch-check-fill', 'success') }} {{ kpi('Rejected', "{:,}".format(dashboard.rejected), 'bi-x-circle-fill', 'danger') }} {{ kpi('Verification Rate', "%.1f%%"|format(dashboard.verification_rate), 'bi-graph-up-arrow', 'primary') }} {{ kpi('Avg Review Time', (("%.1f Days"|format(dashboard.avg_review_days)) if dashboard.avg_review_days is not none else 'β€”'), 'bi-clock-history', 'info') }}
{# ---------- Recent verification activity ---------- #}

Recent verification activity

    {% for a in dashboard.recent_activity %}
  • {{ a.name }} {{ a.action|capitalize }}
  • {% else %}
  • No verification activity yet.
  • {% endfor %}
{# ---------- University Analytics (presentation only β€” figures from the service) ---------- #}

University Analytics

Insights into verification activity across participating universities.

{% if universities.total_universities == 0 %} {# Empty state β€” no university has submitted anything yet #} {{ empty_state('bi-building', 'No university verification data yet', 'Analytics will appear once students begin submitting verification requests.') }} {% else %} {% set single = universities.total_universities == 1 %} {# ----- Growth insight cards ----- #}
Total Universities
{{ "{:,}".format(universities.total_universities) }}
Submitted at least one request
{% if single %} {# One university β†’ the min/max/top stats would be redundant; show context. #}
University analytics will become more meaningful as additional universities join Student Bazaar.
Current participating university: {{ universities.breakdown[0].university if universities.breakdown else 'β€”' }}
{% else %}
Largest Campus
{{ universities.largest.university if universities.largest else 'β€”' }}
{{ universities.largest.verified ~ ' Verified Students' if universities.largest else 'No verified students yet' }}
Smallest Active Campus
{{ universities.smallest_active.university if universities.smallest_active else 'β€”' }}
{{ universities.smallest_active.verified ~ ' Verified Student' + ('s' if universities.smallest_active.verified != 1 else '') if universities.smallest_active else 'No verified students yet' }}
{% endif %}
{% if not single %} {# ----- Top Verified Universities (hidden when only one university) ----- #}

Top Verified Universities

{% for r in universities.top_verified %} {% else %} {% endfor %}
#UniversityVerified%
{{ medals.get(r.rank, r.rank) }} {{ uni_link(r.university) }} {{ "{:,}".format(r.verified) }} {{ "%.1f%%"|format(r.pct) }}
No verified students yet.
{% endif %} {# ----- University Verification Breakdown (client-side search) ----- #}

University Verification Breakdown

{% for r in universities.breakdown %} {% endfor %}
UniversityPendingVerifiedRejectedTotal
{{ uni_link(r.university) }} {{ r.pending }} {{ r.verified }} {{ r.rejected }} {{ r.total }}
{% endif %} {# ---------- Pending queue (optionally filtered by university) ---------- #}

Pending queue

{% if university_filter %} {% endif %} {% if pending %}
{% for user in pending %} {% set p = user.profile %} {% endfor %}
Student University Student ID Mobile Submitted Action
{{ p.full_name if p else user.email }}
{{ user.email }}
{{ p.university_name or 'β€”' }} {{ p.university_student_id or 'β€”' }} {{ p.phone_number or 'β€”' }} {% if p and p.verification_submitted_at %}{{ p.verification_submitted_at.strftime('%d %b %Y') }}{% else %}β€”{% endif %} Review
{% else %} {{ empty_state('bi-patch-check', 'No pending verifications', 'Student verification requests awaiting review will appear here.') }} {% endif %}
{% endblock %}