5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-29 08:36:08 +00:00

previsualizar archivos subidos

This commit is contained in:
f 2020-05-26 16:39:10 -03:00
parent 96ddc47b77
commit 03143096ed

View file

@ -2,6 +2,19 @@
- if metadata.uploaded?
= hidden_field_tag "post[#{attribute}][path]", metadata.value['path']
- case metadata.static_file.blob.content_type
- when %r{\Avideo/}
= video_tag url_for(metadata.static_file),
controls: true, class: 'img-fluid'
- when %r{\Aaudio/}
= audio_tag url_for(metadata.static_file),
controls: true, class: 'img-fluid'
- when 'application/pdf'
%iframe{ src: url_for(metadata.static_file) }
- else
= link_to t('posts.attribute_ro.file.download'),
url_for(metadata.static_file)
.custom-file
= file_field(*field_name_for('post', attribute, :path),
**field_options(attribute, metadata),