{% extends "base.html" %}
{% from "components/pagination.html" import render_pagination %}
{% block title %}{{ university }} · Campus Overview · Admin{% endblock %}
{% macro kpi(label, value, icon, color) %}
{# ---------- Header ---------- #}
{{ university }}
Campus Overview
Verification and marketplace insights for this university.
Back to University Analytics
{# ---------- Verification KPIs ---------- #}
{{ kpi('Verified Students', "{:,}".format(stats.verified), 'bi-patch-check-fill', 'success') }}
{{ kpi('Pending Verification', "{:,}".format(stats.pending), 'bi-hourglass-split', 'warning') }}
{{ kpi('Rejected Requests', "{:,}".format(stats.rejected), 'bi-x-circle-fill', 'danger') }}
{{ kpi('Verification Rate', "%.1f%%"|format(stats.verification_rate), 'bi-graph-up-arrow', 'primary') }}
{{ kpi('Total Requests', "{:,}".format(stats.total_requests), 'bi-collection-fill', 'info') }}
{{ kpi('Avg Review Time',
(("%.1f Days"|format(stats.avg_review_days)) if stats.avg_review_days is not none else '—'),
'bi-clock-history', 'secondary') }}
{# ---------- Verified Student Directory ---------- #}
{% if students.items %}
{% if students.pages > 1 %}
{{ render_pagination(students, 'admin.campus_overview', {'university_name': university}) }}
{% endif %}
{% else %}
No verification data is available for this university.
{% endif %}
{# ---------- University Verification Timeline (reuses history) ---------- #}
{# ---------- Marketplace Snapshot (Version 2 — live analytics) ---------- #}
{% macro metric(label, value, icon, color, sub=None) %}
{{ value }}
{{ label }}
{% if sub %}
{{ sub }}
{% endif %}
{% endmacro %}
Marketplace Snapshot
{% if marketplace.listing.total == 0 %}
No marketplace activity yet.
{% else %}
{# Listings by status #}
{{ metric('Total Listings', "{:,}".format(marketplace.listing.total), 'bi-box-seam-fill', 'primary') }}
{{ metric('Active Listings', "{:,}".format(marketplace.listing.active), 'bi-lightning-charge-fill', 'success') }}
{{ metric('Sold Listings', "{:,}".format(marketplace.listing.sold), 'bi-cart-check-fill', 'info') }}
{{ metric('Reserved Listings', "{:,}".format(marketplace.listing.reserved), 'bi-bookmark-check-fill', 'warning') }}
{{ metric('Expired Listings', "{:,}".format(marketplace.listing.expired), 'bi-hourglass-bottom', 'secondary') }}
{# Module KPIs #}
{{ metric('Premium Members', "{:,}".format(marketplace.premium.premium_members), 'bi-star-fill', 'warning',
sub="%.1f%% of verified"|format(marketplace.premium.premium_rate)) }}
{{ metric('Saved Listings', "{:,}".format(marketplace.saved.total_favorites), 'bi-bookmark-fill', 'primary',
sub="%s avg / listing"|format(marketplace.saved.avg_per_listing)) }}
{{ metric('Total Reports', "{:,}".format(marketplace.report.total), 'bi-flag-fill', 'danger',
sub="%d pending · %d resolved"|format(marketplace.report.pending, marketplace.report.resolved)) }}
{{ metric('Conversations', "{:,}".format(marketplace.message.total_conversations), 'bi-chat-dots-fill', 'info',
sub="%d active"|format(marketplace.message.active_conversations)) }}
{{ metric('Total Messages', "{:,}".format(marketplace.message.total_messages), 'bi-envelope-fill', 'success') }}
{# Meetups — module not implemented yet #}
{# Top Categories #}
| Category | Listings |
{% for c in marketplace.top_categories %}
| {{ c.category }} | {{ "{:,}".format(c.listings) }} |
{% else %}
| No categories yet. |
{% endfor %}
{# Campus Health #}
{% for label, value, icon, color in [
('Verification Rate', marketplace.health.verification_rate, 'bi-patch-check', 'primary'),
('Premium Adoption', marketplace.health.premium_adoption, 'bi-star', 'warning'),
('Report Rate', marketplace.health.report_rate, 'bi-flag', 'danger'),
('Active Listing Rate', marketplace.health.active_listing_rate, 'bi-lightning-charge', 'success')
] %}
{{ "%.1f%%"|format(value) }}
{{ label }}
{% endfor %}
{# ---------- Marketplace Insights ---------- #}
Marketplace Insights
{# Top Sellers #}
| Student | Listings | Active | Sold |
{% for s in marketplace.insights.top_sellers %}
| {{ s.name }} |
{{ s.listings }} |
{{ s.active }} |
{{ s.sold }} |
{% else %}
| No sellers yet. |
{% endfor %}
{# Most Popular Categories #}
| Category | Listings | Favorites |
{% for c in marketplace.insights.popular_categories %}
| {{ c.category }} | {{ c.listings }} | {{ c.favorites }} |
{% else %}
| No categories yet. |
{% endfor %}
{# Most Saved Listings #}
| Listing | Seller | Saves |
{% for l in marketplace.insights.most_saved %}
| {{ l.title }} |
{{ l.seller }} |
{{ l.saves }} |
{% else %}
| No saved listings yet. |
{% endfor %}
{# Most Reported Listings #}
| Listing | Reports |
{% for l in marketplace.insights.most_reported %}
| {{ l.title }} |
{{ l.reports }} |
{% else %}
| No reported listings yet. |
{% endfor %}
{# ---------- Activity Feed (verification + listings + reports) ---------- #}
Activity Feed
{% for e in marketplace.activity_feed %}
-
{{ e.text }}
{% else %}
- No campus activity yet.
{% endfor %}
{% endif %}
{% endblock %}