diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-12-09 16:54:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-12-09 16:54:46 +0000 |
commit | 5d2899ee1b3e00d0cf43521182b1244dfc3cfe9f (patch) | |
tree | eb64711c0150fafb698da9d92eb0d6735a5461cf /app/helpers/attachments_helper.rb | |
parent | 2b6e332318a3e0a9489d20280010bb2d00206d95 (diff) | |
download | redmine-5d2899ee1b3e00d0cf43521182b1244dfc3cfe9f.tar.gz redmine-5d2899ee1b3e00d0cf43521182b1244dfc3cfe9f.zip |
AttachmentsController now handles attachments deletion.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2116 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/attachments_helper.rb')
-rw-r--r-- | app/helpers/attachments_helper.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index ebf417bab..29cdb9790 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -16,10 +16,15 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module AttachmentsHelper - # displays the links to a collection of attachments - def link_to_attachments(attachments, options = {}) - if attachments.any? - render :partial => 'attachments/links', :locals => {:attachments => attachments, :options => options} + # Displays view/delete links to the attachments of the given object + # Options: + # :author -- author names are not displayed if set to false + def link_to_attachments(container, options = {}) + options.assert_valid_keys(:author) + + if container.attachments.any? + options = {:deletable => container.attachments_deletable?, :author => true}.merge(options) + render :partial => 'attachments/links', :locals => {:attachments => container.attachments, :options => options} end end |