From f9a8eceba83233ac5ab80ae39f4a0841cb32611b Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 16 Nov 2020 00:14:42 +0100 Subject: [PATCH] artwork img placeholder + link to org publisersindex + whatever I cannot remmber --- daapinterface.py | 2 +- templates/artwork.html | 34 ++++++++++++++++++++-------------- templates/publishersindex.html | 4 ++-- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/daapinterface.py b/daapinterface.py index 8b3329e..1bf75d1 100644 --- a/daapinterface.py +++ b/daapinterface.py @@ -235,7 +235,7 @@ def artwork(): ''') sparql.setReturnFormat(JSON) artworkimages = sparql.query().convert() - # print(artworkimages) + print(artworkimages) ######### Right top # contributors diff --git a/templates/artwork.html b/templates/artwork.html index ae132b9..12143ea 100644 --- a/templates/artwork.html +++ b/templates/artwork.html @@ -39,17 +39,20 @@
+
- {% for x in artworkimages['results']['bindings'] %} - {% if loop.index <= 1 %} - {% if "image" in x %} - - {% else %} - - {% endif %} + {% if artworkimages['results']['bindings']==[] %} + + {% else %} + {% for x in artworkimages['results']['bindings'] %} + {% if loop.index <= 1 %} + {% if "image" in x %} + + {% endif %} + {% endif %} + {% endfor %} {% endif %} - {% endfor %}
@@ -122,15 +125,18 @@ DESCRIPTION {{ artworkdescriptiontext }} - -
- AUTHOR + + + + + - SOURCE + - DATE + -
+ +
diff --git a/templates/publishersindex.html b/templates/publishersindex.html index 3aee8db..16c5fed 100644 --- a/templates/publishersindex.html +++ b/templates/publishersindex.html @@ -15,8 +15,8 @@ {% for x in results['results']['bindings']%} - {{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }} - {{ x["publishersLabel"]['value'] }} + {{ x['publishers']['value'] | replace('http://daap.bannerrepeater.org/entity/', '') }} + {{ x["publishersLabel"]['value'] }} {% if "publishersAltLabel" in x %} {{ x["publishersAltLabel"]["value"] }}