{% extends "base.html" %} {% block title %}User Details - {{ selected_user.email }} - Admin Dashboard - {{ project_name }}{% endblock %} {% block content %}

User Details

{{ selected_user.email }}

User Information

Email: {{ selected_user.email }}

Name: {% if selected_user.first_name or selected_user.last_name %}{{ selected_user.first_name }} {{ selected_user.last_name }}{% else %}Not set{% endif %}

User ID: {{ selected_user.id }}

Date Joined: {{ selected_user.date_joined|date:"M d, Y H:i" }}

Last Login: {% if selected_user.last_login %}{{ selected_user.last_login|date:"M d, Y H:i" }}{% else %}Never{% endif %}

Status: {% if selected_user.is_active %}Active{% else %}Inactive{% endif %}{% if selected_user.is_staff %} Staff{% endif %}{% if selected_user.is_superuser %} Superuser{% endif %}

Credit Information

{% if credit_account %}
{% endif %}
{% if credit_account %}

Current Balance: {{ current_balance|floatformat:1 }} credits

{% if balance_breakdown %}
{% if balance_breakdown.subscription %}

Subscription: {{ balance_breakdown.subscription|floatformat:1 }} credits

{% endif %} {% if balance_breakdown.pay_as_you_go %}

Pay-as-you-go: {{ balance_breakdown.pay_as_you_go|floatformat:1 }} credits

{% endif %}
{% endif %}

Account Created: {{ credit_account.created_at|date:"M d, Y" }}

Last Updated: {{ credit_account.updated_at|date:"M d, Y H:i" }}

{% else %}

No credit account information available

{% endif %}
{% if credit_account %}

Loading credit adjustment form...

Loading credit history...

{% endif %}

Subscription Information

{% if subscription %}

Status: {{ subscription.status|title }}

Plan: {{ subscription.stripe_product_id }}

Current Period: {{ subscription.current_period_start|date:"M d, Y" }} - {{ subscription.current_period_end|date:"M d, Y" }}

{% if subscription.cancel_at_period_end %}

Cancellation: Canceling at period end

{% endif %} {% if subscription.canceled_at %}

Canceled Date: {{ subscription.canceled_at|date:"M d, Y H:i" }}

{% endif %} {% else %}

No active subscription

{% endif %}

User Statistics

Total Payments

{{ total_payments }}

Service Usage

{{ total_service_usage }}

Credits Purchased

{{ total_credits_purchased|floatformat:1 }}

Credits Consumed

{{ total_credits_consumed|floatformat:1 }}

Recent Activity

{% if recent_transactions %}
{% for transaction in recent_transactions %} {% endfor %}
Date Credits Added Source Description
{{ transaction.created_at|date:"M d, Y H:i" }} +{{ transaction.amount|floatformat:1 }} {{ transaction.credit_type }} {{ transaction.description|default:"-" }}
{% else %}

No recent credit additions

{% endif %}

Loading admin adjustments...

{% if recent_payments %}
{% for payment in recent_payments %} {% endfor %}
Date Amount Paid Payment Type Status Receipt
{{ payment.created_at|date:"M d, Y H:i" }} ${{ payment.amount|floatformat:2 }} {{ payment.payment_type }} {{ payment.status|title }} {% if payment.receipt_number %}{{ payment.receipt_number }}{% else %}-{% endif %}
{% else %}

No recent payments

{% endif %}
{% if recent_service_usage %}
{% for usage in recent_service_usage %} {% endfor %}
Date Service Credits Used
{{ usage.created_at|date:"M d, Y H:i" }} {{ usage.service.name|default:"-" }} {{ usage.credits_consumed|floatformat:1 }}
{% else %}

No recent service usage

{% endif %}
{% endblock %}