oshipka/vm_gen/templates/html/_get.html
2020-06-08 16:32:39 +02:00

20 lines
1.3 KiB
HTML

[%- for column in columns %]
{% if "[[ column.name ]]" not in skip_list %}
[%- if column.type in ['video'] %]
<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>
[%- elif column.type in ['relationship'] %]
[%- if column.multiple %]
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>[[ column.name|pluralize ]]</strong>: {{ instance.[[ column.name|pluralize ]] }}</li>
[%- else %]
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>[[ column.name ]]</strong>: {{ instance.[[ column.name ]] }}</li>
[%- endif %]
[%- elif column.type in ['bool', 'boolean', ] %]
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>[[ column.name ]]</strong>: {{ instance.[[ column.name ]]|bool }}</li>
[%- else %]
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>[[ column.name ]]</strong>: {{ instance.[[ column.name ]] }}</li>
[%- endif %]
{% endif %}
[%- endfor %]