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

This commit is contained in:
2020-11-15 13:29:49 +11:00
parent c675786852
commit 7334e4b622

View File

@@ -10,17 +10,26 @@
<label for="{{key}}" class="col-lg-2 col-form-label">{{key}}:</label>
<div class="col-lg-10">
{% if books[key] is iterable and books[key] is not string %}
<table>
{% set cnt = namespace(idx=0, val=0) %}
{% for objects in books[key] %}
<tr>
{% set cnt.val = 0 %}
{% set str = namespace(val="") %}
<span class="form-control-plaintext" id="{{key}}">
{% for attr in objects %}
{% if attr != "id" %}
<td>
<input type="text" class="form-control input-lg" id="not-sure-{{key}}-{{attr}}" value="{{objects[attr]}}">
</td>
{% 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 %}
</tr>
{% if key != "genre" %}
<a href="{{url_for(key, id=books[key][cnt.idx].id)}}">{{str.val}}</a>
{% endif %}
</span>
{% set cnt.idx = cnt.idx+1 %}
{% endfor %}
</table>
{% else %}