mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 13:55:52 +01:00
Preview files by default instead of downloading them (#25988).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@16665 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -198,7 +198,7 @@ module ApplicationHelper
|
|||||||
when 'Issue'
|
when 'Issue'
|
||||||
object.visible? && html ? link_to_issue(object) : "##{object.id}"
|
object.visible? && html ? link_to_issue(object) : "##{object.id}"
|
||||||
when 'Attachment'
|
when 'Attachment'
|
||||||
html ? link_to_attachment(object, :download => true) : object.filename
|
html ? link_to_attachment(object) : object.filename
|
||||||
when 'CustomValue', 'CustomFieldValue'
|
when 'CustomValue', 'CustomFieldValue'
|
||||||
if object.custom_field
|
if object.custom_field
|
||||||
f = object.custom_field.format.formatted_custom_value(self, object, html)
|
f = object.custom_field.format.formatted_custom_value(self, object, html)
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest
|
|||||||
assert_equal 1, link.size
|
assert_equal 1, link.size
|
||||||
assert_equal "testfile.txt", link.text
|
assert_equal "testfile.txt", link.text
|
||||||
|
|
||||||
# download the attachment
|
# preview the attachment
|
||||||
get link.attr('href')
|
get link.attr('href')
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal "text/plain", response.content_type
|
assert_template :file
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_create_without_attachment
|
def test_create_without_attachment
|
||||||
|
|||||||
Reference in New Issue
Block a user