Merge pull request #899 from laurentpsychedelic/feature/CustomCaptionForDmsfdMacro

Added the ability to set a custom caption where referencing file details with the {{dmsfd(...)}} macro
This commit is contained in:
Karel Picman 2018-08-10 09:35:49 +02:00 committed by GitHub
commit 3bbf9f26da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ Redmine::WikiFormatting::Macros.register do
raise ArgumentError if args.length < 1 # Requires file id
file = DmsfFile.visible.find args[0].strip
if User.current && User.current.allowed_to?(:view_dmsf_files, file.project)
return link_to file.title, dmsf_file_path(:id => file)
return link_to(h(args[1] ? args[1] : file.title), dmsf_file_path(:id => file))
else
raise l(:notice_not_authorized)
end