Files
penracourses/atlas/templates/atlas/partials/_sharing_user_search_results.html
T
2026-06-08 09:58:00 +01:00

30 lines
1.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% comment 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">&lt;{{ u.email }}&gt;</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>
{% else %}
<div class="small text-muted fst-italic">Please enter at least 2 characters to search.</div>
{% endif %}