7062723433
Co-authored-by: Copilot <copilot@github.com>
28 lines
1.2 KiB
HTML
28 lines
1.2 KiB
HTML
{# HTMX partial: user search results for the sharing panel.
|
||
Context:
|
||
users – list of User objects matching the query
|
||
cid_user_exam – CidUserExam instance
|
||
q – search query string
|
||
#}
|
||
{% if users %}
|
||
<ul class="list-group list-group-flush small border rounded">
|
||
{% for u in users %}
|
||
<li class="list-group-item list-group-item-action d-flex justify-content-between align-items-center py-1 px-2">
|
||
<span>
|
||
{{ u.get_full_name|default:u.username }}
|
||
{% if u.email %}<span class="text-muted"><{{ u.email }}></span>{% endif %}
|
||
</span>
|
||
<button class="btn btn-sm btn-outline-primary py-0 px-2"
|
||
hx-post="{% url 'atlas:collection_exam_sharing_panel' cid_user_exam.pk %}"
|
||
hx-vals='{"action": "add_user", "user_id": "{{ u.pk }}"}'
|
||
hx-target="#sharing-panel-{{ cid_user_exam.pk }}"
|
||
hx-swap="outerHTML">
|
||
Add
|
||
</button>
|
||
</li>
|
||
{% endfor %}
|
||
</ul>
|
||
{% elif q|length >= 2 %}
|
||
<div class="small text-muted fst-italic">No matching users found.</div>
|
||
{% endif %}
|