From 3e50a06306c054ab1285442aa83e9f68590ec618 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 19 Feb 2019 07:03:48 +0100 Subject: [PATCH] Improved content type detection for image preview of attachments. --- .../app/views/ticket_zoom/article_view.jst.eco | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco index aaa00e171..ba3dc053d 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco @@ -62,13 +62,14 @@
<%- @humanFileSize(attachment.size) %>
<% else: %> - download<% end %>> + <% content_type = attachment.preferences['Content-Type'] || attachment.preferences['content_type'] %> + download<% end %>>
- <% if attachment.preferences && attachment.preferences['Content-Type'] && @ContentTypeIcon(attachment.preferences['Content-Type']): %> - <% if @canPreview(attachment.preferences['Content-Type']): %> + <% if attachment.preferences && content_type && @ContentTypeIcon(content_type): %> + <% if @canPreview(content_type): %> <% else: %> - <%- @Icon( @ContentTypeIcon(attachment.preferences['Content-Type']) ) %> + <%- @Icon( @ContentTypeIcon(content_type) ) %> <% end %> <% else: %> <%- @Icon('file-unknown') %>