Support for multiple source.URL.
authorRadek Czajka <rczajka@rczajka.pl>
Mon, 30 Dec 2019 23:39:19 +0000 (00:39 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Mon, 30 Dec 2019 23:40:14 +0000 (00:40 +0100)
requirements/requirements.txt
src/catalogue/templates/catalogue/book_detail.html

index fbf7a4b..85d6bd3 100644 (file)
@@ -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
index 4b654dd..d2bfda7 100644 (file)
   {% endfor %}
 
 
-{% with extra_info=book.get_extra_info_json %}
-  {% if extra_info.source_url %}
-    <div class="white-box">
-      <a href="{{ extra_info.source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
-      {% trans "in" %} {% source_name extra_info.source_url %}
-    </div>
-  {% endif %}
+  {% with extra_info=book.get_extra_info_json %}
+    {% for source_url in extra_info.source_urls %}
+      <div class="white-box">
+        <a href="{{ source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
+        {% trans "in" %} {% source_name source_url %}
+      </div>
+    {% empty %}
+      {% if extra_info.source_url %}
+        <div class="white-box">
+          <a href="{{ extra_info.source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
+          {% trans "in" %} {% source_name extra_info.source_url %}
+        </div>
+      {% endif %}
+    {% endfor %}
   {% if book|status:user != 'closed' %}
     <div class="white-box"><a href="{{ book.xml_url }}">{% trans "Source XML file" %}</a></div>
   {% endif %}