Show the most recent file when displaying an inline image.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1939 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ccbe48d779
commit
58fbf5e66f
|
@ -241,6 +241,7 @@ module ApplicationHelper
|
|||
attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
|
||||
|
||||
if attachments
|
||||
attachments = attachments.sort_by(&:created_on).reverse
|
||||
text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(gif|jpg|jpeg|png))!/) do |m|
|
||||
style = $1
|
||||
filename = $6
|
||||
|
|
Loading…
Reference in New Issue