@@ -1,8 +1,9 | |||||
1 | <h3><%=l(:label_document_plural)%></h3> |
|
1 | <h3><%=l(:label_document_plural)%></h3> | |
2 |
|
2 | |||
|
3 | <% project_ids = @user.projects.select {|p| @user.allowed_to?(:view_documents, p)}.collect(&:id) %> | |||
3 | <%= render(:partial => 'documents/document', |
|
4 | <%= render(:partial => 'documents/document', | |
4 | :collection => Document.find(:all, |
|
5 | :collection => Document.find(:all, | |
5 | :limit => 10, |
|
6 | :limit => 10, | |
6 | :order => "#{Document.table_name}.created_on DESC", |
|
7 | :order => "#{Document.table_name}.created_on DESC", | |
7 |
:conditions => "#{Document.table_name}.project_id in (#{ |
|
8 | :conditions => "#{Document.table_name}.project_id in (#{project_ids.join(',')})", | |
8 |
:include => [:project])) unless |
|
9 | :include => [:project])) unless project_ids.empty? %> No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now