From db059c47de64b75b34867fbb5cc076d8741d595b Mon Sep 17 00:00:00 2001 From: Henriette Dinger Date: Mon, 14 Mar 2016 09:48:12 +0100 Subject: [PATCH] Adapt strucutre acording to LSG to enable delete functionality --- app/views/my/blocks/_documents.html.erb | 9 ++++++--- .../blocks/_documents.html.erb | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/app/views/my/blocks/_documents.html.erb b/app/views/my/blocks/_documents.html.erb index 3fbdbf1028..620bcda772 100644 --- a/app/views/my/blocks/_documents.html.erb +++ b/app/views/my/blocks/_documents.html.erb @@ -30,12 +30,15 @@ See doc/COPYRIGHT.rdoc for more details. ++#%> -

<%=l(:label_document_plural)%>

- <% if defined? block_name %> - <%= content_for "#{block_name}_remove_block" %> + <%= content_for "#{block_name}-remove-block" %> <% end %> +

+ + <%=l(:label_document_plural)%> +

+ <% project_ids = @user.projects.select {|p| @user.allowed_to?(:view_documents, p)}.collect(&:id) %> <%= render(partial: 'documents/document', collection: Document diff --git a/app/views/my_projects_overviews/blocks/_documents.html.erb b/app/views/my_projects_overviews/blocks/_documents.html.erb index 03562ef2b4..ba43dc2f72 100644 --- a/app/views/my_projects_overviews/blocks/_documents.html.erb +++ b/app/views/my_projects_overviews/blocks/_documents.html.erb @@ -29,7 +29,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See doc/COPYRIGHT.rdoc for more details. ++#%> -

<%=l(:label_document_plural)%>

+ +
+ <% 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 %> +
+ +

+ + <%=l(:label_document_plural)%> +

+ <% if @user.allowed_to?(:view_documents, @project)%> <%= render(:partial => 'documents/document',