From f4ce0ddde44c278af9c7a9f198c9893d7db7472d Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 4 Feb 2015 15:35:10 +0100 Subject: Show image attachments in browser instead of downloading them. Resolves #1702. --- app/controllers/files_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 7937454810d..9671245d3f4 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -5,7 +5,8 @@ class FilesController < ApplicationController if uploader.file_storage? if can?(current_user, :read_project, note.project) - send_file uploader.file.path, disposition: 'attachment' + disposition = uploader.image? ? 'inline' : 'attachment' + send_file uploader.file.path, disposition: disposition else not_found! end -- cgit v1.2.1 From 8efed8b356606f688c05a1ce423e9001c4aa73b3 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 5 Feb 2015 16:02:06 +0100 Subject: Update changelog. --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b27291b6f19..e096fb579be 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,7 +9,7 @@ v 7.8.0 - Cleaner UI for web editor - Add diff syntax highlighting in email-on-push service notifications (Hannes Rosenögger) - - - + - View note image attachments in new tab when clicked instead of downloading them - - Allow more variations for commit messages closing issues (Julien Bianchi and Hannes Rosenögger) - -- cgit v1.2.1