{% extends 'manager/base.html' %} {% load static %} {% load i18n %} {% block title %}{% trans "User Profile" %} - {% if user.profile.first_name %}{{ user.profile.first_name }} {{ user.profile.last_name }}{% else %}User #{{ user.id }}{% endif %}{% endblock %} {% block header.add_script %} {% endblock %} {% block content %}
{% if user.profile.first_name %} {{ user.profile.first_name|first }}{{ user.profile.last_name|first }} {% else %} {% endif %}

{% if user.profile.first_name or user.profile.last_name %} {{ user.profile.first_name }} {{ user.profile.last_name }} {% else %} {% trans "User" %} #{{ user.id }} {% endif %}

{{ user.phone_number }}

{% if user.profile.email %}

{{ user.profile.email }}

{% endif %}

{% trans "Joined" %} {{ user.created_at|date:"F d, Y" }} {% if user.profile.last_login %} | {% trans "Last active" %} {{ user.profile.last_login|timesince }} {% trans "ago" %} {% endif %}

{{ churn_risk }} {% trans "Churn Risk" %}
{% if user.company %}

{{ user.company.name }}

{% endif %}
{{ avg_lacto_points|floatformat:1 }}
{% trans "Average Lacto Points" %}
{% trans "Last 30 days" %}
{{ recent_points.count|default:0 }}
{% trans "Activities (30d)" %}
{{ payment_history.count|default:0 }}
{% trans "Total Payments" %}
{% if user.profile.age %}{{ user.profile.age }}{% else %}N/A{% endif %}
{% trans "Age" %}
{% trans "Points Trend (30 Days)" %}
{% trans "Most Logged Activities" %}
{% if is_premium %}
{% trans "Coach Information" %}
{% if coach_info %}

{% trans "Name" %}: {{ coach_info.name }}

{% trans "Email" %}: {{ coach_info.email }}

{% trans "ID" %}: {{ coach_info.id }}

{% else %}

{% trans "No coach assigned" %}

{% endif %}
{% trans "Diet History" %}
{% if diet_history %}
{% for diet in diet_history|slice:":5" %}

{% trans "From" %}: {{ diet.from_date|date:"M d, Y" }} {% if diet.has_data %} {% trans "Active" %} {% else %} {% trans "Template" %} {% endif %}

{% trans "Created" %}: {{ diet.created_at|date:"M d, Y" }} {% trans "by" %} {{ diet.creator }}
{% endfor %} {% if diet_history|length > 5 %}

{% trans "... and" %} {{ diet_history|length|add:"-5" }} {% trans "more diets" %}

{% endif %}
{% else %}

{% trans "No diet history available" %}

{% endif %}
{% endif %}
{% trans "Send Personal Notification" %}
{% csrf_token %}
{% trans "Preview" %}
{% trans "Notification title will appear here" %}
{% trans "Notification message will appear here" %}
{% trans "Basic Information" %}

{% trans "Phone:" %} {{ user.phone_number }}

{% if user.profile.email %}

{% trans "Email:" %} {{ user.profile.email }}

{% endif %} {% if user.profile.gender is not None %}

{% trans "Gender:" %} {% if user.profile.gender %}{% trans "Female" %}{% else %}{% trans "Male" %}{% endif %}

{% endif %} {% if user.profile.birth_date %}

{% trans "Birth Date:" %} {{ user.profile.birth_date|date:"F d, Y" }}

{% endif %}
{% if user.profile.height %}

{% trans "Height:" %} {{ user.profile.height }} cm

{% endif %} {% if user.profile.weight %}

{% trans "Weight:" %} {{ user.profile.weight }} kg

{% endif %} {% if user.profile.goal_weight %}

{% trans "Goal Weight:" %} {{ user.profile.goal_weight }} kg

{% endif %} {% if user.profile.activity_level %}

{% trans "Activity Level:" %} {{ user.profile.get_activity_level_display }}

{% endif %}
{% trans "Health Information" %}
{% if user.profile.diseases %}

{% trans "Health Conditions:" %}

    {% for disease in user.profile.diseases %}
  • {{ disease }}
  • {% endfor %}
{% endif %} {% if user.profile.diabetes_type is not None %}

{% trans "Diabetes Type:" %} {{ user.profile.get_diabetes_type_display }}

{% endif %}
{% if biometrics %}

{% trans "Latest Measurements:" %}

{% if biometrics.weight %}

{% trans "Weight:" %} {{ biometrics.weight }} kg

{% endif %} {% if biometrics.bmi %}

{% trans "BMI:" %} {{ biometrics.bmi|floatformat:1 }}

{% endif %} {% if biometrics.blood_sugar %}

{% trans "Blood Sugar:" %} {{ biometrics.blood_sugar }} mg/dL

{% endif %} {% if biometrics.a1c %}

{% trans "A1C:" %} {{ biometrics.a1c }}%

{% endif %} {% endif %}
{% trans "Recent Activity (Last 30 Days)" %}
{% if recent_points %}
{% for point in recent_points|slice:":10" %}
{{ point.time|date:"M d, Y" }}

{% trans "Total Points:" %} {{ point.total_points|default:0 }}

{% trans "Diet:" %} {{ point.total_Diet_Point|default:0 }} | {% trans "Exercise:" %} {{ point.total_Exercise_Point|default:0 }} | {% trans "Water:" %} {{ point.total_Water_Point|default:0 }}
{% endfor %}
{% else %}

{% trans "No recent activity recorded" %}

{% endif %}
{% trans "Subscription Status" %}
{% with subscription=subscription_info %}
{{ subscription.status }}
{% if subscription.plan %}

{% trans "Plan:" %} {{ subscription.plan }}

{% endif %} {% if subscription.start_date %}

{% trans "Start Date:" %} {{ subscription.start_date|date:"M d, Y" }}

{% endif %} {% if subscription.end_date %}

{% trans "End Date:" %} {{ subscription.end_date|date:"M d, Y" }}

{% endif %}

{% trans "Renewal Status:" %} {{ subscription.renewal_status }}

{% endwith %}
{% trans "Payment History" %}
{% if payment_history %} {% for payment in payment_history|slice:":5" %}
${{ payment.amount_after_discount|floatformat:0 }}

{% trans "Plan" %} {{ payment.plan }}

{{ payment.created_at|date:"M d, Y" }}
{% endfor %} {% if payment_history.count > 5 %}

{% trans "... and" %} {{ payment_history.count|add:"-5" }} {% trans "more payments" %}

{% endif %} {% else %}

{% trans "No payment history" %}

{% endif %}
{% trans "Quick Actions" %}
{% if user.company %} {% trans "View Company" %} {% endif %}
{% endblock %}