oshipka/vm_gen/templates/html/_get.html

22 lines
1.5 KiB
HTML
Raw Normal View History

2020-06-07 13:13:14 +02:00
[%- 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>
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>
[%- elif column.type in ['relationship'] %]
[%- if column.multiple %]
2020-07-08 14:38:55 +02:00
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>{{ _("[[ column.name|pluralize ]]") }}</strong>: {{ instance.[[ column.name|pluralize ]] }}</li>
[%- else %]
2020-07-08 14:38:55 +02:00
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>{{_("[[ column.name ]]") }}</strong>: {{ instance.[[ column.name ]] }}</li>
[%- endif %]
2020-06-08 16:32:39 +02:00
[%- elif column.type in ['bool', 'boolean', ] %]
2020-07-08 14:38:55 +02:00
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>{{ _("[[ column.name ]]") }}</strong>: {{ instance.[[ column.name ]]|bool }}</li>
2020-06-07 13:13:14 +02:00
[%- else %]
2020-07-08 14:38:55 +02:00
<li id="display-[[ name|camel_to_snake ]]-[[ column.name ]]"><strong>{{ _("[[ column.name ]]") }}</strong>: {{ instance.[[ column.name ]] }}</li>
2020-06-07 13:13:14 +02:00
[%- endif %]
{% endif %}
2020-06-07 13:13:14 +02:00
[%- endfor %]