mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Don't check if attachments are editable individually.
git-svn-id: http://svn.redmine.org/redmine/trunk@13935 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9d3f3289b8
commit
e04c819895
@ -34,12 +34,17 @@ module AttachmentsHelper
|
||||
def link_to_attachments(container, options = {})
|
||||
options.assert_valid_keys(:author, :thumbnails)
|
||||
|
||||
if container.attachments.any?
|
||||
options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)
|
||||
attachments = container.attachments.preload(:author).to_a
|
||||
if attachments.any?
|
||||
options = {
|
||||
:editable => container.attachments_editable?,
|
||||
:deletable => container.attachments_deletable?,
|
||||
:author => true
|
||||
}.merge(options)
|
||||
render :partial => 'attachments/links',
|
||||
:locals => {
|
||||
:container => container,
|
||||
:attachments => container.attachments,
|
||||
:attachments => attachments,
|
||||
:options => options,
|
||||
:thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="contextual">
|
||||
<%= link_to image_tag('edit.png'),
|
||||
container_attachments_edit_path(container),
|
||||
:title => l(:label_edit_attachments) if attachments.any?(&:editable?) %>
|
||||
:title => l(:label_edit_attachments) if options[:editable] %>
|
||||
</div>
|
||||
<% for attachment in attachments %>
|
||||
<p><%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user