We'd like to share with you an all the others a little improvement we have done
to dmsf macros, adding a new one to jump to the document instead of
downloading it.
We 'cloned' the dmsf macro into a new one, dmsfd, inside the file
/redmine_dmsf/init.rb:
Redmine::WikiFormatting::Macros.register do
desc "Wiki link to DMSF document description:\n\n" +
"{{dmsfd(file_id [, title [, revision_id]])}}\n\n" +
"_file_id_ / _revision_id_ can be found in link for file/revision download."
macro :dmsfd do |obj, args|
return nil if args.length < 1 # require file id
entry_id = args[0].strip
entry = DmsfFile.find(entry_id)
unless entry.nil? || entry.deleted
title = args[1] ? args[1] : entry.title
revision = args[2] ? args[2] : ""
return link_to "#{title}", :controller => "dmsf_files", :action => "show", :id => entry
end
nil
end
end
What version of the DMSF and Redmine are you using? On what browser and
operating
system?
redine 1.2.0, dmsf 1.2.1
Please provide any additional information below.
Feel free to do with this macro what you think could be useful to do.
From our side, in our way of using dmsf we have found very useful to include
into tasks and wikipages the link to a document description instead of going
straight to the file download (e.g.: it helps to understand where a document is)
Original issue reported on code.google.com by pia.alg...@gmail.com on 9 Nov 2011 at 12:06
Original issue reported on code.google.com by
pia.alg...@gmail.com
on 9 Nov 2011 at 12:06