From 5e8e1de576bdd40292dc632c82cdbe272eee84af Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 31 Dec 2019 00:39:19 +0100 Subject: [PATCH] Support for multiple source.URL. --- requirements/requirements.txt | 2 +- .../templates/catalogue/book_detail.html | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index fbf7a4bd7..85d6bd38b 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -50,7 +50,7 @@ mutagen>=1.31 sorl-thumbnail==12.5.0 # home-brewed & dependencies -librarian==1.7.5 +librarian==1.7.7 # celery tasks celery[redis]==4.3.0 diff --git a/src/catalogue/templates/catalogue/book_detail.html b/src/catalogue/templates/catalogue/book_detail.html index 4b654dd1d..d2bfda7e4 100644 --- a/src/catalogue/templates/catalogue/book_detail.html +++ b/src/catalogue/templates/catalogue/book_detail.html @@ -56,13 +56,20 @@ {% endfor %} -{% with extra_info=book.get_extra_info_json %} - {% if extra_info.source_url %} -
- {% trans "Source" %} {% trans "of the book" %} - {% trans "in" %} {% source_name extra_info.source_url %} -
- {% endif %} + {% with extra_info=book.get_extra_info_json %} + {% for source_url in extra_info.source_urls %} +
+ {% trans "Source" %} {% trans "of the book" %} + {% trans "in" %} {% source_name source_url %} +
+ {% empty %} + {% if extra_info.source_url %} +
+ {% trans "Source" %} {% trans "of the book" %} + {% trans "in" %} {% source_name extra_info.source_url %} +
+ {% endif %} + {% endfor %} {% if book|status:user != 'closed' %}
{% trans "Source XML file" %}
{% endif %} -- 2.20.1