{% extends "base.html" %} {% from "components/pagination.html" import render_pagination %} {% block title %}{{ university }} · Campus Overview · Admin{% endblock %} {% macro kpi(label, value, icon, color) %}
{{ value }}
{{ label }}
{% endmacro %} {% set action_tone = {'submitted': 'info', 'updated': 'warning', 'approved': 'success', 'rejected': 'danger'} %} {% block content %}
{# ---------- 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 ---------- #}

Verified Student Directory

View Pending Verification Requests
{% if students.items %}
{% for u in students.items %} {% set p = u.profile %} {% endfor %}
StudentStudent IDVerified OnStatus
{% if p and p.profile_picture %} {% else %}{{ (p.full_name if p else u.email)[0]|upper }}{% endif %} {{ p.full_name if p else u.email }} {{ p.university_student_id or '—' if p else '—' }} {% if p and p.verification_reviewed_at %}{{ p.verification_reviewed_at.strftime('%d %b %Y') }}{% else %}—{% endif %} Verified
{% 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) ---------- #}

Verification Timeline

    {% for a in recent_activity %}
  • {{ a.name }} {{ a.action|capitalize }}
  • {% else %}
  • No verification activity yet.
  • {% endfor %}
{# ---------- 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 #}
—
Meetups Coming Soon
{# Top Categories #}

Top Categories

{% for c in marketplace.top_categories %} {% else %} {% endfor %}
CategoryListings
{{ c.category }}{{ "{:,}".format(c.listings) }}
No categories yet.
{# Campus Health #}

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 #}

Top Sellers

{% for s in marketplace.insights.top_sellers %} {% else %} {% endfor %}
StudentListingsActiveSold
{{ s.name }} {{ s.listings }} {{ s.active }} {{ s.sold }}
No sellers yet.
{# Most Popular Categories #}

Most Popular Categories

{% for c in marketplace.insights.popular_categories %} {% else %} {% endfor %}
CategoryListingsFavorites
{{ c.category }}{{ c.listings }}{{ c.favorites }}
No categories yet.
{# Most Saved Listings #}

Most Saved Listings

{% for l in marketplace.insights.most_saved %} {% else %} {% endfor %}
ListingSellerSaves
{{ l.title }} {{ l.seller }} {{ l.saves }}
No saved listings yet.
{# Most Reported Listings #}

Most Reported Listings

{% for l in marketplace.insights.most_reported %} {% else %} {% endfor %}
ListingReports
{{ l.title }} {{ l.reports }}
No reported listings yet.
{# ---------- Activity Feed (verification + listings + reports) ---------- #}

Activity Feed

{% endif %}
{% endblock %}