2021-05-01 01:35:09 +00:00
|
|
|
{% extends 'search/layout.html' %}
|
2021-05-01 02:56:29 +00:00
|
|
|
{% load i18n %}
|
2022-11-25 18:06:51 +00:00
|
|
|
{% load humanize %}
|
|
|
|
{% load book_display_tags %}
|
2021-05-01 01:35:09 +00:00
|
|
|
|
|
|
|
{% block panel %}
|
|
|
|
|
2022-08-04 18:42:03 +00:00
|
|
|
{% if results or remote_results %}
|
2021-05-01 02:56:29 +00:00
|
|
|
<ul class="block">
|
2022-08-04 18:42:03 +00:00
|
|
|
{% for result in results %}
|
2022-07-03 05:57:10 +00:00
|
|
|
<li class="pd-4 mb-5 local-book-search-result" id="tour-local-book-search-result">
|
2021-12-29 18:50:32 +00:00
|
|
|
<div class="columns is-mobile is-gapless mb-0">
|
2021-09-14 22:26:18 +00:00
|
|
|
<div class="column is-cover">
|
|
|
|
{% include 'snippets/book_cover.html' with book=result cover_class='is-w-xs is-h-xs' %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="column is-10 ml-3">
|
|
|
|
<p>
|
|
|
|
<strong>
|
|
|
|
{% include "snippets/book_titleby.html" with book=result %}
|
|
|
|
</strong>
|
|
|
|
</p>
|
|
|
|
<p>
|
2022-11-25 18:06:51 +00:00
|
|
|
{% with book_review_count=result|review_count %}
|
|
|
|
{% blocktrans trimmed count counter=book_review_count with formatted_review_count=book_review_count|intcomma %}
|
|
|
|
{{ formatted_review_count }} review
|
|
|
|
{% plural %}
|
|
|
|
{{ formatted_review_count }} reviews
|
|
|
|
{% endblocktrans %}
|
|
|
|
{% endwith %}
|
|
|
|
|
2021-09-14 22:26:18 +00:00
|
|
|
{% if result.first_published_date or result.published_date %}
|
2022-11-25 18:06:51 +00:00
|
|
|
{% firstof result.first_published_date.year result.published_date.year as pub_year %}
|
|
|
|
{% blocktrans %}(published {{ pub_year }}){% endblocktrans %}
|
2021-09-14 22:26:18 +00:00
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-01 02:56:29 +00:00
|
|
|
</li>
|
2021-05-01 01:35:09 +00:00
|
|
|
{% endfor %}
|
2021-05-01 02:56:29 +00:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="block">
|
2022-08-04 18:42:03 +00:00
|
|
|
{% for result_set in remote_results %}
|
2021-05-01 02:56:29 +00:00
|
|
|
{% if result_set.results %}
|
2021-12-29 18:50:32 +00:00
|
|
|
<section class="mb-5">
|
2022-05-30 19:35:17 +00:00
|
|
|
<details class="details-panel box" open>
|
2022-07-03 05:57:10 +00:00
|
|
|
<summary class="is-flex is-align-items-center is-flex-wrap-wrap is-gap-2 remote-book-search-result" id="tour-remote-search-result">
|
2022-01-01 17:48:53 +00:00
|
|
|
<span class="mb-0 title is-5">
|
2021-12-01 09:07:52 +00:00
|
|
|
{% trans 'Results from' %}
|
2022-08-05 17:20:43 +00:00
|
|
|
<a
|
|
|
|
href="{{ result_set.connector.base_url }}"
|
|
|
|
target="_blank"
|
|
|
|
rel="nofollow noopener noreferrer"
|
|
|
|
>{{ result_set.connector.name|default:result_set.connector.identifier }}</a>
|
2022-01-01 17:48:53 +00:00
|
|
|
</span>
|
2021-12-29 18:50:32 +00:00
|
|
|
|
2022-02-12 15:18:56 +00:00
|
|
|
<span class="details-close icon icon-x" aria-hidden="true"></span>
|
2021-12-29 18:50:32 +00:00
|
|
|
</summary>
|
2021-05-01 02:56:29 +00:00
|
|
|
|
2022-11-26 22:46:35 +00:00
|
|
|
<div>
|
2021-05-01 03:16:34 +00:00
|
|
|
<div class="is-flex is-flex-direction-row-reverse">
|
|
|
|
<ul class="is-flex-grow-1">
|
|
|
|
{% for result in result_set.results %}
|
2021-12-29 18:50:32 +00:00
|
|
|
<li class="{% if not forloop.last %}mb-5{% endif %}">
|
2021-09-16 17:44:33 +00:00
|
|
|
<div class="columns is-mobile is-gapless">
|
2021-12-29 18:50:32 +00:00
|
|
|
<div class="column is-1 is-cover">
|
2021-09-16 17:44:33 +00:00
|
|
|
{% include 'snippets/book_cover.html' with book=result cover_class='is-w-xs is-h-xs' external_path=True %}
|
|
|
|
</div>
|
|
|
|
<div class="column is-10 ml-3">
|
|
|
|
<p>
|
|
|
|
<strong>
|
|
|
|
<a
|
|
|
|
href="{{ result.view_link|default:result.key }}"
|
2022-08-05 17:20:43 +00:00
|
|
|
rel="nofollow noopener noreferrer"
|
2021-09-16 17:44:33 +00:00
|
|
|
target="_blank"
|
|
|
|
>{{ result.title }}</a>
|
|
|
|
</strong>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{{ result.author }}
|
|
|
|
{% if result.year %}({{ result.year }}){% endif %}
|
|
|
|
</p>
|
|
|
|
<form class="mt-1" action="/resolve-book" method="post">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="remote_id" value="{{ result.key }}">
|
2022-01-11 17:12:04 +00:00
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-small is-link">
|
|
|
|
{% trans "Import book" %}
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-09-16 17:44:33 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-01 03:16:34 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-12-29 19:16:53 +00:00
|
|
|
</div>
|
2021-12-29 18:50:32 +00:00
|
|
|
</details>
|
2021-05-01 02:56:29 +00:00
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2022-08-04 18:42:03 +00:00
|
|
|
{% endblock %}
|
2021-05-01 02:56:29 +00:00
|
|
|
|
2022-08-04 18:42:03 +00:00
|
|
|
{% block search_footer %}
|
2021-05-01 02:56:29 +00:00
|
|
|
<p class="block">
|
|
|
|
{% if request.user.is_authenticated %}
|
2021-05-03 18:20:43 +00:00
|
|
|
{% if not remote %}
|
2024-03-21 15:48:28 +00:00
|
|
|
<a href="{{ request.path }}?q={{ query|urlencode }}&type=book&remote=true" id="tour-load-from-other-catalogues">
|
2021-05-03 18:20:43 +00:00
|
|
|
{% trans "Load results from other catalogues" %}
|
|
|
|
</a>
|
|
|
|
{% else %}
|
2022-07-03 05:57:10 +00:00
|
|
|
<a href="{% url 'create-book' %}" id="tour-manually-add-book">
|
2021-05-03 18:20:43 +00:00
|
|
|
{% trans "Manually add book" %}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2021-05-01 02:56:29 +00:00
|
|
|
{% else %}
|
2021-05-03 18:20:43 +00:00
|
|
|
<a href="{% url 'login' %}">
|
|
|
|
{% trans "Log in to import or add books." %}
|
|
|
|
</a>
|
2021-05-01 02:56:29 +00:00
|
|
|
{% endif %}
|
|
|
|
</p>
|
2021-05-01 01:35:09 +00:00
|
|
|
|
|
|
|
{% endblock %}
|