{% extends 'familytouch/base.html' %} {% block title %}My Invitations - FamilyTouch{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

📬 My Invitations

View and manage connection invitations

{% if user.is_authenticated %} {% if pending_invitations %}
🔔

You have {{ pending_invitations|length }} new invitation{{ pending_invitations|length|pluralize }}!

Review and respond to connection requests below

{% endif %}
{{ pending_invitations|length }}
Pending Invitations
{{ sent_invitations|length }}
Sent Invitations
{{ connections|length }}
Total Connections
{% if pending_invitations %} {% for invitation in pending_invitations %}
{% if invitation.sender.profile.user_type == 'patient' %} 🧑‍⚕️ {% elif invitation.sender.profile.user_type == 'doctor' %} 👨‍⚕️ {% else %} 👪 {% endif %}

{{ invitation.sender.get_full_name|default:invitation.sender.username }}

@{{ invitation.sender.username }}

{% if invitation.role == 'provider' %} 🏥 Healthcare Provider {% else %} 👪 Family Member {% endif %}
Invitation Type: {{ invitation.get_role_display }}
Sent: {{ invitation.created_at|date:"M d, Y @ g:i A" }} ({{ invitation.created_at|timesince }} ago)
Status: {{ invitation.get_status_display }}
{% csrf_token %}
{% csrf_token %}
{% endfor %} {% else %}
📬

No pending invitations

When someone sends you an invitation, it will appear here

{% endif %}
{% if sent_invitations %} {% for invitation in sent_invitations %}
{% if invitation.receiver.profile.user_type == 'patient' %} 🧑‍⚕️ {% elif invitation.receiver.profile.user_type == 'doctor' %} 👨‍⚕️ {% else %} 👪 {% endif %}

{{ invitation.receiver.get_full_name|default:invitation.receiver.username }}

@{{ invitation.receiver.username }}

{% if invitation.role == 'provider' %} 🏥 Healthcare Provider {% else %} 👪 Family Member {% endif %}
Connection As: {{ invitation.get_role_display }}
Sent: {{ invitation.created_at|date:"M d, Y @ g:i A" }} ({{ invitation.created_at|timesince }} ago)
Status: {{ invitation.get_status_display }}
{% csrf_token %}
{% endfor %} {% else %}
📮

No sent invitations

Send your first invitation →

{% endif %}
{% else %}
🔐

Please log in to view your invitations

Login Now →
{% endif %}
{% endblock %}