oshipka/vm_gen/templates/html/_get.html
Daniel Tsvetkov b680ca8bbd files impl
2021-05-08 12:24:13 +02:00

26 lines
1.4 KiB
HTML

[%- for column in columns %]
{% if "[[ column.name ]]" not in skip_list %}
<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'] %]
<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 ['audio'] %]
<audio src="{{ url_for('oshipka_bp.get_media', filepath=instance.[[ column.name ]]) }}" controls id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"></audio>
[%- elif column.type in ['relationship'] %]
[%- if column.multiple %]
{{ instance.[[ column.name|pluralize ]] }}
[%- else %]
{{ instance.[[ column.name ]] }}
[%- endif %]
[%- elif column.type in ['bool', 'boolean', ] %]
{{ instance.[[ column.name ]]|bool }}
[%- else %]
{{ instance.[[ column.name ]] }}
[%- endif %]
</li>
{% endif %}
[%- endfor %]