{% extends "base.html" %} {% from "components/pagination.html" import render_pagination %} {% from "components/empty_state.html" import empty_state %} {% block title %}User Management · Admin{% endblock %} {% macro card(label, value, icon, color) %}
{{ value }}
{{ label }}
{% endmacro %} {% block content %}

User Management

Search, filter and manage marketplace users.

Analytics
{# ---------- Summary ---------- #} {% set s = summary %}
{{ card('Total Users', "{:,}".format(s.total_users), 'bi-people-fill', 'primary') }} {{ card('Premium', "{:,}".format(s.premium_users), 'bi-star-fill', 'warning') }} {{ card('Free', "{:,}".format(s.free_users), 'bi-person', 'secondary') }} {{ card('New (30d)', "{:,}".format(s.new_users_30d), 'bi-person-plus-fill', 'info') }} {{ card('Suspended', "{:,}".format(s.suspended_users), 'bi-slash-circle', 'danger') }} {{ card('Avg Listings/User', s.avg_listings_per_user, 'bi-box-seam', 'success') }}
{# ---------- Filters (sticky) ---------- #}
{# ---------- Table ---------- #}
{% for r in rows %} {% set detail_url = url_for('admin.user_detail', public_id=r.public_id) %} {% else %} {% endfor %}
UserRolePremium ListingsFeatured JoinedLast LoginStatusActions
{% if r.profile_picture %} {% else %}{{ r.full_name[0]|upper }}{% endif %}
{{ r.full_name }} {{ r.email }}
{{ 'Admin' if r.role == 'super_admin' else 'Student' }} {% if r.is_premium %}Premium{% else %}Free{% endif %} {{ "{:,}".format(r.listings) }} {{ "{:,}".format(r.featured) }} {{ r.joined.strftime('%d %b %Y') }} {% if r.last_login %}{{ r.last_login.strftime('%d %b %Y') }}{% else %}—{% endif %} {{ r.account_status|title }} Manage
{{ empty_state('bi-people', 'No users found', 'No users match the current search and filters.', reset_label='Reset filters', reset_url=url_for('admin.users'), compact=true) }}
{{ render_pagination(pagination, 'admin.users', filter_args) }}
{% endblock %}