mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 23:11:12 +00:00
git-svn-id: http://svn.redmine.org/redmine/trunk@16738 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c15eaf46db
commit
c7e32aa202
@ -975,7 +975,7 @@ module ApplicationHelper
|
|||||||
attachments = options[:attachments] || []
|
attachments = options[:attachments] || []
|
||||||
attachments += obj.attachments if obj.respond_to?(:attachments)
|
attachments += obj.attachments if obj.respond_to?(:attachments)
|
||||||
if attachments && attachment = Attachment.latest_attach(attachments, name)
|
if attachments && attachment = Attachment.latest_attach(attachments, name)
|
||||||
link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
|
link = link_to_attachment(attachment, :only_path => only_path, :class => 'attachment')
|
||||||
end
|
end
|
||||||
when 'project'
|
when 'project'
|
||||||
if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first
|
if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first
|
||||||
|
|||||||
@ -667,7 +667,7 @@ RAW
|
|||||||
|
|
||||||
def test_attachment_links
|
def test_attachment_links
|
||||||
text = 'attachment:error281.txt'
|
text = 'attachment:error281.txt'
|
||||||
result = link_to("error281.txt", "/attachments/download/1/error281.txt",
|
result = link_to("error281.txt", "/attachments/1/error281.txt",
|
||||||
:class => "attachment")
|
:class => "attachment")
|
||||||
assert_equal "<p>#{result}</p>",
|
assert_equal "<p>#{result}</p>",
|
||||||
textilizable(text,
|
textilizable(text,
|
||||||
@ -679,7 +679,7 @@ RAW
|
|||||||
set_tmp_attachments_directory
|
set_tmp_attachments_directory
|
||||||
a1 = Attachment.generate!(:filename => "test.txt", :created_on => 1.hour.ago)
|
a1 = Attachment.generate!(:filename => "test.txt", :created_on => 1.hour.ago)
|
||||||
a2 = Attachment.generate!(:filename => "test.txt")
|
a2 = Attachment.generate!(:filename => "test.txt")
|
||||||
result = link_to("test.txt", "/attachments/download/#{a2.id}/test.txt",
|
result = link_to("test.txt", "/attachments/#{a2.id}/test.txt",
|
||||||
:class => "attachment")
|
:class => "attachment")
|
||||||
assert_equal "<p>#{result}</p>",
|
assert_equal "<p>#{result}</p>",
|
||||||
textilizable('attachment:test.txt', :attachments => [a1, a2])
|
textilizable('attachment:test.txt', :attachments => [a1, a2])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user