diff --git a/crudkit/html/templates/crudkit/_macros.html b/crudkit/html/templates/crudkit/_macros.html index 1bcdfd4..4dbf0fc 100644 --- a/crudkit/html/templates/crudkit/_macros.html +++ b/crudkit/html/templates/crudkit/_macros.html @@ -1,4 +1,5 @@ {% macro options(items, value_attr="id", label_path="name", getp=None) -%} + {%- for obj in items -%} {%- endfor -%} @@ -19,9 +20,9 @@ {% macro rows(items, fields, getp=None) -%} {%- for obj in items -%} - + {%- for f in fields -%} - {{ getp(obj, f) }} + {{ getp(obj, f) if getp(obj, f) is not none else '-' }} {%- endfor -%} {%- else -%} @@ -32,14 +33,54 @@ {%- endmacro %} {% macro pager(model, page, pages, per_page, sort, filters, fields_csv) -%} -