partitioncloud-server/partitioncloud/templates/albums/search.html
2023-06-22 16:22:11 +02:00

61 lines
2.3 KiB
HTML

{% extends 'base.html' %}
{% block title %}Résultats de la recherche "{{ query }}"{% endblock %}
{% block content %}
{% if partitions|length != 0 %}
<h3>Résultats dans la bibliothèque locale</h3>
<div id="partitions-grid">
{% for partition in partitions %}
<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>
</div>
</a>
<form action="/albums/add-partition" class="add-partition-form" method="post">
<select name="album-uuid">
{% for album in user.albums %}
<option value="{{ album['uuid'] }}">{{ album["name"] }}</option>
{% endfor %}
</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>
{% endfor %}
</div>
{% endif %}
{% if google_results|length != 0 %}
<h3>Résultats de la recherche en ligne</h3>
<div id="partitions-grid">
{% for partition in google_results %}
<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>
</div>
</a>
<form action="/albums/add-partition" class="add-partition-form" method="post">
<select name="album-uuid">
{% for album in user.albums %}
<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>
{% endfor %}
</div>
{% endif %}
{% endblock %}