cleanup, and dont need to calculate 12/cols, just use col

This commit is contained in:
2020-11-21 12:52:30 +11:00
parent bcf5937869
commit 0b712ef7f3

View File

@@ -37,7 +37,7 @@
<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 %}
<div class="row" style="margin-left:0px; margin-right:0px;">
<div class="form-row" style="margin-left:0px; margin-right:0px;">
{% set cnt = namespace(idx=0, val=0) %}
{% for objects in books[key] %}
{% set cnt.val = 0 %}
@@ -52,7 +52,7 @@
{% set cnt.val = cnt.val + 1 %}
{% endif %}
{% endfor %}
<span class="form-control col-lg-{{((12/books[key]|length)|int)}}" id="{{key}}-{{books[key][cnt.idx].id}}">
<span class="form-control col" id="{{key}}[{{cnt.idx}}]">
<a href="{{url_for(key, id=books[key][cnt.idx].id)}}">{{str.val}}</a>
</span>
{% set cnt.idx = cnt.idx+1 %}