Merge pull request #55 from HDinger/fix/22814-documents-widget-on-my-page-cannot-be-removed

[22814] Documents widget on My Page cannot be removed
pull/6827/head
ulferts 9 years ago
commit 9c5d9a8670
  1. 9
      app/views/my/blocks/_documents.html.erb
  2. 18
      app/views/my_projects_overviews/blocks/_documents.html.erb

@ -30,12 +30,15 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<h3><%=l(:label_document_plural)%></h3>
<% if defined? block_name %>
<%= content_for "#{block_name}_remove_block" %>
<%= content_for "#{block_name}-remove-block" %>
<% end %>
<h3 class="widget-box--header">
<span class="icon-context icon-notes"></span>
<span class="widget-box--header-title"><%=l(:label_document_plural)%></span>
</h3>
<% project_ids = @user.projects.select {|p| @user.allowed_to?(:view_documents, p)}.collect(&:id) %>
<%= render(partial: 'documents/document',
collection: Document

@ -29,7 +29,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<h3><%=l(:label_document_plural)%></h3>
<div class="box-actions">
<% if User.current.allowed_to?(:remove_block, nil, global: true) %>
<%= link_to_remote '', {
confirm: l(:label_confirm_delete),
url: { action: "remove_block", block: 'documents' },
html: { class: "icon icon-close", title: l(:button_delete) }
}
%>
<% end %>
</div>
<h3 class="widget-box--header">
<span class="icon-context icon-notes"></span>
<span class="widget-box--header-title"><%=l(:label_document_plural)%></span>
</h3>
<% if @user.allowed_to?(:view_documents, @project)%>
<%= render(:partial => 'documents/document',

Loading…
Cancel
Save