2007-03-12 20:59:02 +03:00
|
|
|
<h3><%=l(:label_document_plural)%></h3>
|
|
|
|
|
2008-08-26 15:08:45 +04:00
|
|
|
<% project_ids = @user.projects.select {|p| @user.allowed_to?(:view_documents, p)}.collect(&:id) %>
|
2007-03-12 20:59:02 +03:00
|
|
|
<%= render(:partial => 'documents/document',
|
|
|
|
:collection => Document.find(:all,
|
|
|
|
:limit => 10,
|
2007-03-16 01:11:02 +03:00
|
|
|
:order => "#{Document.table_name}.created_on DESC",
|
2008-08-26 15:08:45 +04:00
|
|
|
:conditions => "#{Document.table_name}.project_id in (#{project_ids.join(',')})",
|
|
|
|
:include => [:project])) unless project_ids.empty? %>
|