mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 02:31:42 +00:00
previsualizar archivos
This commit is contained in:
parent
3534762f65
commit
00f93e035a
1 changed files with 12 additions and 1 deletions
|
@ -2,5 +2,16 @@
|
|||
%th= post_label_t(attribute, :path, post: post)
|
||||
%td
|
||||
- if metadata.value['path'].present?
|
||||
= link_to t('.download'), url_for(metadata.static_file)
|
||||
- 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('.download'),
|
||||
url_for(metadata.static_file)
|
||||
%p{ dir: dir, lang: locale }= metadata.value['description']
|
||||
|
|
Loading…
Reference in a new issue