{% load django_htmx %} {% comment %} Sharing panel for a CidUserExam attempt. Context: cid_user_exam – CidUserExam instance sharing_info – dict from cid_user_exam.get_sharing_info() is_owner – bool: current user is the attempt owner {% endcomment %}
Result Sharing Supervision
{# Always-visible users #}
Always shared with (authors & markers)
{% if sharing_info.always_visible_to %}
    {% for u in sharing_info.always_visible_to %}
  • Author/Marker {{ u.get_full_name|default:u.username }} {% if u.email %}<{{ u.email }}>{% endif %}
  • {% endfor %}
{% else %} No authors or markers assigned. {% endif %}
{# Supervisor sharing #} {% if not sharing_info.exam_supervisor_visible %}
Share with supervisor
{% if is_owner %} {% else %} {% endif %} {% if sharing_info.supervisor %}
Supervisor: {{ sharing_info.supervisor.get_full_name|default:sharing_info.supervisor.username }} {% if sharing_info.supervisor.email %}<{{ sharing_info.supervisor.email }}>{% endif %}
{% elif sharing_info.supervisor_enabled %}
No supervisor account linked to your profile — results cannot be shared automatically.
{% endif %}
{% else %}
Supervisor
Sharing always enabled (exam setting) {% if sharing_info.supervisor %}
Supervisor: {{ sharing_info.supervisor.get_full_name|default:sharing_info.supervisor.username }} {% if sharing_info.supervisor.email %}<{{ sharing_info.supervisor.email }}>{% endif %}
{% endif %}
{% endif %} {# Manual shares — only for registered-user attempts #} {% if cid_user_exam.user_user_id %}
Also shared with
{% if sharing_info.manual_shares %}
    {% for u in sharing_info.manual_shares %}
  • {{ u.get_full_name|default:u.username }} {% if u.email %}<{{ u.email }}>{% endif %} {% if is_owner %} {% endif %}
  • {% endfor %}
{% else %}
No additional users.
{% endif %} {% if is_owner %} {# User search input #}
{% endif %}
{% endif %}