2020-06-07 13:13:14 +02:00
|
|
|
[%- for column in columns %]
|
2020-06-07 15:45:42 +02:00
|
|
|
{% if "[[ column.name ]]" not in skip_list %}
|
2021-05-08 12:24:13 +02:00
|
|
|
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>{{ _("[[ column.name ]]") }}</strong>:
|
|
|
|
[%- if column.type in ['picture', 'image', 'img'] %]
|
|
|
|
<img src="{{ url_for('oshipka_bp.get_media', filepath=instance.[[ column.name ]]) }}" id="display-[[ name|camel_to_snake ]]-[[ column.name ]]" />
|
|
|
|
[%- elif column.type in ['video'] %]
|
2020-06-07 15:45:42 +02:00
|
|
|
<video src="{{ url_for('oshipka_bp.get_media', filepath=instance.[[ column.name ]]) }}" controls class="video-inline" id="display-[[ name|camel_to_snake ]]-[[ column.name ]]">
|
|
|
|
<source src="{{ url_for('oshipka_bp.get_media', filepath=instance.[[ column.name ]]) }}" type="video/mp4">
|
|
|
|
<source src="{{ url_for('oshipka_bp.get_media', filepath=instance.[[ column.name ]]) }}" type="video/webm">
|
|
|
|
</video>
|
2021-05-01 16:21:39 +02:00
|
|
|
[%- elif column.type in ['audio'] %]
|
|
|
|
<audio src="{{ url_for('oshipka_bp.get_media', filepath=instance.[[ column.name ]]) }}" controls id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"></audio>
|
2020-06-07 15:45:42 +02:00
|
|
|
[%- elif column.type in ['relationship'] %]
|
2020-06-08 12:19:28 +02:00
|
|
|
[%- if column.multiple %]
|
2021-05-08 12:24:13 +02:00
|
|
|
{{ instance.[[ column.name|pluralize ]] }}
|
2020-06-08 12:19:28 +02:00
|
|
|
[%- else %]
|
2021-05-08 12:24:13 +02:00
|
|
|
{{ instance.[[ column.name ]] }}
|
2020-06-08 12:19:28 +02:00
|
|
|
[%- endif %]
|
2020-06-08 16:32:39 +02:00
|
|
|
[%- elif column.type in ['bool', 'boolean', ] %]
|
2021-05-08 12:24:13 +02:00
|
|
|
{{ instance.[[ column.name ]]|bool }}
|
2020-06-07 13:13:14 +02:00
|
|
|
[%- else %]
|
2021-05-08 12:24:13 +02:00
|
|
|
{{ instance.[[ column.name ]] }}
|
2020-06-07 13:13:14 +02:00
|
|
|
[%- endif %]
|
2021-05-08 12:24:13 +02:00
|
|
|
</li>
|
2020-06-07 15:45:42 +02:00
|
|
|
{% endif %}
|
2020-06-07 13:13:14 +02:00
|
|
|
[%- endfor %]
|