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:
commit
3bbf9f26da
@ -81,7 +81,7 @@ Redmine::WikiFormatting::Macros.register do
|
|||||||
raise ArgumentError if args.length < 1 # Requires file id
|
raise ArgumentError if args.length < 1 # Requires file id
|
||||||
file = DmsfFile.visible.find args[0].strip
|
file = DmsfFile.visible.find args[0].strip
|
||||||
if User.current && User.current.allowed_to?(:view_dmsf_files, file.project)
|
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
|
else
|
||||||
raise l(:notice_not_authorized)
|
raise l(:notice_not_authorized)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user