summaryrefslogtreecommitdiffstats
path: root/app/controllers/projects_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r--app/controllers/projects_controller.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index e7a79e495..b9bda6b43 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -34,6 +34,8 @@ class ProjectsController < ApplicationController
helper :issues
helper :queries
include QueriesHelper
+ helper :projects_queries
+ include ProjectsQueriesHelper
helper :repositories
helper :members
helper :trackers
@@ -50,7 +52,9 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html {
- @projects = scope.to_a
+ @entry_count = scope.count
+ @entry_pages = Paginator.new @entry_count, per_page_option, params['page']
+ @entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).to_a
}
format.api {
@offset, @limit = api_offset_and_limit
@@ -61,6 +65,11 @@ class ProjectsController < ApplicationController
projects = scope.reorder(:created_on => :desc).limit(Setting.feeds_limit.to_i).to_a
render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}")
}
+ format.csv {
+ # Export all entries
+ @entries = scope.to_a
+ send_data(query_to_csv(@entries, @query, params), :type => 'text/csv; header=present', :filename => 'projects.csv')
+ }
end
end