From 7334e4b62264bbb8e57e29240f6ca686abf37552 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 15 Nov 2020 13:29:49 +1100 Subject: [PATCH] bit of pox code, to go through sub fields like author/publisher, and build readonly links to their edit pages, works. Need to add to books.html - which also only prints the first item - like author anyway --- templates/book.html | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/templates/book.html b/templates/book.html index 924ab1f..a29b6ef 100644 --- a/templates/book.html +++ b/templates/book.html @@ -10,17 +10,26 @@
{% if books[key] is iterable and books[key] is not string %} - + {% set cnt = namespace(idx=0, val=0) %} {% for objects in books[key] %} - + {% set cnt.val = 0 %} + {% set str = namespace(val="") %} + {% for attr in objects %} {% if attr != "id" %} - + {% if cnt.val > 0 %} + {% set str.val=str.val+", "+objects[attr] %} + {% else %} + {% set str.val=str.val+objects[attr] %} + {% endif %} + {% set cnt.val = cnt.val + 1 %} {% endif %} {% endfor %} - + {% if key != "genre" %} + {{str.val}} + {% endif %} + + {% set cnt.idx = cnt.idx+1 %} {% endfor %}
- -
{% else %}