Added the ability to set a custom caption where referencing file details with the {{dmsfd(...)}} macro

Example:
        {{dmsfd(123, File details)}} -> <a href="/dmsf/files/123">File details</a>
This commit is contained in:
Laurent FABRE 2018-08-10 08:57:07 +09:00
parent 2dbadfc2c2
commit 952f3d953e

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