2022-08-16 18:13:00 +02:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block content %}
|
2023-06-24 16:05:26 +02:00
|
|
|
<h2>{% block title %}Résultats de la recherche "{{ query }}"{% endblock %}</h2>
|
2022-08-16 18:13:00 +02:00
|
|
|
{% if partitions|length != 0 %}
|
2023-06-22 16:22:11 +02:00
|
|
|
<h3>Résultats dans la bibliothèque locale</h3>
|
2022-08-16 18:13:00 +02:00
|
|
|
<div id="partitions-grid">
|
|
|
|
{% for partition in partitions %}
|
2022-08-17 23:52:58 +02:00
|
|
|
<div class="partition-container">
|
|
|
|
<a href="/partition/{{ partition['uuid'] }}">
|
|
|
|
<div class="partition" id="partition-{{ partition['uuid'] }}">
|
|
|
|
<img class="partition-thumbnail" src="/static/thumbnails/{{ partition['uuid'] }}.jpg">
|
|
|
|
<div class="partition-description">
|
|
|
|
<div class="partition-name">{{ partition["name"] }}</div>
|
|
|
|
<div class="partition-author">{{ partition["author"] }}</div>
|
|
|
|
</div>
|
2022-08-16 18:13:00 +02:00
|
|
|
</div>
|
2022-08-17 23:52:58 +02:00
|
|
|
</a>
|
2023-06-22 16:22:11 +02:00
|
|
|
<form action="/albums/add-partition" class="add-partition-form" method="post">
|
2022-08-17 23:52:58 +02:00
|
|
|
<select name="album-uuid">
|
2023-06-22 16:06:48 +02:00
|
|
|
{% for album in user.albums %}
|
2022-08-17 23:52:58 +02:00
|
|
|
<option value="{{ album['uuid'] }}">{{ album["name"] }}</option>
|
|
|
|
{% endfor %}
|
2023-10-11 17:15:49 +02:00
|
|
|
{% for groupe in user.get_groupes() %}
|
|
|
|
{% for album in groupe.get_albums() %}
|
|
|
|
<option value="{{ album['uuid'] }}">{{ groupe.name }}/{{ album["name"] }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
2022-08-17 23:52:58 +02:00
|
|
|
</select>
|
|
|
|
<input type="hidden" value="{{ partition['uuid'] }}" name="partition-uuid">
|
|
|
|
<input type="hidden" value="local_file" name="partition-type">
|
|
|
|
<input type="submit" value="Ajouter à l'album" class="add-to-album">
|
|
|
|
</form>
|
|
|
|
</div>
|
2022-08-16 18:13:00 +02:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2022-08-17 09:44:31 +02:00
|
|
|
{% endif %}
|
|
|
|
{% if google_results|length != 0 %}
|
2023-06-22 16:22:11 +02:00
|
|
|
<h3>Résultats de la recherche en ligne</h3>
|
2022-08-17 09:44:31 +02:00
|
|
|
<div id="partitions-grid">
|
|
|
|
{% for partition in google_results %}
|
2022-08-17 23:52:58 +02:00
|
|
|
<div class="partition-container">
|
|
|
|
<a href="/partition/search/{{ partition['uuid'] }}">
|
|
|
|
<div class="partition" id="partition-{{ partition['uuid'] }}">
|
|
|
|
<img class="partition-thumbnail" src="/static/search-thumbnails/{{ partition['uuid'] }}.jpg">
|
|
|
|
<div class="partition-description">
|
|
|
|
<div class="partition-name">{{ partition["name"] }}</div>
|
|
|
|
</div>
|
2022-08-17 09:44:31 +02:00
|
|
|
</div>
|
2022-08-17 23:52:58 +02:00
|
|
|
</a>
|
2023-06-22 16:06:48 +02:00
|
|
|
<form action="/albums/add-partition" class="add-partition-form" method="post">
|
2022-08-17 23:52:58 +02:00
|
|
|
<select name="album-uuid">
|
2023-06-22 16:06:48 +02:00
|
|
|
{% for album in user.albums %}
|
2022-08-17 23:52:58 +02:00
|
|
|
<option value="{{ album['uuid'] }}">{{ album["name"] }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
<input type="hidden" value="{{ partition['uuid'] }}" name="partition-uuid">
|
|
|
|
<input type="hidden" value="online_search" name="partition-type">
|
|
|
|
<input type="submit" value="Ajouter à l'album">
|
|
|
|
</form>
|
|
|
|
</div>
|
2022-08-17 09:44:31 +02:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2022-08-16 18:13:00 +02:00
|
|
|
{% endif %}
|
2023-06-24 16:05:26 +02:00
|
|
|
{% if google_results|length == 0 and partitions|length == 0 %}
|
|
|
|
Aucun résultat. Essayez d'augmenter le nombre de recherches en ligne ou d'affiner votre recherche.
|
|
|
|
{% endif %}
|
2022-08-16 18:13:00 +02:00
|
|
|
{% endblock %}
|