Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 48 additions & 31 deletions search/templates/search/course_list.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
<div class="pr-2" style="overflow-x: scroll">
{% if simplified %}
<li class="disabled dropdown-item text-danger">
Ce résultat de recherche est simplifié parce que PostgreSQL
n'est pas disponible.
</li>
{% endif %}
{% for course in course_list %}
<li class="dropdown-item">
<a title="{{ course.name }}"
href="{% url 'catalog:course_show' course.slug %}"
class="text-reset text-decoration-none d-inline-block w-100 d-flex align-items-center gap-2"
>
{% if simplified %}
<li class="px-2 pb-2">
<div class="alert alert-danger mb-0 py-2 px-3 small rounded-3 d-flex align-items-start gap-2 border-0 bg-danger bg-opacity-10 text-danger">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-triangle-fill flex-shrink-0 mt-1" viewBox="0 0 16 16">
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</svg>
<span>Recherche simplifiée : PostgreSQL n'est pas disponible.</span>
</div>
</li>
{% endif %}

{% for course in course_list %}
<li>
<a title="{{ course.name }}"
href="{% url 'catalog:course_show' course.slug %}"
class="dropdown-item d-flex align-items-center gap-3 py-2 px-3 rounded-3 mb-1 transition-all {% if course.is_archive %}opacity-75{% endif %}"
style="white-space: normal;"
>
<div class="flex-shrink-0 d-flex align-items-center justify-content-center text-muted pe-1">
{% if course.is_archive %}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-archive" viewBox="0 0 16 16">
<path
d="M0 2a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1v7.5a2.5 2.5 0 0 1-2.5 2.5h-9A2.5 2.5 0 0 1 1 12.5V5a1 1 0 0 1-1-1V2zm2 3v7.5A1.5 1.5 0 0 0 3.5 14h9a1.5 1.5 0 0 0 1.5-1.5V5H2zm13-3H1v2h14V2zM5 7.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"/>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-archive" viewBox="0 0 16 16">
<path d="M0 2a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1v7.5a2.5 2.5 0 0 1-2.5 2.5h-9A2.5 2.5 0 0 1 1 12.5V5a1 1 0 0 1-1-1V2zm2 3v7.5A1.5 1.5 0 0 0 3.5 14h9a1.5 1.5 0 0 0 1.5-1.5V5H2zm13-3H1v2h14V2zM5 7.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"/>
</svg>
{% else %}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-folder" viewBox="0 0 16 16">
<path
d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z"/>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-book" viewBox="0 0 16 16">
<path d="M1 2.828c.885-.37 2.154-.769 3.388-.893 1.33-.134 2.458.063 3.112.752v9.746c-.935-.53-2.12-.603-3.213-.493-1.18.12-2.37.461-3.287.811V2.828zm7.5-.141c.654-.689 1.782-.886 3.112-.752 1.234.124 2.503.523 3.388.893v9.923c-.918-.35-2.107-.692-3.287-.81-1.094-.111-2.278-.039-3.213.492V2.687zM8 1.783C7.015.936 5.587.815 4.287.94c-1.514.153-3.042.672-3.994 1.105A.5.5 0 0 0 0 2.5v11a.5.5 0 0 0 .707.455c.882-.4 2.303-.881 3.68-1.02 1.409-.142 2.59.087 3.223.877a.5.5 0 0 0 .78 0c.633-.79 1.814-1.019 3.222-.877 1.378.139 2.8.62 3.681 1.02A.5.5 0 0 0 16 13.5v-11a.5.5 0 0 0-.293-.455c-.952-.433-2.48-.952-3.994-1.105C10.413.815 8.985.936 8 1.783z"/>
</svg>
{% endif %}
<span class="text-muted">{{ course.slug|upper }}</span>
<span class="hover-underline">{{ course.name }}</span>
</a>
</li>
{% empty %}
<li class="disabled dropdown-item">
Aucun résultat
</li>
</div>

{% endfor %}
</div>
<div class="d-flex flex-column overflow-hidden flex-grow-1">
<span class="fw-bold text-dark lh-sm" style="font-size: 0.9rem;">
{{ course.slug|upper }}
{% if course.is_archive %}
<span class="text-muted fw-normal fst-italic ms-1" style="font-size: 0.75rem;">(Archivé)</span>
{% endif %}
</span>
<span class="text-muted text-truncate w-100" style="font-size: 0.8rem;">
{{ course.name }}
</span>
</div>
</a>
</li>
{% empty %}
<li>
<div class="text-center py-4 px-3 text-muted">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-search mb-2 opacity-50" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
<div class="fw-medium">Aucun cours trouvé</div>
<small>Essaie avec d'autres mots-clés.</small>
</div>
</li>
{% endfor %}
Loading